Version 4.7.13

This commit is contained in:
Neo committed 2025-12-19 16:14:56 -08:00
1 parent fd22d99e69
commit 7124a02564
954 files changed
+29277 -59308

No files matched your search

+69 -75
View File
@@ -786,7 +786,6 @@ EOF;
$classes = array();
$jsonFile = $this->getApplicationPath() . "/data/extensions.json";
$directory = $this->getApplicationPath() . "/extensions/{$app}/{$extension}";
/* New extensions.json based approach */
if ( file_exists( $jsonFile ) and $json = @json_decode( \file_get_contents( $jsonFile ), TRUE ) )
@@ -814,56 +813,6 @@ EOF;
}
}
}
/* Legacy DirectoryIterator approach */
elseif ( is_dir( $directory ) )
{
$dir = new \DirectoryIterator( $directory );
foreach ( $dir as $file )
{
/* Macs create copies of files with "._" prefix which breaks when we just load up all files in a dir, ignore those */
if ( !$file->isDir() and !$file->isDot() and mb_substr( $file, -4 ) === '.php' AND mb_substr( $file, 0, 2 ) != '._' )
{
$classname = 'IPS\\' . $this->directory . '\extensions\\' . $app . '\\' . $extension . '\\' . mb_substr( $file, 0, -4 );
/* Check if class exists - sometimes we have to use blank files to wipe out old extensions */
try
{
if( !class_exists( $classname ) )
{
continue;
}
if ( method_exists( $classname, 'deprecated' ) )
{
continue;
}
}
catch( \ErrorException $e )
{
continue;
}
if ( method_exists( $classname, 'generate' ) )
{
$classes = array_merge( $classes, $classname::generate() );
}
elseif ( !$construct )
{
$classes[ mb_substr( $file, 0, -4 ) ] = $classname;
}
else
{
try
{
$classes[ mb_substr( $file, 0, -4 ) ] = new $classname( $checkAccess === TRUE ? \IPS\Member::loggedIn() : ( $checkAccess === FALSE ? NULL : $checkAccess ) );
}
catch( \RuntimeException $e ){}
}
}
}
}
return $classes;
}
@@ -1018,7 +967,7 @@ EOF;
);
/* Upgrade */
if( !$this->protected AND !\IPS\DEMO_MODE AND $this->marketplace_id === NULL AND \IPS\IPS::canManageResources() AND \IPS\IPS::checkThirdParty() )
if( !$this->protected AND !\IPS\DEMO_MODE AND \IPS\IPS::canManageResources() )
{
$buttons['upgrade'] = array(
'icon' => 'upload',
@@ -1054,28 +1003,25 @@ EOF;
$buttons['edit'] = $edit;
}
if( !$this->marketplace_id )
{
$buttons['compilejs'] = array(
'icon' => 'cog',
'title' => 'app_compile_js',
'link' => \IPS\Http\Url::internal( "app=core&module=applications&controller=applications&appKey={$this->_id}&do=compilejs" )->csrf()
);
$buttons['compilejs'] = array(
'icon' => 'cog',
'title' => 'app_compile_js',
'link' => \IPS\Http\Url::internal( "app=core&module=applications&controller=applications&appKey={$this->_id}&do=compilejs" )->csrf()
);
$buttons['build'] = array(
'icon' => 'cog',
'title' => 'app_build',
'link' => \IPS\Http\Url::internal("app=core&module=applications&controller=applications&appKey={$this->_id}&do=build"),
'data' => array('ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('app_build'))
);
$buttons['build'] = array(
'icon' => 'cog',
'title' => 'app_build',
'link' => \IPS\Http\Url::internal("app=core&module=applications&controller=applications&appKey={$this->_id}&do=build"),
'data' => array('ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('app_build'))
);
$buttons['export'] = array(
'icon' => 'download',
'title' => 'download',
'link' => \IPS\Http\Url::internal("app=core&module=applications&controller=applications&appKey={$this->_id}&do=download"),
'data' => array('ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('download'), 'ipsDialog-remoteVerify' => 'false')
);
}
$buttons['export'] = array(
'icon' => 'download',
'title' => 'download',
'link' => \IPS\Http\Url::internal("app=core&module=applications&controller=applications&appKey={$this->_id}&do=download"),
'data' => array('ipsDialog' => '', 'ipsDialog-title' => \IPS\Member::loggedIn()->language()->addToStack('download'), 'ipsDialog-remoteVerify' => 'false')
);
$buttons['developer'] = array(
'icon' => 'cogs',
@@ -2787,7 +2733,11 @@ EOF;
{
$db = \IPS\Db::i();
$changesToMake = array();
/* If member IDs are getting near the legacy mediumint limit, we need to increase it. */
$maxMemberId = \IPS\Db::i()->select( 'max(member_id)', 'core_members' )->first();
$enableBigInt = ( $maxMemberId > 8288607 );
/* Loop the tables in the schema */
foreach( json_decode( file_get_contents( $this->getApplicationPath() . "/data/schema.json" ), TRUE ) as $tableName => $tableDefinition )
{
@@ -2861,7 +2811,7 @@ EOF;
$differences[ $k ] = array( 'is' => $localDefinition['columns'][ $columnName ][ $k ], 'shouldBe' => $v );
}
}
if ( isset( $differences['type'] ) and ( $differences['type']['is'] == 'MEDIUMINT' or $differences['type']['is'] == 'INT' ) and $differences['type']['shouldBe'] == 'BIGINT' )
if ( isset( $differences['type'] ) and ( $differences['type']['is'] == 'MEDIUMINT' or $differences['type']['is'] == 'INT' ) and $differences['type']['shouldBe'] == 'BIGINT' AND !$enableBigInt )
{
unset( $differences['type'] );
if ( isset( $differences['length'] ) )
@@ -3865,7 +3815,13 @@ EOF;
/* End */
$xml->endElement();
/* Enforce \n line endings */
if( mb_strtolower( mb_substr( PHP_OS, 0, 3 ) ) === 'win' )
{
$v = str_replace( "\r\n", "\n", $v );
}
/* Note it */
if ( !isset( $current['0'][ $k ] ) )
{
@@ -3912,6 +3868,12 @@ EOF;
/* End */
$xml->endElement();
/* Enforce \n line endings */
if( mb_strtolower( mb_substr( PHP_OS, 0, 3 ) ) === 'win' )
{
$v = str_replace( "\r\n", "\n", $v );
}
/* Note it */
if ( !isset( $current['1'][ $k ] ) )
@@ -4776,6 +4738,7 @@ EOF;
\IPS\Db::i()->delete( 'core_queue', array( 'app=?', $this->directory ) );
\IPS\Db::i()->delete( 'core_follow', array( 'follow_app=?', $this->directory ) );
\IPS\Db::i()->delete( 'core_follow_count_cache', array( "class LIKE CONCAT( ?, '%' )", "IPS\\\\{$this->directory}" ) );
\IPS\Db::i()->delete( 'core_item_statistics_cache', array( "cache_class LIKE CONCAT( ?, '%' )", "IPS\\\\{$this->directory}" ) );
\IPS\Db::i()->delete( 'core_view_updates', array( "classname LIKE CONCAT( ?, '%' )", "IPS\\\\{$this->directory}" ) );
\IPS\Db::i()->delete( 'core_moderator_logs', array( 'appcomponent=?', $this->directory ) );
\IPS\Db::i()->delete( 'core_member_history', array( 'log_app=?', $this->directory ) );
@@ -5448,4 +5411,35 @@ EOF;
{
return NULL;
}
/**
* Returns a list of all essential cookies which are set by all the installed apps
* To return a list of own cookies, use the @see \IPS\Application::_getEssentialCookieNames() method.
*
* @return string[]
*/
public final static function getEssentialCookieNames(): array
{
if ( !isset( \IPS\Data\Store::i()->essentialCookieNames ) )
{
$names = [];
foreach( static::applications() as $app )
{
$names = array_merge( $names, $app->_getEssentialCookieNames() );
}
\IPS\Data\Store::i()->essentialCookieNames = $names;
}
return \IPS\Data\Store::i()->essentialCookieNames;
}
/**
* Returns a list of essential cookies which are set by this app.
* Wildcards (*) can be used at the end of cookie names for PHP set cookies.
*
* @return string[]
*/
public function _getEssentialCookieNames(): array
{
return [];
}
}