update.php 698 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. //update from OC 3
  3. //try to remove remaining files.
  4. //Give a warning if not possible
  5. $filesToRemove = array(
  6. 'ajax',
  7. 'appinfo',
  8. 'css',
  9. 'js',
  10. 'l10n',
  11. 'templates',
  12. 'admin.php',
  13. 'download.php',
  14. 'index.php',
  15. 'settings.php'
  16. );
  17. foreach($filesToRemove as $file) {
  18. $filepath = OC::$SERVERROOT . '/files/' . $file;
  19. if(!file_exists($filepath)) {
  20. continue;
  21. }
  22. $success = OCP\Files::rmdirr($filepath);
  23. if($success === false) {
  24. //probably not sufficient privileges, give up and give a message.
  25. OCP\Util::writeLog('files','Could not clean /files/ directory. Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR);
  26. break;
  27. }
  28. }