aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/scan.php
blob: d2ec1ab5161c9f51f525c78aedf66216af815a7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php

set_time_limit(0);//scanning can take ages

$force=isset($_GET['force']) and $_GET['force']=='true';
$dir=isset($_GET['dir'])?$_GET['dir']:'';
$checkOnly=isset($_GET['checkonly']) and $_GET['checkonly']=='true';

if(!$checkOnly) {
	$eventSource=new OC_EventSource();
}

session_write_close();

//create the file cache if necesary
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
		}

		OC_FileCache::scan($dir,$eventSource);
		OC_FileCache::clean();
		OCP\DB::commit();
		$eventSource->send('success', true);
	} else {
		OCP\JSON::success(array('data'=>array('done'=>true)));
		exit;
	}
} else {
	if($checkOnly) {
		OCP\JSON::success(array('data'=>array('done'=>false)));
		exit;
	}
	if(isset($eventSource)) {
		$eventSource->send('success', false);
	} else {
		exit;
	}
}
$eventSource->close();
lass='column4'>| | | | | | | | add method to create a node from cache entry + mountpointRobin Appelman2023-09-194-1/+46 * | | | | | | | | | | | | Merge pull request #40873 from nextcloud/fix/36965-fix-search-contactsJulia Kirschenheuter2023-10-183-4/+3 |\ \ \ \ \ \ \ \ \ \ \ \ \ | * | | | | | | | | | | | | Fix width of input on contacts menujulia.kirschenheuter2023-10-183-4/+3 |/ / / / / / / / / / / / / * | | | | | | | | | | | | Merge pull request #40956 from nextcloud/deps/nextcloud/dialogs-5.0.0-beta.6John Molakvoæ2023-10-1885-119/+295 |\ \ \ \ \ \ \ \ \ \ \ \ \ | * | | | | | | | | | | | | chore: compile assetsChristopher Ng2023-10-1877-105/+196 | * | | | | | | | | | | | | chore: Remove unnecessary dialogs css importsChristopher Ng2023-10-186-6/+0 | * | | | | | | | | | | | | chore(deps): Bump @nextcloud/dialogs to v5-beta.6Christopher Ng2023-10-182-8/+99 |/ / / / / / / / / / / / / * | | | | | | | | | | | | Merge pull request #40926 from nextcloud/config-sample-theme-names-fixJohn Molakvoæ2023-10-181-1/+1 |\ \ \ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / / / |/| | | | | | | | | | | | | * | | | | | | | | | | | config.sample.php: fix incorrect theme name + add a missing oneJosh Richards2023-10-151-1/+1 * | | | | | | | | | | | | Merge pull request #40808 from c39cfbb3/patch-3Ferdinand Thiessen2023-10-181-0/+4 |\ \ \ \ \ \ \ \ \ \ \ \ \ | * | | | | | | | | | | | | Update lib/private/L10N/Factory.phpc39cfbb32023-10-181-1/+1 | * | | | | | | | | | | | | L10N/Factory: Support "Accept-Language: zh-Hans-CN" and alikec39cfbb32023-10-181-0/+4 * | | | | | | | | | | | | | Merge pull request #40912 from nextcloud/dependabot/npm_and_yarn/mdi/svg-7.3.67Ferdinand Thiessen2023-10-184-8/+8 |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | * | | | | | | | | | | | | | chore(deps): Bump @mdi/svg from 7.2.96 to 7.3.67dependabot[bot]2023-10-184-8/+8 | |/ / / / / / / / / / / / / * | | | | | | | | | | | | | Merge pull request #40941 from nextcloud/dependabot/npm_and_yarn/babel/traver...Ferdinand Thiessen2023-10-181-47/+48 |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | * | | | | | | | | | | | | | chore(deps): Bump @babel/traverse from 7.22.8 to 7.23.2dependabot[bot]2023-10-171-47/+48 * | | | | | | | | | | | | | | Merge pull request #39852 from nextcloud/pragmaHeaderFerdinand Thiessen2023-10-189-20/+5 |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | * | | | | | | | | | | | | | | Stop sending deprecated Pragma headerGit'Fellow2023-08-289-20/+5 * | | | | | | | | | | | | | | | Fix(l10n): Update translations from TransifexNextcloud bot2023-10-18256-1126/+1344 | |_|/ / / / / / / / / / / / / |/| | | | | | | | | | | | | | * | | | | | | | | | | | | | | Merge pull request #40950 from nextcloud/fix/add-aria-pressed-to-buttonsFerdinand Thiessen2023-10-189-26/+65 |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / / / / / / / |/| | | | | | | | | | | | | | | * | | | | | | | | | | | | | fix(theming): Add `aria-pressed` attribute to active backgroundFerdinand Thiessen2023-10-189-26/+65 |/ / / / / / / / / / / / / / * | | | | | | | | | | | | | Merge pull request #40905 from nextcloud/fix/36965-apadt-margin-for-files_lis...Pytal2023-10-177-10/+11 |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | * | | | | | | | | | | | | | Reduce left margin of files list headerjulia.kirschenheuter2023-10-177-10/+11 |/ / / / / / / / / / / / / / * | | | | | | | | | | | | | Merge pull request #40951 from nextcloud/fix/xhr-request-regressionJulius Härtl2023-10-17