Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -13,8 +13,10 @@ namespace IPS\convert;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
|
||||
use BadMethodCallException;
|
||||
use ErrorException;
|
||||
use Exception;
|
||||
use IPS\Application;
|
||||
use IPS\convert\Software\Exception as SoftwareException;
|
||||
use IPS\Db;
|
||||
use IPS\Db\Select;
|
||||
@@ -99,6 +101,22 @@ abstract class Library
|
||||
{
|
||||
$this->software = $software;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Application Key
|
||||
*
|
||||
* @return string
|
||||
* @throws BadMethodCallException
|
||||
*/
|
||||
public function getAppKey(): string
|
||||
{
|
||||
if( !isset( static::$app ) )
|
||||
{
|
||||
throw new BadMethodCallException;
|
||||
}
|
||||
|
||||
return static::$app;
|
||||
}
|
||||
|
||||
/**
|
||||
* Libraries
|
||||
@@ -107,7 +125,7 @@ abstract class Library
|
||||
*/
|
||||
public static function libraries() : array
|
||||
{
|
||||
return array(
|
||||
$libraries = [
|
||||
'core' => 'IPS\convert\Library\Core',
|
||||
'blog' => 'IPS\convert\Library\Blog',
|
||||
'calendar' => 'IPS\convert\Library\Calendar',
|
||||
@@ -116,7 +134,22 @@ abstract class Library
|
||||
'forums' => 'IPS\convert\Library\Forums',
|
||||
'gallery' => 'IPS\convert\Library\Gallery',
|
||||
'nexus' => 'IPS\convert\Library\Nexus',
|
||||
);
|
||||
];
|
||||
|
||||
/* Library Extensions */
|
||||
foreach ( Application::allExtensions( 'convert', 'Library', FALSE, construct: false ) as $extension )
|
||||
{
|
||||
try
|
||||
{
|
||||
if( !empty( $extension::$app ) AND !isset( $libraries[ $extension::$app ] ) )
|
||||
{
|
||||
$libraries[ $extension::$app ] = $extension;
|
||||
}
|
||||
}
|
||||
catch( BadMethodCallException ) {}
|
||||
}
|
||||
|
||||
return $libraries;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,7 +184,7 @@ abstract class Library
|
||||
* @param int|NULL $perCycle The number of results to process per cycle
|
||||
* @return array|NULL Data for the MultipleRedirect
|
||||
*/
|
||||
public function process( int $data, string $method, ?int $perCycle=NULL ) : ?array
|
||||
public function process( ?int $data, string $method, ?int $perCycle=NULL ) : ?array
|
||||
{
|
||||
if ( !is_null( $perCycle ) )
|
||||
{
|
||||
@@ -169,7 +202,7 @@ abstract class Library
|
||||
}
|
||||
|
||||
static::$action = $canConvert[ $method ]['table'];
|
||||
static::$startValue = $data;
|
||||
static::$startValue = (int) $data;
|
||||
$masterAppId = $this->software->app->getMasterConversionId();
|
||||
|
||||
if ( !isset( $_SESSION['convertCountRows'] ) )
|
||||
@@ -329,7 +362,6 @@ abstract class Library
|
||||
|
||||
/* Clear the running flag */
|
||||
$this->software->app->setRunningFlag( $method, FALSE );
|
||||
|
||||
$this->software->app->log( $e->getMessage(), __METHOD__, App::LOG_WARNING );
|
||||
throw new Exception;
|
||||
}
|
||||
@@ -497,7 +529,6 @@ abstract class Library
|
||||
catch( Exception $e )
|
||||
{
|
||||
Log::log( $e, 'converters' );
|
||||
|
||||
$this->software->app->log( $e->getMessage(), __METHOD__, App::LOG_WARNING );
|
||||
throw new Exception;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user