Version 5.0.0 beta 4
This commit is contained in:
1 parent
e86153356a
commit
2f24f9de48
276 files changed
+8614
-6044
No files matched your search
@@ -37,9 +37,9 @@ class Coppermine extends Software
|
||||
/**
|
||||
* Software Name
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareName()
|
||||
public static function softwareName(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "Coppermine (phpBB 3.1.x/3.2.x)";
|
||||
@@ -48,9 +48,9 @@ class Coppermine extends Software
|
||||
/**
|
||||
* Software Key
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareKey()
|
||||
public static function softwareKey(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "coppermine";
|
||||
@@ -59,9 +59,9 @@ class Coppermine 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(
|
||||
'convertGalleryCategories' => array(
|
||||
@@ -86,9 +86,9 @@ class Coppermine extends Software
|
||||
/**
|
||||
* Possible Parent Conversions
|
||||
*
|
||||
* @return NULL|array
|
||||
* @return array|NULL
|
||||
*/
|
||||
public static function parents()
|
||||
public static function parents(): ?array
|
||||
{
|
||||
return array( 'core' => array( 'phpbb' ) );
|
||||
}
|
||||
@@ -96,9 +96,9 @@ class Coppermine 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(
|
||||
'convertGalleryAlbums',
|
||||
@@ -109,10 +109,10 @@ class Coppermine extends Software
|
||||
/**
|
||||
* Get More Information
|
||||
*
|
||||
* @param string $method Method name
|
||||
* @return array
|
||||
* @param string $method Method name
|
||||
* @return array|null
|
||||
*/
|
||||
public function getMoreInfo( $method )
|
||||
public function getMoreInfo( string $method ): ?array
|
||||
{
|
||||
$return = array();
|
||||
switch( $method )
|
||||
@@ -152,9 +152,9 @@ class Coppermine 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
|
||||
{
|
||||
/* Content Rebuilds */
|
||||
Task::queue( 'convert', 'RebuildGalleryImages', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
|
||||
@@ -174,7 +174,7 @@ class Coppermine extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryCategories()
|
||||
public function convertGalleryCategories() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -199,7 +199,7 @@ class Coppermine extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryAlbums()
|
||||
public function convertGalleryAlbums() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -209,7 +209,7 @@ class Coppermine extends Software
|
||||
{
|
||||
$info = array(
|
||||
'album_id' => $row['aid'],
|
||||
'album_owner_id' => isset( $row['owner'] ) ? $row['owner'] : NULL,
|
||||
'album_owner_id' => $row['owner'] ?? NULL,
|
||||
'album_category_id' => $row['category'],
|
||||
'album_description' => $row['description'],
|
||||
'album_position' => $row['pos'],
|
||||
@@ -243,7 +243,7 @@ class Coppermine extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryImages()
|
||||
public function convertGalleryImages() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -303,7 +303,7 @@ class Coppermine extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryComments()
|
||||
public function convertGalleryComments() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ class Invisioncommunity extends Software
|
||||
/**
|
||||
* @brief Whether the versions of IPS4 match
|
||||
*/
|
||||
public static $versionMatch = FALSE;
|
||||
public static bool $versionMatch = FALSE;
|
||||
|
||||
/**
|
||||
* @brief Whether the database has been required
|
||||
*/
|
||||
public static $dbNeeded = FALSE;
|
||||
public static bool $dbNeeded = FALSE;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -60,12 +60,12 @@ class Invisioncommunity extends Software
|
||||
* @return void
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct( App $app, $needDB = TRUE )
|
||||
public function __construct( App $app, bool $needDB = TRUE )
|
||||
{
|
||||
/* Set filename obscuring flag */
|
||||
Library::$obscureFilenames = FALSE;
|
||||
|
||||
$return = parent::__construct( $app, $needDB );
|
||||
parent::__construct( $app, $needDB );
|
||||
|
||||
if ( $needDB )
|
||||
{
|
||||
@@ -86,8 +86,6 @@ class Invisioncommunity extends Software
|
||||
/* Get parent sauce */
|
||||
$this->parent = $this->app->_parent->getSource();
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,7 +93,7 @@ class Invisioncommunity extends Software
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareName()
|
||||
public static function softwareName(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return 'Invision Community (' . Application::load( 'core' )->version . ')';
|
||||
@@ -106,7 +104,7 @@ class Invisioncommunity extends Software
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareKey()
|
||||
public static function softwareKey(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "invisioncommunity";
|
||||
@@ -115,9 +113,9 @@ class Invisioncommunity extends Software
|
||||
/**
|
||||
* Content we can convert from this software.
|
||||
*
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public static function canConvert()
|
||||
public static function canConvert(): ?array
|
||||
{
|
||||
if( !static::$versionMatch AND static::$dbNeeded )
|
||||
{
|
||||
@@ -163,9 +161,9 @@ class Invisioncommunity extends Software
|
||||
/**
|
||||
* Requires Parent
|
||||
*
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public static function requiresParent()
|
||||
public static function requiresParent(): bool
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -173,9 +171,9 @@ class Invisioncommunity extends Software
|
||||
/**
|
||||
* Possible Parent Conversions
|
||||
*
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public static function parents()
|
||||
public static function parents(): ?array
|
||||
{
|
||||
return array( 'core' => array( 'invisioncommunity' ) );
|
||||
}
|
||||
@@ -183,9 +181,9 @@ class Invisioncommunity 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',
|
||||
@@ -196,10 +194,10 @@ class Invisioncommunity extends Software
|
||||
/**
|
||||
* Get More Information
|
||||
*
|
||||
* @param string $method Method name
|
||||
* @return array
|
||||
* @param string $method Method name
|
||||
* @return array|null
|
||||
*/
|
||||
public function getMoreInfo( $method )
|
||||
public function getMoreInfo( string $method ): ?array
|
||||
{
|
||||
$return = array();
|
||||
|
||||
@@ -212,7 +210,7 @@ class Invisioncommunity extends Software
|
||||
$return[ $method ] = array(
|
||||
'upload_path' => array(
|
||||
'field_class' => 'IPS\\Helpers\\Form\\Text',
|
||||
'field_default' => isset( $this->parent->app->_session['more_info']['convertEmoticons']['upload_path'] ) ? $this->parent->app->_session['more_info']['convertEmoticons']['upload_path'] : NULL,
|
||||
'field_default' => $this->parent->app->_session['more_info']['convertEmoticons']['upload_path'] ?? NULL,
|
||||
'field_required' => TRUE,
|
||||
'field_extra' => array(),
|
||||
'field_hint' => Member::loggedIn()->language()->addToStack('convert_invision_upload_path'),
|
||||
@@ -228,9 +226,9 @@ class Invisioncommunity 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
|
||||
{
|
||||
/* Content Rebuilds */
|
||||
Task::queue( 'convert', 'RebuildGalleryImages', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
|
||||
@@ -251,7 +249,7 @@ class Invisioncommunity extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertAttachments()
|
||||
public function convertAttachments() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'attach_id' );
|
||||
@@ -293,7 +291,7 @@ class Invisioncommunity extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryAlbums()
|
||||
public function convertGalleryAlbums() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'album_id' );
|
||||
@@ -338,7 +336,7 @@ class Invisioncommunity extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryAlbumComments()
|
||||
public function convertGalleryAlbumComments() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'comment_id' );
|
||||
@@ -371,7 +369,7 @@ class Invisioncommunity extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryAlbumReviews()
|
||||
public function convertGalleryAlbumReviews() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'review_id' );
|
||||
@@ -404,7 +402,7 @@ class Invisioncommunity extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryCategories()
|
||||
public function convertGalleryCategories() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'category_id' );
|
||||
@@ -444,7 +442,7 @@ class Invisioncommunity extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryComments()
|
||||
public function convertGalleryComments() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'comment_id' );
|
||||
@@ -477,7 +475,7 @@ class Invisioncommunity extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryImages()
|
||||
public function convertGalleryImages() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'image_id' );
|
||||
@@ -527,9 +525,9 @@ class Invisioncommunity extends Software
|
||||
/**
|
||||
* Check if we can redirect the legacy URLs from this software to the new locations
|
||||
*
|
||||
* @return NULL|Url
|
||||
* @return Url|NULL
|
||||
*/
|
||||
public function checkRedirects()
|
||||
public function checkRedirects(): ?Url
|
||||
{
|
||||
$url = Request::i()->url();
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ class Photoplog extends Software
|
||||
/**
|
||||
* Software Name
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareName()
|
||||
public static function softwareName(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "PhotoPlog (vBulletin 3.x/4.x)";
|
||||
@@ -49,9 +49,9 @@ class Photoplog extends Software
|
||||
/**
|
||||
* Software Key
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareKey()
|
||||
public static function softwareKey(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "photoplog";
|
||||
@@ -60,9 +60,9 @@ class Photoplog 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(
|
||||
'convertGalleryCategories' => array(
|
||||
@@ -87,9 +87,9 @@ class Photoplog extends Software
|
||||
/**
|
||||
* Requires Parent
|
||||
*
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public static function requiresParent()
|
||||
public static function requiresParent(): bool
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -97,9 +97,9 @@ class Photoplog extends Software
|
||||
/**
|
||||
* Possible Parent Conversions
|
||||
*
|
||||
* @return NULL|array
|
||||
* @return array|NULL
|
||||
*/
|
||||
public static function parents()
|
||||
public static function parents(): ?array
|
||||
{
|
||||
return array( 'core' => array( 'vbulletin' ) );
|
||||
}
|
||||
@@ -107,9 +107,9 @@ class Photoplog 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(
|
||||
'convertGalleryAlbums',
|
||||
@@ -120,9 +120,9 @@ class Photoplog 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
|
||||
{
|
||||
/* Content Rebuilds */
|
||||
Task::queue( 'convert', 'RebuildGalleryImages', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
|
||||
@@ -137,10 +137,10 @@ class Photoplog extends Software
|
||||
/**
|
||||
* Get More Information
|
||||
*
|
||||
* @param string $method Method name
|
||||
* @return array
|
||||
* @param string $method Method name
|
||||
* @return array|null
|
||||
*/
|
||||
public function getMoreInfo( $method )
|
||||
public function getMoreInfo( string $method ): ?array
|
||||
{
|
||||
$return = array();
|
||||
switch( $method )
|
||||
@@ -182,7 +182,7 @@ class Photoplog extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryAlbums()
|
||||
public function convertGalleryAlbums() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -215,7 +215,7 @@ class Photoplog extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryCategories()
|
||||
public function convertGalleryCategories() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -240,7 +240,7 @@ class Photoplog extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryImages()
|
||||
public function convertGalleryImages() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'fileid' );
|
||||
@@ -297,7 +297,7 @@ class Photoplog extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryComments()
|
||||
public function convertGalleryComments() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ class Photopost extends Software
|
||||
/**
|
||||
* Software Name
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareName()
|
||||
public static function softwareName(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "Photopost (8.x)";
|
||||
@@ -52,9 +52,9 @@ class Photopost extends Software
|
||||
/**
|
||||
* Software Key
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareKey()
|
||||
public static function softwareKey(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "photopost";
|
||||
@@ -63,9 +63,9 @@ class Photopost extends Software
|
||||
/**
|
||||
* Requires Parent
|
||||
*
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public static function requiresParent()
|
||||
public static function requiresParent(): bool
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -73,9 +73,9 @@ class Photopost extends Software
|
||||
/**
|
||||
* Possible Parent Conversions
|
||||
*
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public static function parents()
|
||||
public static function parents(): ?array
|
||||
{
|
||||
return array( 'core' => array( 'photopost' ) );
|
||||
}
|
||||
@@ -83,9 +83,9 @@ class Photopost 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(
|
||||
'convertGalleryCategories' => array(
|
||||
@@ -110,9 +110,9 @@ class Photopost 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(
|
||||
'convertGalleryAlbums',
|
||||
@@ -123,10 +123,10 @@ class Photopost 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 )
|
||||
@@ -167,9 +167,9 @@ class Photopost 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
|
||||
{
|
||||
/* Content Rebuilds */
|
||||
Task::queue( 'convert', 'RebuildGalleryImages', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
|
||||
@@ -186,7 +186,7 @@ class Photopost extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryCategories()
|
||||
public function convertGalleryCategories() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -212,7 +212,7 @@ class Photopost extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryAlbums()
|
||||
public function convertGalleryAlbums() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -246,13 +246,13 @@ class Photopost extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryImages()
|
||||
public function convertGalleryImages() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
$libraryClass::setKey( 'id' );
|
||||
|
||||
foreach( $this->fetch( 'photos', 'id' ) AS $row )
|
||||
foreach( $this->fetch( 'photos' ) AS $row )
|
||||
{
|
||||
$info = array(
|
||||
'image_id' => $row['id'],
|
||||
@@ -286,13 +286,13 @@ class Photopost extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryComments()
|
||||
public function convertGalleryComments() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
$libraryClass::setKey( 'id' );
|
||||
|
||||
foreach( $this->fetch( 'comments', 'id' ) AS $row )
|
||||
foreach( $this->fetch( 'comments' ) AS $row )
|
||||
{
|
||||
$libraryClass->convertGalleryComment( array(
|
||||
'comment_id' => $row['id'],
|
||||
@@ -312,9 +312,9 @@ class Photopost extends Software
|
||||
/**
|
||||
* Check if we can redirect the legacy URLs from this software to the new locations
|
||||
*
|
||||
* @return NULL|Url
|
||||
* @return Url|NULL
|
||||
*/
|
||||
public function checkRedirects()
|
||||
public function checkRedirects(): ?Url
|
||||
{
|
||||
$url = Request::i()->url();
|
||||
|
||||
@@ -323,7 +323,7 @@ class Photopost extends Software
|
||||
if( !$id = Request::i()->cat )
|
||||
{
|
||||
preg_match( '#cat/([0-9]+)#', $url->data[ Url::COMPONENT_PATH ], $matches );
|
||||
$id = isset( $matches[1] ) ? $matches[1] : NULL;
|
||||
$id = $matches[1] ?? NULL;
|
||||
}
|
||||
|
||||
try
|
||||
@@ -347,7 +347,7 @@ class Photopost extends Software
|
||||
if( !$id = Request::i()->photo )
|
||||
{
|
||||
preg_match( '#photo/([0-9]+)#', $url->data[ Url::COMPONENT_PATH ], $matches );
|
||||
$id = isset( $matches[1] ) ? $matches[1] : NULL;
|
||||
$id = $matches[1] ?? NULL;
|
||||
}
|
||||
|
||||
try
|
||||
|
||||
@@ -17,7 +17,7 @@ use Exception;
|
||||
use InvalidArgumentException;
|
||||
use IPS\convert\App;
|
||||
use IPS\convert\Software;
|
||||
use IPS\convert\Software\Core\Vbulletin;
|
||||
use IPS\convert\Software\Core\Vbulletin as VBulletinSoftware;
|
||||
use IPS\File;
|
||||
use IPS\gallery\Album;
|
||||
use IPS\gallery\Image;
|
||||
@@ -44,12 +44,12 @@ class Vbulletin extends Software
|
||||
/**
|
||||
* @brief vBulletin 4 Stores all attachments under one table - this will store the content type for the forums app.
|
||||
*/
|
||||
protected static $imageContentType = NULL;
|
||||
protected static mixed $imageContentType = NULL;
|
||||
|
||||
/**
|
||||
* @brief The schematic for vB3 and vB4 is similar enough that we can make specific concessions in a sinle converter for either version.
|
||||
*/
|
||||
protected static $isLegacy = NULL;
|
||||
protected static ?bool $isLegacy = NULL;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -59,9 +59,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? */
|
||||
if ( $needDB )
|
||||
@@ -91,16 +91,14 @@ class Vbulletin extends Software
|
||||
}
|
||||
catch( Exception $e ) {}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Software Name
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareName()
|
||||
public static function softwareName(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "vBulletin Gallery (3.8.x/4.x)";
|
||||
@@ -109,9 +107,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";
|
||||
@@ -120,14 +118,14 @@ class Vbulletin extends Software
|
||||
/**
|
||||
* Content we can convert from this software.
|
||||
*
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public static function canConvert()
|
||||
public static function canConvert(): ?array
|
||||
{
|
||||
$imageWhere = NULL;
|
||||
$imageTable = 'picture';
|
||||
|
||||
if ( static::$isLegacy == FALSE )
|
||||
if ( !static::$isLegacy )
|
||||
{
|
||||
$imageWhere = array( "contenttypeid=?", static::$imageContentType );
|
||||
$imageTable = 'attachment';
|
||||
@@ -152,9 +150,9 @@ class Vbulletin extends Software
|
||||
/**
|
||||
* Requires Parent
|
||||
*
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public static function requiresParent()
|
||||
public static function requiresParent(): bool
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -162,9 +160,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' ) );
|
||||
}
|
||||
@@ -172,9 +170,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
|
||||
{
|
||||
/* Content Rebuilds */
|
||||
Task::queue( 'convert', 'RebuildGalleryImages', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
|
||||
@@ -194,23 +192,23 @@ 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
|
||||
{
|
||||
return Vbulletin::fixPostData( $post, $className, $contentId );
|
||||
return VBulletinSoftware::fixPostData( $post, $className, $contentId );
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 )
|
||||
@@ -241,9 +239,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( 'convertGalleryImages' );
|
||||
}
|
||||
@@ -253,7 +251,7 @@ class Vbulletin extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryAlbums()
|
||||
public function convertGalleryAlbums() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -296,7 +294,7 @@ class Vbulletin extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryImages()
|
||||
public function convertGalleryImages() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -396,7 +394,7 @@ class Vbulletin extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryComments()
|
||||
public function convertGalleryComments() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -460,9 +458,9 @@ class Vbulletin extends Software
|
||||
/**
|
||||
* Check if we can redirect the legacy URLs from this software to the new locations
|
||||
*
|
||||
* @return NULL|Url
|
||||
* @return Url|NULL
|
||||
*/
|
||||
public function checkRedirects()
|
||||
public function checkRedirects(): ?Url
|
||||
{
|
||||
$url = Request::i()->url();
|
||||
|
||||
|
||||
@@ -46,17 +46,17 @@ 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 XF2 Has prefixes on RM tables
|
||||
*/
|
||||
public static $tablePrefix = 'xengallery_';
|
||||
public static string $tablePrefix = 'xengallery_';
|
||||
|
||||
/**
|
||||
* @brief XF2.1 changed serialized data to json decoded
|
||||
*/
|
||||
public static $useJson = FALSE;
|
||||
public static bool $useJson = FALSE;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@@ -66,9 +66,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 )
|
||||
{
|
||||
@@ -97,16 +97,14 @@ class Xenforo extends Software
|
||||
}
|
||||
catch( Exception $e ) {} # If we can't query, we won't be able to do anything anyway
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Software Name
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareName()
|
||||
public static function softwareName(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "XenForo Media Gallery (1.5.x/2.0.x/2.1.x/2.2.x)";
|
||||
@@ -115,9 +113,9 @@ class Xenforo extends Software
|
||||
/**
|
||||
* Software Key
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareKey()
|
||||
public static function softwareKey(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "xenforo";
|
||||
@@ -126,9 +124,9 @@ class Xenforo 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(
|
||||
'convertGalleryCategories' => array(
|
||||
@@ -153,13 +151,13 @@ class Xenforo 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 \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 )
|
||||
{
|
||||
@@ -178,16 +176,17 @@ class Xenforo extends Software
|
||||
|
||||
default:
|
||||
return parent::countRows( $table, $where, $recache );
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses Prefix
|
||||
*
|
||||
* @return bool
|
||||
* @return bool
|
||||
*/
|
||||
public static function usesPrefix()
|
||||
public static function usesPrefix(): bool
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -195,9 +194,9 @@ class Xenforo extends Software
|
||||
/**
|
||||
* Requires Parent
|
||||
*
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public static function requiresParent()
|
||||
public static function requiresParent(): bool
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -205,9 +204,9 @@ class Xenforo extends Software
|
||||
/**
|
||||
* Possible Parent Conversions
|
||||
*
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public static function parents()
|
||||
public static function parents(): ?array
|
||||
{
|
||||
return array( 'core' => array( 'xenforo' ) );
|
||||
}
|
||||
@@ -215,9 +214,9 @@ class Xenforo 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(
|
||||
'convertGalleryAlbums',
|
||||
@@ -228,10 +227,10 @@ class Xenforo 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 )
|
||||
@@ -297,9 +296,9 @@ class Xenforo 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
|
||||
{
|
||||
/* Content Rebuilds */
|
||||
Task::queue( 'convert', 'RebuildGalleryImages', array( 'app' => $this->app->app_id ), 2, array( 'app' ) );
|
||||
@@ -321,7 +320,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
|
||||
{
|
||||
@@ -339,7 +338,7 @@ class Xenforo extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryCategories()
|
||||
public function convertGalleryCategories() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -349,10 +348,10 @@ class Xenforo extends Software
|
||||
{
|
||||
$libraryClass->convertGalleryCategory( array(
|
||||
'category_id' => $row['category_id'],
|
||||
'category_name' => isset( $row['category_title'] ) ? $row['category_title'] : $row['title'],
|
||||
'category_desc' => isset( $row['category_description'] ) ? $row['category_description'] : $row['description'],
|
||||
'category_name' => $row['category_title'] ?? $row['title'],
|
||||
'category_desc' => $row['category_description'] ?? $row['description'],
|
||||
'category_parent_id' => $row['parent_category_id'],
|
||||
'category_count_imgs' => isset( $row['category_media_count'] ) ? $row['category_media_count'] : $row['media_count'],
|
||||
'category_count_imgs' => $row['category_media_count'] ?? $row['media_count'],
|
||||
'category_position' => $row['display_order']
|
||||
) );
|
||||
|
||||
@@ -382,7 +381,7 @@ class Xenforo extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryAlbums()
|
||||
public function convertGalleryAlbums() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -466,15 +465,15 @@ class Xenforo extends Software
|
||||
|
||||
$info = array(
|
||||
'album_id' => $row['album_id'],
|
||||
'album_owner_id' => isset( $row['album_user_id'] ) ? $row['album_user_id'] : $row['user_id'],
|
||||
'album_description' => isset( $row['album_description'] ) ? $row['album_description'] : $row['description'],
|
||||
'album_name' => isset( $row['album_title'] ) ? $row['album_title'] : $row['title'],
|
||||
'album_owner_id' => $row['album_user_id'] ?? $row['user_id'],
|
||||
'album_description' => $row['album_description'] ?? $row['description'],
|
||||
'album_name' => $row['album_title'] ?? $row['title'],
|
||||
'album_type' => $type,
|
||||
'album_count_imgs' => isset( $row['album_media_count'] ) ? $row['album_media_count'] : $row['media_count'],
|
||||
'album_count_comments' => isset( $row['album_comment_count'] ) ? $row['album_comment_count'] : $row['comment_count'],
|
||||
'album_rating_aggregate' => isset( $row['album_rating_avg'] ) ? $row['album_rating_avg'] : $row['rating_avg'],
|
||||
'album_rating_count' => isset( $row['album_rating_count'] ) ? $row['album_rating_count'] : $row['rating_count'],
|
||||
'album_rating_total' => isset( $row['album_rating_sum'] ) ? $row['album_rating_sum'] : $row['rating_sum'],
|
||||
'album_count_imgs' => $row['album_media_count'] ?? $row['media_count'],
|
||||
'album_count_comments' => $row['album_comment_count'] ?? $row['comment_count'],
|
||||
'album_rating_aggregate' => $row['album_rating_avg'] ?? $row['rating_avg'],
|
||||
'album_rating_count' => $row['album_rating_count'] ?? $row['rating_count'],
|
||||
'album_rating_total' => $row['album_rating_sum'] ?? $row['rating_sum'],
|
||||
);
|
||||
|
||||
$category = $this->app->_session['more_info']['convertGalleryAlbums']['members_gallery_category'];
|
||||
@@ -513,7 +512,7 @@ class Xenforo extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryImages()
|
||||
public function convertGalleryImages() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -579,7 +578,7 @@ class Xenforo extends Software
|
||||
$group = floor( $file_data['data_id'] / 1000 );
|
||||
$path = rtrim( $this->app->_session['more_info']['convertGalleryImages']['file_location'], '/' ) . '/' . $group . '/' . $file_data['data_id'] . '-' . $file_data['file_hash'] . '.data';
|
||||
$file_name = $file_data['filename'];
|
||||
$description = isset( $row['media_description'] ) ? $row['media_description'] : $row['description'];
|
||||
$description = $row['media_description'] ?? $row['description'];
|
||||
|
||||
break;
|
||||
|
||||
@@ -610,7 +609,7 @@ class Xenforo extends Software
|
||||
continue 2;
|
||||
}
|
||||
|
||||
$description = ( isset( $row['media_description'] ) ? $row['media_description'] : $row['description'] );
|
||||
$description = ( $row['media_description'] ?? $row['description'] );
|
||||
$description = $em . "<br>" . $description;
|
||||
|
||||
break;
|
||||
@@ -621,8 +620,8 @@ class Xenforo extends Software
|
||||
'image_album_id' => $row['album_id'],
|
||||
'image_category_id' => $row['category_id'],
|
||||
'image_member_id' => $row['user_id'],
|
||||
'image_caption' => isset( $row['media_title'] ) ? $row['media_title'] : $row['title'],
|
||||
'image_views' => isset( $row['media_view_count'] ) ? $row['media_view_count'] : $row['view_count'],
|
||||
'image_caption' => $row['media_title'] ?? $row['title'],
|
||||
'image_views' => $row['media_view_count'] ?? $row['view_count'],
|
||||
'image_comments' => $row['comment_count'],
|
||||
'image_ratings_total' => $row['rating_sum'],
|
||||
'image_ratings_count' => $row['rating_count'],
|
||||
@@ -726,9 +725,9 @@ class Xenforo extends Software
|
||||
$libraryClass->convertTag( array(
|
||||
'tag_meta_app' => 'gallery',
|
||||
'tag_meta_area' => 'gallery',
|
||||
'tag_meta_parent_id' => ( $row['album_id'] ) ? $row['album_id'] : $row['category_id'],
|
||||
'tag_meta_parent_id' => ( $row['album_id'] ) ?: $row['category_id'],
|
||||
'tag_meta_id' => $row['media_id'],
|
||||
'tag_text' => isset( $tag['tag_clean'] ) ? $tag['tag_clean'] : $tag['tag'], // Select 1.0 or 1.1 version
|
||||
'tag_text' => $tag['tag_clean'] ?? $tag['tag'], // Select 1.0 or 1.1 version
|
||||
'tag_prefix' => 0,
|
||||
'tag_member_id' => $row['user_id'],
|
||||
'tag_added' => $row['media_date']
|
||||
@@ -745,7 +744,7 @@ class Xenforo extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGalleryComments()
|
||||
public function convertGalleryComments() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
|
||||
Reference in new issue
Block a user