Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -12,7 +12,7 @@
|
||||
namespace IPS\blog\extensions\core\Queue;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -26,7 +26,7 @@ class _RebuildEntryImages
|
||||
/**
|
||||
* @brief Number of entry images to rebuild per cycle
|
||||
*/
|
||||
public $rebuild = 10;
|
||||
public $rebuild = \IPS\REBUILD_SLOW;
|
||||
|
||||
/**
|
||||
* Parse data before queuing
|
||||
@@ -56,12 +56,8 @@ class _RebuildEntryImages
|
||||
*/
|
||||
public function run( $data, $offset )
|
||||
{
|
||||
$select = \IPS\Db::i()->select( '*', 'blog_entries', "entry_image<>''", 'entry_id ASC', array( $offset, $this->rebuild ) );
|
||||
|
||||
if ( !$select->count() )
|
||||
{
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
$select = \IPS\Db::i()->select( '*', 'blog_entries', array( "entry_image<>? AND entry_id > ?", '', $offset ), 'entry_id ASC', array( 0, $this->rebuild ) );
|
||||
$last = NULL;
|
||||
|
||||
foreach ( $select as $entry )
|
||||
{
|
||||
@@ -102,9 +98,16 @@ IMAGE;
|
||||
\IPS\Db::i()->replace( 'core_attachments_map', $map );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
|
||||
$last = $entry['entry_id'];
|
||||
}
|
||||
|
||||
return $offset + $this->rebuild;
|
||||
if( $last === NULL )
|
||||
{
|
||||
throw new \IPS\Task\Queue\OutOfRangeException;
|
||||
}
|
||||
|
||||
return $last;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user