Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

@@ -12,16 +12,26 @@
namespace IPS\convert\Software\Cms;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use InvalidArgumentException;
use IPS\convert\App;
use IPS\convert\Software;
use IPS\convert\Software\Exception;
use IPS\Db;
use IPS\Task;
use OutOfRangeException;
use function defined;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Xenforo (resource manager) Pages Converter
*/
class _Xenfororm extends \IPS\convert\Software
class Xenfororm extends Software
{
/**
* @brief The similarities between XF1 and XF2 are close enough that we can use the same converter
@@ -47,12 +57,12 @@ class _Xenfororm extends \IPS\convert\Software
/**
* Constructor
*
* @param \IPS\convert\App $app The application to reference for database and other information.
* @param App $app The application to reference for database and other information.
* @param bool $needDB Establish a DB connection
* @return void
* @throws \InvalidArgumentException
* @throws InvalidArgumentException
*/
public function __construct( \IPS\convert\App $app, $needDB=TRUE )
public function __construct( App $app, $needDB=TRUE )
{
$return = parent::__construct( $app, $needDB );
@@ -63,7 +73,7 @@ class _Xenfororm extends \IPS\convert\Software
/* Is this XF1 or XF2 */
if ( static::$isLegacy === NULL )
{
$version = $this->db->select( 'MAX(version_id)', 'xf_template', array( \IPS\Db::i()->in( 'addon_id', array( 'XF', 'XenForo' ) ) ) )->first();
$version = $this->db->select( 'MAX(version_id)', 'xf_template', array( Db::i()->in( 'addon_id', array( 'XF', 'XenForo' ) ) ) )->first();
if ( $version < 2000010 )
{
@@ -217,7 +227,7 @@ class _Xenfororm extends \IPS\convert\Software
) );
/* Throw an exception here to tell the library that we're done with this step */
throw new \IPS\convert\Software\Exception;
throw new Exception;
}
/**
@@ -316,12 +326,12 @@ class _Xenfororm extends \IPS\convert\Software
try
{
$database = $this->app->getLink( 1, 'cms_databases' );
\IPS\Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\cms\Categories' . $database, 'count' => 0 ), 5, array( 'class' ) );
\IPS\Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'link' => 'cms_custom_database_' . $database, 'class' => 'IPS\cms\Records' . $database ), 2, array( 'app', 'link', 'class' ) );
Task::queue( 'core', 'RebuildContainerCounts', array( 'class' => 'IPS\cms\Categories' . $database, 'count' => 0 ), 5, array( 'class' ) );
Task::queue( 'convert', 'RebuildContent', array( 'app' => $this->app->app_id, 'link' => 'cms_custom_database_' . $database, 'class' => 'IPS\cms\Records' . $database ), 2, array( 'app', 'link', 'class' ) );
return array( "f_recount_cms_categories", "f_rebuild_cms_tags" );
}
catch( \OutOfRangeException $e )
catch( OutOfRangeException $e )
{
return array();
}