本文整理匯總了PHP中OC_Filesystem::loaded方法的典型用法代碼示例。如果您正苦於以下問題:PHP OC_Filesystem::loaded方法的具體用法?PHP OC_Filesystem::loaded怎麽用?PHP OC_Filesystem::loaded使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OC_Filesystem
的用法示例。
在下文中一共展示了OC_Filesystem::loaded方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
public static function init($root)
{
if (self::$defaultInstance) {
return false;
}
self::$defaultInstance = new OC_FilesystemView($root);
//load custom mount config
if (is_file(OC::$SERVERROOT . '/config/mount.php')) {
$mountConfig = (include OC::$SERVERROOT . '/config/mount.php');
if (isset($mountConfig['global'])) {
foreach ($mountConfig['global'] as $mountPoint => $options) {
self::mount($options['class'], $options['options'], $mountPoint);
}
}
if (isset($mountConfig['group'])) {
foreach ($mountConfig['group'] as $group => $mounts) {
if (OC_Group::inGroup(OC_User::getUser(), $group)) {
foreach ($mounts as $mountPoint => $options) {
$mountPoint = self::setUserVars($mountPoint);
foreach ($options as &$option) {
$option = self::setUserVars($option);
}
self::mount($options['class'], $options['options'], $mountPoint);
}
}
}
}
if (isset($mountConfig['user'])) {
foreach ($mountConfig['user'] as $user => $mounts) {
if ($user === 'all' or strtolower($user) === strtolower(OC_User::getUser())) {
foreach ($mounts as $mountPoint => $options) {
$mountPoint = self::setUserVars($mountPoint);
foreach ($options as &$option) {
$option = self::setUserVars($option);
}
self::mount($options['class'], $options['options'], $mountPoint);
}
}
}
}
$mtime = filemtime(OC::$SERVERROOT . '/config/mount.php');
$previousMTime = OC_Appconfig::getValue('files', 'mountconfigmtime', 0);
if ($mtime > $previousMTime) {
//mount config has changed, filecache needs to be updated
OC_FileCache::triggerUpdate();
OC_Appconfig::setValue('files', 'mountconfigmtime', $mtime);
}
}
self::$loaded = true;
}
示例2: init
public static function init($root)
{
if (self::$defaultInstance) {
return false;
}
self::$defaultInstance = new OC_FilesystemView($root);
//load custom mount config
if (is_file(OC::$SERVERROOT . '/config/mount.php')) {
$mountConfig = (include OC::$SERVERROOT . '/config/mount.php');
if (isset($mountConfig['global'])) {
foreach ($mountConfig['global'] as $mountPoint => $options) {
self::mount($options['class'], $options['options'], $mountPoint);
}
}
if (isset($mountConfig['group'])) {
foreach ($mountConfig['group'] as $group => $mounts) {
if (OC_Group::inGroup(OC_User::getUser(), $group)) {
foreach ($mounts as $mountPoint => $options) {
$mountPoint = self::setUserVars($mountPoint);
foreach ($options as &$option) {
$option = self::setUserVars($option);
}
self::mount($options['class'], $options['options'], $mountPoint);
}
}
}
}
if (isset($mountConfig['user'])) {
foreach ($mountConfig['user'] as $user => $mounts) {
if ($user === 'all' or strtolower($user) === strtolower(OC_User::getUser())) {
foreach ($mounts as $mountPoint => $options) {
$mountPoint = self::setUserVars($mountPoint);
foreach ($options as &$option) {
$option = self::setUserVars($option);
}
self::mount($options['class'], $options['options'], $mountPoint);
}
}
}
}
}
self::$loaded = true;
}
示例3: init
public static function init($root, $user = '')
{
if (self::$defaultInstance) {
return false;
}
self::$defaultInstance = new OC_FilesystemView($root);
//load custom mount config
if (!isset($user)) {
$user = OC_User::getUser();
}
self::loadSystemMountPoints($user);
self::$loaded = true;
}