Problem/Motivation

Running drupal-check advagg reports:

74/74 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ---------------------------------------------------------------- 
  Line   advagg.drush.inc                                                
 ------ ---------------------------------------------------------------- 
  140    Call to deprecated function file_unmanaged_delete_recursive():  
         in drupal:8.7.0 and is removed from drupal:9.0.0.               
         Use \Drupal\Core\File\FileSystemInterface::deleteRecursive().   
 ------ ---------------------------------------------------------------- 

 ------ ------------------------------------------------------ 
  Line   advagg.module                                         
 ------ ------------------------------------------------------ 
  74     Call to deprecated function file_unmanaged_delete():  
         in drupal:8.7.0 and is removed from drupal:9.0.0.     
         Use \Drupal\Core\File\FileSystemInterface::delete().  
  75     Call to deprecated function file_unmanaged_delete():  
         in drupal:8.7.0 and is removed from drupal:9.0.0.     
         Use \Drupal\Core\File\FileSystemInterface::delete().  
 ------ ------------------------------------------------------ 

 ------ ---------------------------------------------------------------------------------------------------------- 
  Line   advagg_css_minify/yui/CSSMin.inc                                                                          
 ------ ---------------------------------------------------------------------------------------------------------- 
         Class CSSmin was not found while trying to analyse it - autoloading is probably not configured properly.  
 ------ ---------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------------------
  Line   advagg_js_minify/jshrink.inc                                                                                        
 ------ --------------------------------------------------------------------------------------------------------------
         Class JShrink\Minifier was not found while trying to analyse it - autoloading is probably not configured properly.  
 ------ --------------------------------------------------------------------------------------------------------------

 ------ ------------------------------------------------------------------------------------------------------------- 
  Line   advagg_js_minify/jsminplus.inc                                                                               
 ------ ------------------------------------------------------------------------------------------------------------- 
         Class JSMinPlus was not found while trying to analyse it - autoloading is probably not configured properly.  
 ------ ------------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------------------------------------------------------------
  Line   advagg_js_minify/jspacker.inc                                                                                       
 ------ -------------------------------------------------------------------------------------------------------------------- 
         Class JavaScriptPacker was not found while trying to analyse it - autoloading is probably not configured properly.  
 ------ --------------------------------------------------------------------------------------------------------------
 ------ -------------------------------------------------------------------------------------------------------------
  Line   advagg_js_minify/jsqueeze.inc                                                                                         
 ------ --------------------------------------------------------------------------------------------------------------
         Class Patchwork\JSqueeze was not found while trying to analyse it - autoloading is probably not configured properly.  
 ------ ---------------------------------------------------------------------------------------------------------------------- 

 ------ --------------------------------------------------------- 
  Line   advagg_mod/src/EventSubscriber/InitSubscriber.php        
 ------ --------------------------------------------------------- 
  127    Call to deprecated function file_unmanaged_save_data():  
         in drupal:8.7.0 and is removed from drupal:9.0.0.        
         Use \Drupal\Core\File\FileSystemInterface::saveData().   
  138    Call to deprecated function file_unmanaged_save_data():  
         in drupal:8.7.0 and is removed from drupal:9.0.0.        
         Use \Drupal\Core\File\FileSystemInterface::saveData().   
 ------ --------------------------------------------------------- 

 ------ -------------------------------------------------------------------------- 
  Line   advagg_validator/src/Form/BaseValidatorForm.php                           
 ------ -------------------------------------------------------------------------- 
  289    Call to deprecated function file_stream_wrapper_uri_normalize():          
         in drupal:8.8.0 and is removed from drupal:9.0.0. Use                     
         \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::normalizeUri()  
         instead.                                                                  
 ------ -------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------- 
  Line   src/Asset/AssetOptimizer.php                                    
 ------ ---------------------------------------------------------------- 
  265    Call to deprecated function file_prepare_directory():           
         in drupal:8.7.0 and is removed from drupal:9.0.0.               
         Use \Drupal\Core\File\FileSystemInterface::prepareDirectory().  
  267    Call to deprecated function file_unmanaged_save_data():         
         in drupal:8.7.0 and is removed from drupal:9.0.0.               
         Use \Drupal\Core\File\FileSystemInterface::saveData().          
  276    Call to deprecated function file_unmanaged_save_data():         
         in drupal:8.7.0 and is removed from drupal:9.0.0.               
         Use \Drupal\Core\File\FileSystemInterface::saveData().          
  282    Call to deprecated function file_unmanaged_save_data():         
         in drupal:8.7.0 and is removed from drupal:9.0.0.               
         Use \Drupal\Core\File\FileSystemInterface::saveData().          
  468    Call to deprecated function file_prepare_directory():           
         in drupal:8.7.0 and is removed from drupal:9.0.0.               
         Use \Drupal\Core\File\FileSystemInterface::prepareDirectory().  
  547    Call to deprecated function file_unmanaged_save_data():         
         in drupal:8.7.0 and is removed from drupal:9.0.0.               
         Use \Drupal\Core\File\FileSystemInterface::saveData().          
 ------ ---------------------------------------------------------------- 

 ------ ---------------------------------------------------------------- 
  Line   src/Commands/AdvaggCommands.php                                 
 ------ ---------------------------------------------------------------- 
  119    Call to deprecated function file_unmanaged_delete_recursive():  
         in drupal:8.7.0 and is removed from drupal:9.0.0.               
         Use \Drupal\Core\File\FileSystemInterface::deleteRecursive().   
 ------ ---------------------------------------------------------------- 

 ------ ---------------------------------------------------------------- 
  Line   src/Form/OperationsForm.php                                     
 ------ ---------------------------------------------------------------- 
  264    Call to deprecated function file_unmanaged_delete_recursive():  
         in drupal:8.7.0 and is removed from drupal:9.0.0.               
         Use \Drupal\Core\File\FileSystemInterface::deleteRecursive().   
 ------ ---------------------------------------------------------------- 
                                                                                     
 [ERROR] Found 19 errors

Thank's

Comments

gmangones created an issue. See original summary.

gmangones’s picture

Status: Needs work » Needs review
StatusFileSize
new6.81 KB

Hi, patch added for review.
After apply patch report the next:

drupal-check advagg
 74/74 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ---------------------------------------------------------------------------------------------------------- 
  Line   advagg_css_minify/yui/CSSMin.inc                                                                          
 ------ ---------------------------------------------------------------------------------------------------------- 
         Class CSSmin was not found while trying to analyse it - autoloading is probably not configured properly.  
 ------ ---------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------------------------------- 
  Line   advagg_js_minify/jshrink.inc                                                                              
 ------ ---------------------------------------------------------------------------------------------------------- 
         Class JShrink\Minifier was not found while trying to analyse it - autoloading is probably not configured  
         properly.                                                                                                 
 ------ ---------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------- 
  Line   advagg_js_minify/jsminplus.inc                                                                               
 ------ ------------------------------------------------------------------------------------------------------------- 
         Class JSMinPlus was not found while trying to analyse it - autoloading is probably not configured properly.  
 ------ ------------------------------------------------------------------------------------------------------------- 

 ------ ---------------------------------------------------------------------------------------------------------- 
  Line   advagg_js_minify/jspacker.inc                                                                             
 ------ ---------------------------------------------------------------------------------------------------------- 
         Class JavaScriptPacker was not found while trying to analyse it - autoloading is probably not configured  
         properly.                                                                                                 
 ------ ---------------------------------------------------------------------------------------------------------- 

 ------ ------------------------------------------------------------------------------------------------------------ 
  Line   advagg_js_minify/jsqueeze.inc                                                                               
 ------ ------------------------------------------------------------------------------------------------------------ 
         Class Patchwork\JSqueeze was not found while trying to analyse it - autoloading is probably not configured  
         properly.                                                                                                   
 ------ ------------------------------------------------------------------------------------------------------------ 

                                                                                                                        
 [ERROR] Found 5 errors

Thank's

pifagor’s picture

Look good

kim.pepper’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
  1. +++ b/advagg_mod/src/EventSubscriber/InitSubscriber.php
    @@ -124,7 +124,7 @@ class InitSubscriber implements EventSubscriberInterface {
    +      $this->fileSystem->saveData($local_counter, $counter_filename, FILE_EXISTS_REPLACE);
    
    @@ -135,7 +135,7 @@ class InitSubscriber implements EventSubscriberInterface {
    +        $this->fileSystem->saveData($local_counter, $counter_filename, FILE_EXISTS_REPLACE);
    
    +++ b/src/Asset/AssetOptimizer.php
    @@ -262,9 +263,9 @@ abstract class AssetOptimizer {
    +      if (!\Drupal::service('file_system')->saveData($data, $uri, FILE_EXISTS_REPLACE)) {
    
    @@ -273,13 +274,13 @@ abstract class AssetOptimizer {
    +      \Drupal::service('file_system')->saveData(gzencode($data, 9, FORCE_GZIP), $uri . '.gz', FILE_EXISTS_REPLACE);
    ...
    +      \Drupal::service('file_system')->saveData(brotli_compress($data, 11, BROTLI_TEXT), $uri . '.br', FILE_EXISTS_REPLACE);
    
    @@ -544,7 +545,7 @@ abstract class AssetOptimizer {
    +    \Drupal::service('file_system')->saveData($htaccess, $file, FILE_EXISTS_REPLACE);
    

    FILE_EXISTS_REPLACE is deprecated. Use
    \Drupal\Core\File\FileSystemInterface::EXISTS_REPLACE instead.

  2. +++ b/src/Asset/AssetOptimizer.php
    @@ -262,9 +263,9 @@ abstract class AssetOptimizer {
    +    \Drupal::service('file_system')->prepareDirectory($path, FILE_CREATE_DIRECTORY);
    
    @@ -465,7 +466,7 @@ abstract class AssetOptimizer {
    +    \Drupal::service('file_system')->prepareDirectory($path, FILE_CREATE_DIRECTORY);
    

    FILE_CREATE_DIRECTORY is deprecated in 8.7.0. Use \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY instead.

gmangones’s picture

Status: Needs work » Needs review
StatusFileSize
new7.09 KB
new3.52 KB

Hi.here are the new patch.

Thank's

kim.pepper’s picture

Status: Needs review » Needs work
+++ b/advagg.module
@@ -8,6 +8,7 @@
+use Drupal\Core\File\FileSystemInterface;

+++ b/advagg_mod/src/EventSubscriber/InitSubscriber.php
@@ -124,7 +125,7 @@ class InitSubscriber implements EventSubscriberInterface {
+      $this->fileSystem->saveData($local_counter, $counter_filename, EXISTS_REPLACE);

These are constants on the interface, not globals. You need to do FileSystemInterface::EXISTS_REPLACE

Also, the patch is failing to apply, so you need to see what the conflicts are and resolve them.

sahana _n’s picture

Status: Needs work » Needs review
StatusFileSize
new3.05 KB

Please review the patch.

thalles’s picture

This issue has been resolved in other issues, but I appreciate your work

thalles’s picture

Status: Needs review » Fixed
sahana _n’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.