I'm trying to get File Permissions working in Drupal 8.9 with Drush 9. The old code calls _drush_file_private_path()
, which doesn't exist anymore, and _drush_file_public_path()
is probably a no-go as well.
What is the proper way to do the following in Drush 9?
define('DS', DIRECTORY_SEPARATOR);
// Define default paths and variables.
$default = 'sites' . DS . 'default';
$private = $default . DS . 'private';
$files = $default . DS . 'files';
$directories = array();
// Check for Private Files subdirectory.
$private_directory = _drush_file_private_path();
if (empty($private_directory)) {
$private_directory = $private;
}
$directories[] = $private_directory;
// Check for Public Files subdirectory.
$public_directory = _drush_file_public_path();
if (empty($public_directory)) {
$public_directory = $files;
}
$directories[] = $public_directory;
As an additional note, it would be amazing if a resource existed to see all deprecated/removed functions and their equivalent replacements. I can't even get decent results when using a search engine and the function name.
\Drupal\Core\StreamWrapper\PrivateStream::basePath()
and\Drupal\Core\StreamWrapper\PublicStream::basePath()
already? – leymannx Sep 7 '20 at 19:56g
as keyword in the address bar for Google Search and then only have to typeg
and then press tab and can enter the search query I want to feed to Google. – leymannx Sep 7 '20 at 20:29