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
@@ -17,6 +17,7 @@ use Exception;
|
||||
use IPS\Application\Module;
|
||||
use IPS\Content\Search\Index;
|
||||
use IPS\convert\Software;
|
||||
use IPS\convert\Software\Exception as SoftwareException;
|
||||
use IPS\core\Ignore;
|
||||
use IPS\Data\Cache;
|
||||
use IPS\Data\Store;
|
||||
@@ -48,25 +49,25 @@ class UBBthreads extends Software
|
||||
* @brief Emoticons WHERE statement
|
||||
* @see convertEmoticons()
|
||||
*/
|
||||
protected static $emoticonsWhere = 'GRAEMLIN_IS_ACTIVE=1';
|
||||
protected static string $emoticonsWhere = 'GRAEMLIN_IS_ACTIVE=1';
|
||||
|
||||
/**
|
||||
* @brief Groups WHERE statement
|
||||
* @see convertGroups()
|
||||
*/
|
||||
protected static $groupsWhere = 'GROUP_IS_DISABLED=0';
|
||||
protected static string $groupsWhere = 'GROUP_IS_DISABLED=0';
|
||||
|
||||
/**
|
||||
* @brief Ignored users WHERE statement
|
||||
* @see convertIgnoredUsers()
|
||||
*/
|
||||
protected static $ignoredUsersWhere = "USER_IGNORE_LIST IS NOT NULL AND USER_IGNORE_LIST NOT IN ( '', '-' )";
|
||||
protected static string $ignoredUsersWhere = "USER_IGNORE_LIST IS NOT NULL AND USER_IGNORE_LIST NOT IN ( '', '-' )";
|
||||
|
||||
/**
|
||||
* @brief Members WHERE statement
|
||||
* @see convertMembers()
|
||||
*/
|
||||
protected static $membersWhere = array( 'u.USER_LOGIN_NAME<>?', '**DONOTDELETE**' );
|
||||
protected static array $membersWhere = array( 'u.USER_LOGIN_NAME<>?', '**DONOTDELETE**' );
|
||||
|
||||
/**
|
||||
* This is.. kind of hacky, but it's used so we can try and support non-exact profanity matches without converting
|
||||
@@ -75,7 +76,7 @@ class UBBthreads extends Software
|
||||
* @brief Profanity filters WHERE statement
|
||||
* @see convertProfanityFilters()
|
||||
*/
|
||||
protected static $profanityFiltersWhere = '(
|
||||
protected static string $profanityFiltersWhere = '(
|
||||
CENSOR_WORD NOT LIKE "%(.*)%" AND (
|
||||
CENSOR_WORD NOT LIKE "%(.*?)%" OR (
|
||||
CENSOR_WORD LIKE "%(.*?)" AND CENSOR_WORD NOT LIKE "%(.*?)%(.*?)"
|
||||
@@ -86,9 +87,9 @@ class UBBthreads extends Software
|
||||
/**
|
||||
* Software Name
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareName()
|
||||
public static function softwareName(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "UBBthreads";
|
||||
@@ -97,9 +98,9 @@ class UBBthreads extends Software
|
||||
/**
|
||||
* Software Key
|
||||
*
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
public static function softwareKey()
|
||||
public static function softwareKey(): string
|
||||
{
|
||||
/* Child classes must override this method */
|
||||
return "ubbthreads";
|
||||
@@ -108,9 +109,9 @@ class UBBthreads 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(
|
||||
'convertEmoticons' => array(
|
||||
@@ -156,9 +157,9 @@ class UBBthreads extends Software
|
||||
/**
|
||||
* Allows software to add additional menu row options
|
||||
*
|
||||
* @return array
|
||||
* @return array
|
||||
*/
|
||||
public function extraMenuRows()
|
||||
public function extraMenuRows(): array
|
||||
{
|
||||
$rows = array();
|
||||
$count = $this->countRows( static::canConvert()['convertMembersFollowers']['table'], static::canConvert()['convertMembersFollowers']['where'] );
|
||||
@@ -182,9 +183,9 @@ class UBBthreads extends Software
|
||||
/**
|
||||
* Can we convert passwords from this software.
|
||||
*
|
||||
* @return boolean
|
||||
* @return boolean
|
||||
*/
|
||||
public static function loginEnabled()
|
||||
public static function loginEnabled(): bool
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -192,13 +193,13 @@ class UBBthreads 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 )
|
||||
{
|
||||
@@ -214,9 +215,9 @@ class UBBthreads 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(
|
||||
'convertEmoticons',
|
||||
@@ -231,7 +232,7 @@ class UBBthreads extends Software
|
||||
* @param string $date Date to try to convert
|
||||
* @return DateTime|null
|
||||
*/
|
||||
protected function stringToDateTime( $date )
|
||||
protected function stringToDateTime( string $date ) : ?DateTime
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -246,10 +247,10 @@ class UBBthreads 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 )
|
||||
@@ -347,9 +348,9 @@ class UBBthreads 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();
|
||||
@@ -379,9 +380,9 @@ class UBBthreads 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 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
|
||||
@@ -398,7 +399,7 @@ class UBBthreads extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertBanfilters()
|
||||
public function convertBanfilters() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -432,7 +433,7 @@ class UBBthreads extends Software
|
||||
) );
|
||||
}
|
||||
|
||||
throw new \IPS\convert\Software\Exception;
|
||||
throw new SoftwareException;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -440,7 +441,7 @@ class UBBthreads extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertEmoticons()
|
||||
public function convertEmoticons() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -474,7 +475,7 @@ class UBBthreads extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertGroups()
|
||||
public function convertGroups() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'GROUP_ID' );
|
||||
@@ -508,7 +509,7 @@ class UBBthreads extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertIgnoredUsers()
|
||||
public function convertIgnoredUsers() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'USER_ID' );
|
||||
@@ -547,7 +548,7 @@ class UBBthreads extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertMembers()
|
||||
public function convertMembers() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'u.USER_ID' );
|
||||
@@ -635,7 +636,7 @@ class UBBthreads extends Software
|
||||
}
|
||||
|
||||
$fieldColumn = 'USER_' . strtoupper( $pseudo );
|
||||
$pfields[ $pseudo ] = isset( $row[ $fieldColumn ] ) ? $row[ $fieldColumn ] : NULL;
|
||||
$pfields[ $pseudo ] = $row[$fieldColumn] ?? NULL;
|
||||
}
|
||||
|
||||
/* Profile photo */
|
||||
@@ -670,7 +671,7 @@ class UBBthreads extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertMembersFollowers()
|
||||
public function convertMembersFollowers() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -692,7 +693,7 @@ class UBBthreads extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertPrivateMessages()
|
||||
public function convertPrivateMessages() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
$libraryClass::setKey( 'TOPIC_ID' );
|
||||
@@ -735,7 +736,7 @@ class UBBthreads extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertPrivateMessageReplies()
|
||||
public function convertPrivateMessageReplies() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -761,7 +762,7 @@ class UBBthreads extends Software
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function convertProfanityFilters()
|
||||
public function convertProfanityFilters() : void
|
||||
{
|
||||
$libraryClass = $this->getLibrary();
|
||||
|
||||
@@ -783,15 +784,15 @@ class UBBthreads extends Software
|
||||
) );
|
||||
}
|
||||
|
||||
throw new \IPS\convert\Software\Exception;
|
||||
throw new SoftwareException;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
@@ -829,7 +830,7 @@ class UBBthreads 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
|
||||
{
|
||||
$hash = $member->members_pass_hash;
|
||||
$salt = $member->members_pass_salt;
|
||||
|
||||
Reference in new issue
Block a user