Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

+18 -7
View File
@@ -252,12 +252,12 @@ class _FileSystem extends \IPS\File
if ( $this->contents === FALSE )
{
throw new \RuntimeException( 'COULD_NOT_OPEN_FILE' );
throw new \IPS\File\Exception( $this->container . '/' . $this->filename, \IPS\File\Exception::CANNOT_OPEN );
}
}
else
{
throw new \RuntimeException( 'FILE_DOES_NOT_EXIST' );
throw new \IPS\File\Exception( $this->container . '/' . $this->filename, \IPS\File\Exception::DOES_NOT_EXIST );
}
}
@@ -308,10 +308,21 @@ class _FileSystem extends \IPS\File
/* Save the file */
if( $this->temporaryFilePath )
{
if( !@\rename( $this->temporaryFilePath, "{$folder}/{$this->filename}" ) )
if( static::$copyFiles === TRUE )
{
\IPS\Log::log( "Could not move file {$folder}/{$this->filename}" , 'FileSystem' );
throw new \RuntimeException( 'COULD_NOT_MOVE_FILE' );
if( !@\copy( $this->temporaryFilePath, "{$folder}/{$this->filename}" ) )
{
\IPS\Log::log( "Could not copy file {$folder}/{$this->filename}" , 'FileSystem' );
throw new \IPS\File\Exception( "{$folder}/{$this->filename}", \IPS\File\Exception::CANNOT_COPY );
}
}
else
{
if( !@\rename( $this->temporaryFilePath, "{$folder}/{$this->filename}" ) )
{
\IPS\Log::log( "Could not move file {$folder}/{$this->filename}" , 'FileSystem' );
throw new \IPS\File\Exception( "{$folder}/{$this->filename}", \IPS\File\Exception::CANNOT_MOVE );
}
}
@chmod( "{$folder}/{$this->filename}", \IPS\IPS_FILE_PERMISSION );
@@ -323,7 +334,7 @@ class _FileSystem extends \IPS\File
if ( !@\file_put_contents( "{$folder}/{$this->filename}", $contents ) )
{
\IPS\Log::log( "Could not write file {$folder}/{$this->filename}" , 'FileSystem' );
throw new \RuntimeException( 'COULD_NOT_WRITE_FILE' );
throw new \IPS\File\Exception( "{$folder}/{$this->filename}", \IPS\File\Exception::CANNOT_WRITE );
}
@chmod( "{$folder}/{$this->filename}", \IPS\IPS_FILE_PERMISSION );
@@ -489,7 +500,7 @@ class _FileSystem extends \IPS\File
{
if( @mkdir( $folder, \IPS\IPS_FOLDER_PERMISSION, TRUE ) === FALSE or @chmod( $folder, \IPS\IPS_FOLDER_PERMISSION ) === FALSE )
{
throw new \RuntimeException( 'COULD_NOT_CREATE_FOLDER' );
throw new \IPS\File\Exception( $folder, \IPS\File\Exception::CANNOT_MAKE_DIR );
}
@\file_put_contents( $folder . '/index.html', '' );
}