Skip to content

Commit

Permalink
check tmp dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Nov 12, 2024
1 parent 1e5c728 commit cf67897
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/Controller/ArcheBaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,20 @@ public function __construct() {

private function checkTmpDirs(){
//translations
// Ensure the directory exists (you may need to create it)
\Drupal::service('file_system')->prepareDirectory('public://translations', \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY);
$translationsDirectory = 'public://translations';
file_prepare_directory($translationsDirectory, \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY);

//tmp_files
// Define a path for the temporary files subdirectory
// Ensure the directory exists (you may need to create it)
\Drupal::service('file_system')->prepareDirectory('public://tmp_files', \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY);
$tempDirectory = 'public://tmp_files';
file_prepare_directory($tempDirectory, \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY);


//config - sites/default/files/config_tlpXNA-ReYSeqYjmFBBCPxdygkZ95C_n73LVRKAXtzVywwEXIa2HSiI8OMNjzjxZcXYpMKd3ug/sync
\Drupal::service('file_system')->prepareDirectory('public://config_tlpXNA-ReYSeqYjmFBBCPxdygkZ95C_n73LVRKAXtzVywwEXIa2HSiI8OMNjzjxZcXYpMKd3ug', \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY);
\Drupal::service('file_system')->prepareDirectory('public://config_tlpXNA-ReYSeqYjmFBBCPxdygkZ95C_n73LVRKAXtzVywwEXIa2HSiI8OMNjzjxZcXYpMKd3ug/sync', \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY);
$confDir = 'public://config_tlpXNA-ReYSeqYjmFBBCPxdygkZ95C_n73LVRKAXtzVywwEXIa2HSiI8OMNjzjxZcXYpMKd3ug';
file_prepare_directory($confDir, \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY);
$confSyncDir = 'public://config_tlpXNA-ReYSeqYjmFBBCPxdygkZ95C_n73LVRKAXtzVywwEXIa2HSiI8OMNjzjxZcXYpMKd3ug/sync';
file_prepare_directory($confDir, \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY);

}

/**
Expand Down

0 comments on commit cf67897

Please sign in to comment.