Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
a87cc90d
Commit
a87cc90d
authored
Mar 20, 2015
by
Thomas Müller
Browse files
Merge pull request #14993 from owncloud/stop-on-missing-deps
Stop executing, when 3rdparty is missing or apps directory is invalid
parents
cce303ff
4a13a84c
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/base.php
View file @
a87cc90d
...
...
@@ -80,6 +80,10 @@ class OC {
*/
public
static
$server
=
null
;
/**
* @throws \RuntimeException when the 3rdparty directory is missing or
* the app path list is empty or contains an invalid path
*/
public
static
function
initPaths
()
{
// calculate the root directories
OC
::
$SERVERROOT
=
str_replace
(
"
\\
"
,
'/'
,
substr
(
__DIR__
,
0
,
-
4
));
...
...
@@ -155,10 +159,9 @@ class OC {
}
}
if
(
empty
(
OC
::
$THIRDPARTYROOT
)
||
!
file_exists
(
OC
::
$THIRDPARTYROOT
))
{
echo
(
'3rdparty directory not found! Please put the ownCloud 3rdparty'
throw
new
\
RuntimeException
(
'3rdparty directory not found! Please put the ownCloud 3rdparty'
.
' folder in the ownCloud folder or the folder above.'
.
' You can also configure the location in the config.php file.'
);
return
;
}
// search the apps folder
...
...
@@ -182,12 +185,17 @@ class OC {
}
if
(
empty
(
OC
::
$APPSROOTS
))
{
throw
new
Exception
(
'apps directory not found! Please put the ownCloud apps folder in the ownCloud folder'
throw
new
\
Runtime
Exception
(
'apps directory not found! Please put the ownCloud apps folder in the ownCloud folder'
.
' or the folder above. You can also configure the location in the config.php file.'
);
}
$paths
=
array
();
foreach
(
OC
::
$APPSROOTS
as
$path
)
{
$paths
[]
=
$path
[
'path'
];
if
(
!
is_dir
(
$path
[
'path'
]))
{
throw
new
\
RuntimeException
(
sprintf
(
'App directory "%s" not found! Please put the ownCloud apps folder in the'
.
' ownCloud folder or the folder above. You can also configure the location in the'
.
' config.php file.'
,
$path
[
'path'
]));
}
}
// set the right include path
...
...
@@ -465,17 +473,20 @@ class OC {
self
::
$CLI
=
(
php_sapi_name
()
==
'cli'
);
self
::
initPaths
();
// setup 3rdparty autoloader
$vendorAutoLoad
=
OC
::
$THIRDPARTYROOT
.
'/3rdparty/autoload.php'
;
if
(
file_exists
(
$vendorAutoLoad
))
{
try
{
self
::
initPaths
();
// setup 3rdparty autoloader
$vendorAutoLoad
=
OC
::
$THIRDPARTYROOT
.
'/3rdparty/autoload.php'
;
if
(
!
file_exists
(
$vendorAutoLoad
))
{
throw
new
\
RuntimeException
(
'Composer autoloader not found, unable to continue. Check the folder "3rdparty".'
);
}
require_once
$vendorAutoLoad
;
}
else
{
}
catch
(
\
RuntimeException
$e
)
{
OC_Response
::
setStatus
(
OC_Response
::
STATUS_SERVICE_UNAVAILABLE
);
// we can't use the template error page here, because this needs the
// DI container which isn't available yet
print
(
'Composer autoloader not found, unable to continue. Check the folder "3rdparty".'
);
print
(
$e
->
getMessage
()
);
exit
();
}
...
...
tests/preseed-config.php
View file @
a87cc90d
<?php
$CONFIG
=
array
(
"appstoreenabled"
=>
false
,
'apps_paths'
=>
array
(
0
=>
array
(
'path'
=>
OC
::
$SERVERROOT
.
'/apps'
,
'url'
=>
'/apps'
,
'writable'
=>
true
,
),
1
=>
array
(
'path'
=>
OC
::
$SERVERROOT
.
'/apps2'
,
'url'
=>
'/apps2'
,
'writable'
=>
false
,
)
),
);
$CONFIG
=
[
'appstoreenabled'
=>
false
,
'apps_paths'
=>
[
[
'path'
=>
OC
::
$SERVERROOT
.
'/apps'
,
'url'
=>
'/apps'
,
'writable'
=>
true
,
],
],
];
if
(
substr
(
strtolower
(
PHP_OS
),
0
,
3
)
==
"win"
)
{
$CONFIG
[
'openssl'
]
=
array
(
'config'
=>
OC
::
$SERVERROOT
.
'/tests/data/openssl.cnf'
);
if
(
is_dir
(
OC
::
$SERVERROOT
.
'/apps2'
))
{
$CONFIG
[
'apps_paths'
][]
=
[
'path'
=>
OC
::
$SERVERROOT
.
'/apps2'
,
'url'
=>
'/apps2'
,
'writable'
=>
false
,
];
}
if
(
substr
(
strtolower
(
PHP_OS
),
0
,
3
)
===
'win'
)
{
$CONFIG
[
'openssl'
]
=
[
'config'
=>
OC
::
$SERVERROOT
.
'/tests/data/openssl.cnf'
];
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment