summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/scan.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/ajax/scan.php')
-rw-r--r--apps/files/ajax/scan.php27
1 files changed, 14 insertions, 13 deletions
diff --git a/apps/files/ajax/scan.php b/apps/files/ajax/scan.php
index eef38858516..e38484b97dd 100644
--- a/apps/files/ajax/scan.php
+++ b/apps/files/ajax/scan.php
@@ -6,38 +6,39 @@ $force=isset($_GET['force']) and $_GET['force']=='true';
$dir=isset($_GET['dir'])?$_GET['dir']:'';
$checkOnly=isset($_GET['checkonly']) and $_GET['checkonly']=='true';
-if(!$checkOnly){
+if(!$checkOnly) {
$eventSource=new OC_EventSource();
}
session_write_close();
//create the file cache if necesary
-if($force or !OC_FileCache::inCache('')){
- if(!$checkOnly){
+if($force or !OC_FileCache::inCache('')) {
+ if(!$checkOnly) {
OCP\DB::beginTransaction();
- if(OC_Cache::isFast()){
- OC_Cache::clear('fileid/'); //make sure the old fileid's don't mess things up
+ if(OC_Cache::isFast()) {
+ //make sure the old fileid's don't mess things up
+ OC_Cache::clear('fileid/');
}
- OC_FileCache::scan($dir,$eventSource);
+ OC_FileCache::scan($dir, $eventSource);
OC_FileCache::clean();
OCP\DB::commit();
- $eventSource->send('success',true);
- }else{
+ $eventSource->send('success', true);
+ } else {
OCP\JSON::success(array('data'=>array('done'=>true)));
exit;
}
-}else{
- if($checkOnly){
+} else {
+ if($checkOnly) {
OCP\JSON::success(array('data'=>array('done'=>false)));
exit;
}
- if(isset($eventSource)){
+ if(isset($eventSource)) {
$eventSource->send('success',false);
- }else{
+ } else {
exit;
}
}
-$eventSource->close(); \ No newline at end of file
+$eventSource->close();