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

+31 -24
View File
@@ -11,50 +11,57 @@
namespace IPS\Dispatcher;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use IPS\Application;
use IPS\Application\Module;
use IPS\Data\Store;
use IPS\Dispatcher;
use IPS\Request;
use IPS\Settings;
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;
}
/**
* @brief Build/Tools Dispatcher
*/
class _Build extends \IPS\Dispatcher
class Build extends Dispatcher
{
/**
* @brief Controller Location
*/
public $controllerLocation = 'front';
public string $controllerLocation = 'front';
/**
* @brief Application
*/
public $application = 'core';
public string $application = 'core';
/**
* @brief Module
*/
public $module = 'system';
public string $module = 'system';
/**
* @brief Step
*/
public $step = 1;
public int $step = 1;
/**
* Initiator
*
* @return void
*/
public function init()
public function init() : void
{
$modules = \IPS\Application\Module::modules();
$this->application = \IPS\Application::load('core');
$modules = Module::modules();
$this->application = Application::load('core');
$this->module = $modules['core']['front']['system'];
$this->controller = 'build';
return true;
}
/**
@@ -62,31 +69,31 @@ class _Build extends \IPS\Dispatcher
*
* @return void
*/
public function run()
public function run() : void
{
if ( isset( \IPS\Request::i()->force ) )
if ( isset( Request::i()->force ) )
{
if ( isset( \IPS\Data\Store::i()->builder_building ) )
if ( isset( Store::i()->builder_building ) )
{
unset( \IPS\Data\Store::i()->builder_building );
unset( Store::i()->builder_building );
}
}
else
{
if ( isset( \IPS\Data\Store::i()->builder_building ) and ! empty( \IPS\Data\Store::i()->builder_building ) )
if ( isset( Store::i()->builder_building ) and ! empty( Store::i()->builder_building ) )
{
/* We're currently rebuilding */
if ( time() - \IPS\Data\Store::i()->builder_building < 180 )
if ( time() - Store::i()->builder_building < 180 )
{
print "Builder is already running. To force a rebuild anyway, add &force=1 on the end of your URL";
exit();
}
}
\IPS\Data\Store::i()->builder_building = time();
Store::i()->builder_building = time();
}
\IPS\Settings::i()->changeValues( array( 'site_online' => 0 ) );
Settings::i()->changeValues( array( 'site_online' => 0 ) );
}
/**
@@ -94,13 +101,13 @@ class _Build extends \IPS\Dispatcher
*
* @return void
*/
public function buildDone()
public function buildDone() : void
{
if ( isset( \IPS\Data\Store::i()->builder_building ) )
if ( isset( Store::i()->builder_building ) )
{
unset( \IPS\Data\Store::i()->builder_building );
unset( Store::i()->builder_building );
}
\IPS\Settings::i()->changeValues( array( 'site_online' => 1 ) );
Settings::i()->changeValues( array( 'site_online' => 1 ) );
}
}