Skip to content
Snippets Groups Projects
Commit dcd717dc authored by 20th 20th's avatar 20th 20th Committed by Tobias Stöckler
Browse files

Issue #2833756 by 20th: Check that public://library-definitions directory does not exist

parent a45aa141
No related branches found
No related tags found
No related merge requests found
Libraries 8.x-3.x, xxxx-xx-xx
-----------------------------
#2833756 by 20th: Check that public://library-definitions directory does not exist
#2825940 by tstoeckler, rjacobs: Remove LibrariesServiceProvider
#2816115 by rjacobs: Remove ExtensionHandler service
#2770983 by rjacobs: Update services.yml to reference new registry URL of http://cgit.drupalcode.org/libraries_registry/plain/registry/8
......
......@@ -11,16 +11,20 @@ use Drupal\libraries\ExternalLibrary\Definition\FileDefinitionDiscovery;
* Implements hook_install().
*/
function libraries_install() {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
$file_system->mkdir('public://library-definitions');
if (!is_dir('public://library-definitions')) {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
$file_system->mkdir('public://library-definitions');
}
}
/**
* Implements hook_uninstall().
*/
function libraries_uninstall() {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
$file_system->rmdir('public://library-definitions');
}
\ No newline at end of file
if (is_dir('public://library-definitions')) {
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
$file_system->rmdir('public://library-definitions');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment