module/Core/src/Grid/Core/Model/Package/Model.php
protected static function savePackageData( $data )
    {
        if ( ! is_file( static::PACKAGE_FILE ) )
        {
            return false;
        }

        if ( is_file( static::PACKAGE_FILE_BACKUP ) )
        {
            @ unlink( static::PACKAGE_FILE_BACKUP );
        }

        @ copy( static::PACKAGE_FILE, static::PACKAGE_FILE_BACKUP );

        $result = static::saveJsonData( static::PACKAGE_FILE, $data );

        if ( $result )
        {
            static::$packageData = $data;
        }
        else if ( is_file( static::PACKAGE_FILE_BACKUP ) )
        {
            @ unlink( static::PACKAGE_FILE );
            @ copy( static::PACKAGE_FILE_BACKUP, static::PACKAGE_FILE );
        }

        return $result;
    }
protected static function savePackageData( $data )
    {
        if ( ! is_file( static::PACKAGE_FILE ) )
        {
            return false;
        }

        if ( is_file( static::PACKAGE_FILE_BACKUP ) )
        {
            @ unlink( static::PACKAGE_FILE_BACKUP );
        }

        @ copy( static::PACKAGE_FILE, static::PACKAGE_FILE_BACKUP );

        $result = static::saveJsonData( static::PACKAGE_FILE, $data );

        if ( $result )
        {
            static::$packageData = $data;
        }
        else if ( is_file( static::PACKAGE_FILE_BACKUP ) )
        {
            @ unlink( static::PACKAGE_FILE );
            @ copy( static::PACKAGE_FILE_BACKUP, static::PACKAGE_FILE );
        }

        return $result;
    }
protected static function savePackageData ( $ data ) { if ( ! is_file ( static :: PACKAGE_FILE ) ) { return false ; } if ( is_file ( static :: PACKAGE_FILE_BACKUP ) ) { @ unlink ( static :: PACKAGE_FILE_BACKUP ) ; } @ copy ( static :: PACKAGE_FILE , static :: PACKAGE_FILE_BACKUP ) ; $ result = static :: saveJsonData ( static :: PACKAGE_FILE , $ data ) ; if ( $ result ) { static :: $ packageData = $ data ; } else if ( is_file ( static :: PACKAGE_FILE_BACKUP ) ) { @ unlink ( static :: PACKAGE_FILE ) ; @ copy ( static :: PACKAGE_FILE_BACKUP , static :: PACKAGE_FILE ) ; } return $ result ; }
Save package data

@param   mixed   $data
@return  bool|int
Save package data