Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
773f3cf9
Commit
773f3cf9
authored
12 years ago
by
Arthur Schiwon
Browse files
Options
Downloads
Patches
Plain Diff
make it possible to load apps seperately. needed to fix oc-910 without breaking oc-863
parent
b117a1e3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/app.php
+14
-19
14 additions, 19 deletions
lib/app.php
with
14 additions
and
19 deletions
lib/app.php
+
14
−
19
View file @
773f3cf9
...
...
@@ -27,7 +27,6 @@
* upgrading and removing apps.
*/
class
OC_App
{
static
private
$init
=
false
;
static
private
$apps
=
array
();
static
private
$activeapp
=
''
;
static
private
$navigation
=
array
();
...
...
@@ -36,6 +35,7 @@ class OC_App{
static
private
$personalForms
=
array
();
static
private
$appInfo
=
array
();
static
private
$appTypes
=
array
();
static
private
$loadedApps
=
array
();
/**
* @brief loads all apps
...
...
@@ -49,15 +49,11 @@ class OC_App{
* if $types is set, only apps of those types will be loaded
*/
public
static
function
loadApps
(
$types
=
null
){
// Did we already load everything?
if
(
self
::
$init
){
return
true
;
}
// Our very own core apps are hardcoded
foreach
(
array
(
'settings'
)
as
$app
){
if
(
is_null
(
$types
)){
if
(
is_null
(
$types
)
&&
!
in_array
(
$app
,
self
::
$loadedApps
)
){
require
(
$app
.
'/appinfo/app.php'
);
self
::
$loadedApps
[]
=
$app
;
}
}
...
...
@@ -66,14 +62,13 @@ class OC_App{
// prevent app.php from printing output
ob_start
();
foreach
(
$apps
as
$app
){
if
((
is_null
(
$types
)
or
self
::
isType
(
$app
,
$types
))){
if
((
is_null
(
$types
)
or
self
::
isType
(
$app
,
$types
))
&&
!
in_array
(
$app
,
self
::
$loadedApps
)
){
self
::
loadApp
(
$app
);
self
::
$loadedApps
[]
=
$app
;
}
}
ob_end_clean
();
self
::
$init
=
true
;
// return
return
true
;
}
...
...
@@ -129,7 +124,7 @@ class OC_App{
*/
public
static
function
setAppTypes
(
$app
){
$appData
=
self
::
getAppInfo
(
$app
);
if
(
isset
(
$appData
[
'types'
])){
$appTypes
=
implode
(
','
,
$appData
[
'types'
]);
}
else
{
...
...
@@ -191,7 +186,7 @@ class OC_App{
if
(
$app
!==
false
){
// check if the app is compatible with this version of ownCloud
$info
=
OC_App
::
getAppInfo
(
$app
);
$version
=
OC_Util
::
getVersion
();
$version
=
OC_Util
::
getVersion
();
if
(
!
isset
(
$info
[
'require'
])
or
(
$version
[
0
]
>
$info
[
'require'
])){
OC_Log
::
write
(
'core'
,
'App "'
.
$info
[
'name'
]
.
'" can\'t be installed because it is not compatible with this version of ownCloud'
,
OC_Log
::
ERROR
);
return
false
;
...
...
@@ -525,13 +520,13 @@ class OC_App{
}
}
}
// check if the current enabled apps are compatible with the current ownCloud version. disable them if not.
// this is important if you upgrade ownCloud and have non ported 3rd party apps installed
$apps
=
OC_App
::
getEnabledApps
();
$version
=
OC_Util
::
getVersion
();
foreach
(
$apps
as
$app
)
{
// check if the app is compatible with this version of ownCloud
$info
=
OC_App
::
getAppInfo
(
$app
);
if
(
!
isset
(
$info
[
'require'
])
or
(
$version
[
0
]
>
$info
[
'require'
])){
...
...
@@ -539,12 +534,12 @@ class OC_App{
OC_App
::
disable
(
$app
);
}
}
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment