aboutsummaryrefslogtreecommitdiffstats
path: root/apps/testing/clean_opcode_cache.php
blob: d87388a05fd577015aca8c475f602c4d9b7b6320 (plain)
1
2
3
4
5
6
<?php
/**
 * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
opcache_reset();
00; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<?php

declare(strict_types=1);
/**
 * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
namespace OC\Files\Config;

use OCP\IUser;

class LazyPathCachedMountInfo extends CachedMountInfo {
	// we don't allow \ in paths so it makes a great placeholder
	private const PATH_PLACEHOLDER = '\\PLACEHOLDER\\';

	/** @var callable(CachedMountInfo): string */
	protected $rootInternalPathCallback;

	/**
	 * @param IUser $user
	 * @param int $storageId
	 * @param int $rootId
	 * @param string $mountPoint
	 * @param string $mountProvider
	 * @param int|null $mountId
	 * @param callable(CachedMountInfo): string $rootInternalPathCallback
	 * @throws \Exception
	 */
	public function __construct(
		IUser $user,
		int $storageId,
		int $rootId,
		string $mountPoint,
		string $mountProvider,
		?int $mountId,
		callable $rootInternalPathCallback,
	) {
		parent::__construct($user, $storageId, $rootId, $mountPoint, $mountProvider, $mountId, self::PATH_PLACEHOLDER);
		$this->rootInternalPathCallback = $rootInternalPathCallback;
	}

	public function getRootInternalPath(): string {
		if ($this->rootInternalPath === self::PATH_PLACEHOLDER) {
			$this->rootInternalPath = ($this->rootInternalPathCallback)($this);
		}
		return $this->rootInternalPath;
	}
}