summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bart@thisnet.nl>2011-09-18 19:37:54 +0200
committerBart Visscher <bart@thisnet.nl>2011-09-18 19:37:54 +0200
commit82c7598861db175617694891bb9f21b426426225 (patch)
treefce8fb4717b4cc2a5dc6da8835bdb51b5fb40054
parentd5656716f69caa6a1eb98706994ffcb9a08553a7 (diff)
downloadnextcloud-server-82c7598861db175617694891bb9f21b426426225.tar.gz
nextcloud-server-82c7598861db175617694891bb9f21b426426225.zip
Remove global vars and use the OC static version.
Removed global vars are DOCUMENTROOT, SERVERROOT, SUBURI, WEBROOT and CONFIG_DATADIRECTORY
-rw-r--r--3rdparty/MDB2.php5
-rw-r--r--3rdparty/MDB2/Driver/Manager/sqlite.php5
-rw-r--r--3rdparty/MDB2/Driver/sqlite.php5
-rw-r--r--apps/calendar/caldav.php2
-rw-r--r--apps/contacts/carddav.php2
-rw-r--r--apps/media/ajax/api.php3
-rw-r--r--apps/media/lib_ampache.php3
-rw-r--r--apps/media/server/xml.server.php1
-rw-r--r--apps/unhosted/compat.php2
-rw-r--r--apps/user_openid/appinfo/app.php3
-rw-r--r--apps/user_openid/user.php3
-rw-r--r--apps/user_openid/user_openid.php5
-rw-r--r--core/templates/layout.guest.php2
-rw-r--r--core/templates/layout.user.php2
-rw-r--r--files/webdav.php2
-rw-r--r--index.php8
-rw-r--r--lib/MDB2/Driver/Manager/sqlite3.php5
-rw-r--r--lib/MDB2/Driver/sqlite3.php5
-rw-r--r--lib/app.php7
-rw-r--r--lib/base.php27
-rw-r--r--lib/config.php11
-rw-r--r--lib/db.php3
-rw-r--r--lib/files.php11
-rw-r--r--lib/helper.php40
-rw-r--r--lib/installer.php11
-rw-r--r--lib/l10n.php15
-rw-r--r--lib/remote/cloud.php8
-rw-r--r--lib/setup.php14
-rw-r--r--lib/template.php34
-rw-r--r--lib/util.php23
-rw-r--r--search/index.php2
31 files changed, 103 insertions, 166 deletions
diff --git a/3rdparty/MDB2.php b/3rdparty/MDB2.php
index fbc7107914e..aa7ec6ba093 100644
--- a/3rdparty/MDB2.php
+++ b/3rdparty/MDB2.php
@@ -969,11 +969,10 @@ class MDB2
static function fileExists($file)
{
// safe_mode does notwork with is_readable()
- global $SERVERROOT;
if (!@ini_get('safe_mode')) {
$dirs = explode(PATH_SEPARATOR, ini_get('include_path'));
- array_unshift($dirs,$SERVERROOT);
- array_unshift($dirs,$SERVERROOT. DIRECTORY_SEPARATOR .'inc');
+ array_unshift($dirs,OC::$SERVERROOT);
+ array_unshift($dirs,OC::$SERVERROOT. DIRECTORY_SEPARATOR .'inc');
// print_r($dirs);die();
foreach ($dirs as $dir) {
if (is_readable($dir . DIRECTORY_SEPARATOR . $file)) {
diff --git a/3rdparty/MDB2/Driver/Manager/sqlite.php b/3rdparty/MDB2/Driver/Manager/sqlite.php
index 64019669645..650910174e7 100644
--- a/3rdparty/MDB2/Driver/Manager/sqlite.php
+++ b/3rdparty/MDB2/Driver/Manager/sqlite.php
@@ -71,8 +71,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
*/
function createDatabase($name, $options = array())
{
- global $SERVERROOT;
- $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
+ $datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
$db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
@@ -1362,4 +1361,4 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
// }}}
}
-?> \ No newline at end of file
+?>
diff --git a/3rdparty/MDB2/Driver/sqlite.php b/3rdparty/MDB2/Driver/sqlite.php
index 63db241b863..5d2ad27d016 100644
--- a/3rdparty/MDB2/Driver/sqlite.php
+++ b/3rdparty/MDB2/Driver/sqlite.php
@@ -347,8 +347,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
**/
function connect()
{
- global $SERVERROOT;
- $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
+ $datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
$database_file = $this->_getDatabaseFile($this->database_name);
if (is_resource($this->connection)) {
//if (count(array_diff($this->connected_dsn, $this->dsn)) == 0
@@ -1086,4 +1085,4 @@ class MDB2_Statement_sqlite extends MDB2_Statement_Common
}
-?> \ No newline at end of file
+?>
diff --git a/apps/calendar/caldav.php b/apps/calendar/caldav.php
index 49fc9633365..15259ad4461 100644
--- a/apps/calendar/caldav.php
+++ b/apps/calendar/caldav.php
@@ -38,7 +38,7 @@ $nodes = array(
// Fire up server
$server = new Sabre_DAV_Server($nodes);
-$server->setBaseUri($WEBROOT.'/apps/calendar/caldav.php');
+$server->setBaseUri(OC::$WEBROOT.'/apps/calendar/caldav.php');
// Add plugins
$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
$server->addPlugin(new Sabre_CalDAV_Plugin());
diff --git a/apps/contacts/carddav.php b/apps/contacts/carddav.php
index 77b3c105deb..4bc215453c4 100644
--- a/apps/contacts/carddav.php
+++ b/apps/contacts/carddav.php
@@ -38,7 +38,7 @@ $nodes = array(
// Fire up server
$server = new Sabre_DAV_Server($nodes);
-$server->setBaseUri($WEBROOT.'/apps/contacts/carddav.php');
+$server->setBaseUri(OC::$WEBROOT.'/apps/contacts/carddav.php');
// Add plugins
$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
$server->addPlugin(new Sabre_CardDAV_Plugin());
diff --git a/apps/media/ajax/api.php b/apps/media/ajax/api.php
index 3b4932728da..31ff33bf03a 100644
--- a/apps/media/ajax/api.php
+++ b/apps/media/ajax/api.php
@@ -41,7 +41,6 @@ if(!isset($_POST['action']) and isset($_GET['action'])){
foreach($arguments as &$argument){
$argument=stripslashes($argument);
}
-global $CONFIG_DATADIRECTORY;
@ob_clean();
if(!isset($arguments['artist'])){
$arguments['artist']=0;
@@ -155,4 +154,4 @@ function findMusic($path='/'){
return $music;
}
-?> \ No newline at end of file
+?>
diff --git a/apps/media/lib_ampache.php b/apps/media/lib_ampache.php
index b3bd7b16189..dc88e35a697 100644
--- a/apps/media/lib_ampache.php
+++ b/apps/media/lib_ampache.php
@@ -157,7 +157,6 @@ class OC_MEDIA_AMPACHE{
}
private static function printSong($song,$artistName=false,$albumName=false){
- global $WEBROOT;
if(!$artistName){
$artistName=OC_MEDIA_COLLECTION::getArtistName($song['song_artist']);
}
@@ -363,4 +362,4 @@ class OC_MEDIA_AMPACHE{
}
}
-?> \ No newline at end of file
+?>
diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php
index 516ab740072..e61fadf234c 100644
--- a/apps/media/server/xml.server.php
+++ b/apps/media/server/xml.server.php
@@ -35,7 +35,6 @@ foreach($arguments as &$argument){
$argument=stripslashes($argument);
}
ob_clean();
-global $CONFIG_DATADIRECTORY;
if(isset($arguments['action'])){
error_log($arguments['action']);
switch($arguments['action']){
diff --git a/apps/unhosted/compat.php b/apps/unhosted/compat.php
index 5034d04de31..00d6a7c2eeb 100644
--- a/apps/unhosted/compat.php
+++ b/apps/unhosted/compat.php
@@ -67,7 +67,7 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted'
$server = new Sabre_DAV_Server($publicDir);
// Path to our script
- $server->setBaseUri("$WEBROOT/apps/unhosted/compat.php/$ownCloudUser");
+ $server->setBaseUri(OC::$WEBROOT."/apps/unhosted/compat.php/$ownCloudUser");
// Auth backend
$authBackend = new OC_Connector_Sabre_Auth_ro_oauth(OC_UnhostedWeb::getValidTokens($ownCloudUser, $userName.'@'.$userHost, $dataScope));
diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php
index e8e9fd2296b..578f8f4dade 100644
--- a/apps/user_openid/appinfo/app.php
+++ b/apps/user_openid/appinfo/app.php
@@ -32,13 +32,12 @@ if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){
$openid_validation_result = $openid->ValidateWithServer();
if ($openid_validation_result == true){ // OK HERE KEY IS VALID
error_log('auth sucessfull');
- global $WEBROOT;
$identity=$openid->GetIdentity();
error_log("auth as $identity");
$user=OC_USER_OPENID::findUserForIdentity($identity);
if($user){
$_SESSION['user_id']=$user;
- header("Location: $WEBROOT");
+ header("Location: ".OC::$WEBROOT);
}
}else if($openid->IsError() == true){ // ON THE WAY, WE GOT SOME ERROR
$error = $openid->GetError();
diff --git a/apps/user_openid/user.php b/apps/user_openid/user.php
index 52fa1047344..60e12ed88e0 100644
--- a/apps/user_openid/user.php
+++ b/apps/user_openid/user.php
@@ -42,10 +42,9 @@ if(!OC_User::userExists($USERNAME)){
error_log($USERNAME.' doesn\'t exist');
$USERNAME='';
}
-global $WEBROOT;
$IDENTITY=OC_Helper::linkTo( "user_openid", "user.php", null, true ).'/'.$USERNAME;
require_once 'phpmyid.php';
-?> \ No newline at end of file
+?>
diff --git a/apps/user_openid/user_openid.php b/apps/user_openid/user_openid.php
index d9af94dcafa..df050e908de 100644
--- a/apps/user_openid/user_openid.php
+++ b/apps/user_openid/user_openid.php
@@ -36,13 +36,12 @@ class OC_USER_OPENID extends OC_User_Backend {
* Check if the password is correct without logging in the user
*/
public function checkPassword( $uid, $password ){
- global $WEBROOT;
// Get identity from user and redirect browser to OpenID Server
$openid = new SimpleOpenID;
$openid->SetIdentity($uid);
$openid->SetTrustRoot('http://' . $_SERVER["HTTP_HOST"]);
if ($openid->GetOpenIDServer()){
- $openid->SetApprovedURL('http://' . $_SERVER["HTTP_HOST"] . $WEBROOT); // Send Response from OpenID server to this script
+ $openid->SetApprovedURL('http://' . $_SERVER["HTTP_HOST"] . OC::$WEBROOT); // Send Response from OpenID server to this script
$openid->Redirect(); // This will redirect user to OpenID Server
exit;
}else{
@@ -67,4 +66,4 @@ class OC_USER_OPENID extends OC_User_Backend {
-?> \ No newline at end of file
+?>
diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php
index 6f40619f5f5..7e05fce0ecf 100644
--- a/core/templates/layout.guest.php
+++ b/core/templates/layout.guest.php
@@ -8,7 +8,7 @@
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
<?php endforeach; ?>
<script type="text/javascript">
- var oc_webroot = '<?php global $WEBROOT; echo $WEBROOT; ?>';
+ var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
</script>
<?php foreach($_['jsfiles'] as $jsfile): ?>
<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 90b19259292..f793275f2ca 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -8,7 +8,7 @@
<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
<?php endforeach; ?>
<script type="text/javascript">
- var oc_webroot = '<?php global $WEBROOT; echo $WEBROOT; ?>';
+ var oc_webroot = '<?php echo OC::$WEBROOT; ?>';
var oc_current_user = '<?php echo OC_User::getUser() ?>';
</script>
<?php foreach($_['jsfiles'] as $jsfile): ?>
diff --git a/files/webdav.php b/files/webdav.php
index b1d242b2cc9..dd06074b780 100644
--- a/files/webdav.php
+++ b/files/webdav.php
@@ -37,7 +37,7 @@ $publicDir = new OC_Connector_Sabre_Directory('');
// Fire up server
$server = new Sabre_DAV_Server($publicDir);
-$server->setBaseUri($WEBROOT.'/files/webdav.php');
+$server->setBaseUri(OC::$WEBROOT.'/files/webdav.php');
// Load plugins
$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
diff --git a/index.php b/index.php
index 5255e8fadbe..249ce41d51e 100644
--- a/index.php
+++ b/index.php
@@ -50,11 +50,11 @@ if($_SERVER['REQUEST_METHOD']=='PROPFIND'){//handle webdav
elseif(OC_User::isLoggedIn()) {
if(isset($_GET["logout"]) and ($_GET["logout"])) {
OC_User::logout();
- header("Location: ".$WEBROOT.'/');
+ header("Location: ".OC::$WEBROOT.'/');
exit();
}
else {
- header("Location: ".$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
+ header("Location: ".OC::$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
exit();
}
}
@@ -67,7 +67,7 @@ elseif(isset($_COOKIE["oc_remember_login"]) && $_COOKIE["oc_remember_login"]) {
if(OC_User::userExists($_COOKIE['oc_username']) &&
OC_Preferences::getValue($_COOKIE['oc_username'], "login", "token") == $_COOKIE['oc_token']) {
OC_User::setUserId($_COOKIE['oc_username']);
- header("Location: ". $WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
+ header("Location: ". OC::$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
}
else {
OC_Template::printGuestPage("", "login", array("error" => true));
@@ -78,7 +78,7 @@ elseif(isset($_COOKIE["oc_remember_login"]) && $_COOKIE["oc_remember_login"]) {
elseif(isset($_POST["user"]) && isset($_POST['password'])) {
OC_App::loadApps();
if(OC_User::login($_POST["user"], $_POST["password"])) {
- header("Location: ".$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
+ header("Location: ".OC::$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
if(!empty($_POST["remember_login"])){
error_log("Setting remember login to cookie");
$token = md5($_POST["user"].time());
diff --git a/lib/MDB2/Driver/Manager/sqlite3.php b/lib/MDB2/Driver/Manager/sqlite3.php
index 4e420b5d0b2..eabbb72b3c2 100644
--- a/lib/MDB2/Driver/Manager/sqlite3.php
+++ b/lib/MDB2/Driver/Manager/sqlite3.php
@@ -69,8 +69,7 @@ class MDB2_Driver_Manager_sqlite3 extends MDB2_Driver_Manager_Common
*/
function createDatabase($name, $options = array())
{
- global $SERVERROOT;
- $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
+ $datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
$db =$this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
@@ -1361,4 +1360,4 @@ class MDB2_Driver_Manager_sqlite3 extends MDB2_Driver_Manager_Common
// }}}
}
-?> \ No newline at end of file
+?>
diff --git a/lib/MDB2/Driver/sqlite3.php b/lib/MDB2/Driver/sqlite3.php
index ccf6bb53688..a41aeed4850 100644
--- a/lib/MDB2/Driver/sqlite3.php
+++ b/lib/MDB2/Driver/sqlite3.php
@@ -351,8 +351,7 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common
if($this->connection instanceof SQLite3){
return MDB2_OK;
}
- global $SERVERROOT;
- $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
+ $datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
$database_file = $this->_getDatabaseFile($this->database_name);
if (is_resource($this->connection)) {
//if (count(array_diff($this->connected_dsn, $this->dsn)) == 0
@@ -1358,4 +1357,4 @@ class MDB2_Statement_sqlite3 extends MDB2_Statement_Common
}
}
-?> \ No newline at end of file
+?>
diff --git a/lib/app.php b/lib/app.php
index 61ea081c6ff..cd4a7293e49 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -44,8 +44,6 @@ class OC_App{
* exists.
*/
public static function loadApps(){
- global $SERVERROOT;
-
// Did we allready load everything?
if( self::$init ){
return true;
@@ -60,7 +58,7 @@ class OC_App{
$apps = OC_Appconfig::getApps();
foreach( $apps as $app ){
if( self::isEnabled( $app )){
- if(is_file($SERVERROOT.'/apps/'.$app.'/appinfo/app.php')){
+ if(is_file(OC::$SERVERROOT.'/apps/'.$app.'/appinfo/app.php')){
require( 'apps/'.$app.'/appinfo/app.php' );
}
}
@@ -285,8 +283,7 @@ class OC_App{
* @return string
*/
public static function getCurrentApp(){
- global $WEBROOT;
- $script=substr($_SERVER["SCRIPT_NAME"],strlen($WEBROOT)+1);
+ $script=substr($_SERVER["SCRIPT_NAME"],strlen(OC::$WEBROOT)+1);
$topFolder=substr($script,0,strpos($script,'/'));
if($topFolder=='apps'){
$length=strlen($topFolder);
diff --git a/lib/base.php b/lib/base.php
index dc3ed4129cd..7344601ba45 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -81,30 +81,21 @@ ini_set('session.cookie_httponly','1;');
session_start();
// calculate the documentroot
-$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
-$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13));
-$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT));
+OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
+OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13));
+OC::$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen(OC::$SERVERROOT));
$scriptName=$_SERVER["SCRIPT_NAME"];
if(substr($scriptName,-1)=='/'){
$scriptName.='index.php';
}
-$WEBROOT=substr($scriptName,0,strlen($scriptName)-strlen($SUBURI));
+OC::$WEBROOT=substr($scriptName,0,strlen($scriptName)-strlen(OC::$SUBURI));
-OC::$SERVERROOT=$SERVERROOT;
-OC::$WEBROOT=$WEBROOT;
-
-if($WEBROOT!='' and $WEBROOT[0]!=='/'){
- $WEBROOT='/'.$WEBROOT;
+if(OC::$WEBROOT!='' and OC::$WEBROOT[0]!=='/'){
+ OC::$WEBROOT='/'.OC::$WEBROOT;
}
-// We are going to use OC::* instead of globels soon
-OC::$WEBROOT = $WEBROOT;
-OC::$SERVERROOT = $SERVERROOT;
-OC::$DOCUMENTROOT = $DOCUMENTROOT;
-OC::$SUBURI = $SUBURI;
-
// set the right include path
-set_include_path($SERVERROOT.'/lib'.PATH_SEPARATOR.$SERVERROOT.'/config'.PATH_SEPARATOR.$SERVERROOT.'/3rdparty'.PATH_SEPARATOR.get_include_path().PATH_SEPARATOR.$SERVERROOT);
+set_include_path(OC::$SERVERROOT.'/lib'.PATH_SEPARATOR.OC::$SERVERROOT.'/config'.PATH_SEPARATOR.OC::$SERVERROOT.'/3rdparty'.PATH_SEPARATOR.get_include_path().PATH_SEPARATOR.OC::$SERVERROOT);
//Some libs we really depend on
require_once('Sabre/autoload.php');
@@ -119,9 +110,9 @@ if( !isset( $RUNTIME_NOAPPS )){
// TODO: we should get rid of this one, too
// WARNING: to make everything even more confusing, DATADIRECTORY is a var that
-// changes and DATATIRECTORY_ROOT stays the same, but is set by
+// changes and DATADIRECTORY_ROOT stays the same, but is set by
// "datadirectory". Any questions?
-$CONFIG_DATADIRECTORY = OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
+OC::$CONFIG_DATADIRECTORY = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
// redirect to https site if configured
if( OC_Config::getValue( "forcessl", false )){
diff --git a/lib/config.php b/lib/config.php
index dafb37edd33..67df5e94c6d 100644
--- a/lib/config.php
+++ b/lib/config.php
@@ -131,14 +131,12 @@ class OC_Config{
return true;
}
- global $SERVERROOT;
-
- if( !file_exists( "$SERVERROOT/config/config.php" )){
+ if( !file_exists( OC::$SERVERROOT."/config/config.php" )){
return false;
}
// Include the file, save the data from $CONFIG
- include( "$SERVERROOT/config/config.php" );
+ include( OC::$SERVERROOT."/config/config.php" );
if( isset( $CONFIG ) && is_array( $CONFIG )){
self::$cache = $CONFIG;
}
@@ -158,9 +156,6 @@ class OC_Config{
* Known flaws: Strings are not escaped properly
*/
public static function writeData(){
- // We need the serverroot path
- global $SERVERROOT;
-
// Create a php file ...
$content = "<?php\n\$CONFIG = array(\n";
@@ -177,7 +172,7 @@ class OC_Config{
$content .= ");\n?>\n";
// Write the file
- $result=@file_put_contents( "$SERVERROOT/config/config.php", $content );
+ $result=@file_put_contents( OC::$SERVERROOT."/config/config.php", $content );
if(!$result) {
$tmpl = new OC_Template( '', 'error', 'guest' );
$tmpl->assign('errors',array(1=>array('error'=>"Can't write into config directory 'config'",'hint'=>"You can usually fix this by setting the owner of 'config' to the user that the web server uses (".exec('whoami').")")));
diff --git a/lib/db.php b/lib/db.php
index 414525ae207..0b7065eec8b 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -43,8 +43,7 @@ class OC_DB {
$CONFIG_DBUSER = OC_Config::getValue( "dbuser", "" );;
$CONFIG_DBPASSWORD = OC_Config::getValue( "dbpassword", "" );;
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );;
- global $SERVERROOT;
- $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
+ $datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
// do nothing if the connection already has been established
if(!self::$DBConnection){
diff --git a/lib/files.php b/lib/files.php
index f1789d9c7ac..84dc9fd1c53 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -33,9 +33,8 @@ class OC_Files {
* @param dir $directory
*/
public static function getDirectoryContent($directory){
- global $CONFIG_DATADIRECTORY;
- if(strpos($directory,$CONFIG_DATADIRECTORY)===0){
- $directory=substr($directory,strlen($CONFIG_DATADIRECTORY));
+ if(strpos($directory,OC::$CONFIG_DATADIRECTORY)===0){
+ $directory=substr($directory,strlen(OC::$CONFIG_DATADIRECTORY));
}
$filesfound=true;
$content=array();
@@ -279,16 +278,14 @@ class OC_Files {
* @param int size filesisze in bytes
*/
static function setUploadLimit($size){
- global $SERVERROOT;
- global $WEBROOT;
$size=OC_Helper::humanFileSize($size);
$size=substr($size,0,-1);//strip the B
$size=str_replace(' ','',$size); //remove the space between the size and the postfix
- $content = "ErrorDocument 404 /$WEBROOT/core/templates/404.php\n";//custom 404 error page
+ $content = "ErrorDocument 404 /".OC::$WEBROOT."/core/templates/404.php\n";//custom 404 error page
$content.= "php_value upload_max_filesize $size\n";//upload limit
$content.= "php_value post_max_size $size\n";
$content.= "SetEnv htaccessWorking true\n";
$content.= "Options -Indexes\n";
- @file_put_contents($SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it
+ @file_put_contents(OC::$SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it
}
}
diff --git a/lib/helper.php b/lib/helper.php
index d9b47280ff7..1661f38e8ab 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -35,25 +35,22 @@ class OC_Helper {
* Returns a url to the given app and file.
*/
public static function linkTo( $app, $file, $redirect_url=NULL, $absolute=false ){
- global $WEBROOT;
- global $SERVERROOT;
-
if( $app != '' ){
$app .= '/';
// Check if the app is in the app folder
- if( file_exists( $SERVERROOT . '/apps/'. $app.$file )){
- $urlLinkTo = $WEBROOT . '/apps/' . $app . $file;
+ if( file_exists( OC::$SERVERROOT . '/apps/'. $app.$file )){
+ $urlLinkTo = OC::$WEBROOT . '/apps/' . $app . $file;
}
else{
- $urlLinkTo = $WEBROOT . '/' . $app . $file;
+ $urlLinkTo = OC::$WEBROOT . '/' . $app . $file;
}
}
else{
- if( file_exists( $SERVERROOT . '/core/'. $file )){
- $urlLinkTo = $WEBROOT . '/core/'.$file;
+ if( file_exists( OC::$SERVERROOT . '/core/'. $file )){
+ $urlLinkTo = OC::$WEBROOT . '/core/'.$file;
}
else{
- $urlLinkTo = $WEBROOT . '/'.$file;
+ $urlLinkTo = OC::$WEBROOT . '/'.$file;
}
}
@@ -79,18 +76,15 @@ class OC_Helper {
* Returns the path to the image.
*/
public static function imagePath( $app, $image ){
- global $SERVERROOT;
- global $WEBROOT;
-
// Check if the app is in the app folder
- if( file_exists( "$SERVERROOT/apps/$app/img/$image" )){
- return "$WEBROOT/apps/$app/img/$image";
+ if( file_exists( OC::$SERVERROOT."/apps/$app/img/$image" )){
+ return OC::$WEBROOT."/apps/$app/img/$image";
}
elseif( !empty( $app )){
- return "$WEBROOT/$app/img/$image";
+ return OC::$WEBROOT."/$app/img/$image";
}
else{
- return "$WEBROOT/core/img/$image";
+ return OC::$WEBROOT."/core/img/$image";
}
}
@@ -102,27 +96,25 @@ class OC_Helper {
* Returns the path to the image of this file type.
*/
public static function mimetypeIcon( $mimetype ){
- global $SERVERROOT;
- global $WEBROOT;
// Replace slash with a minus
$mimetype = str_replace( "/", "-", $mimetype );
// Is it a dir?
if( $mimetype == "dir" ){
- return "$WEBROOT/core/img/places/folder.svg";
+ return OC::$WEBROOT."/core/img/places/folder.svg";
}
// Icon exists?
- if( file_exists( "$SERVERROOT/core/img/filetypes/$mimetype.svg" )){
- return "$WEBROOT/core/img/filetypes/$mimetype.svg";
+ if( file_exists( OC::$SERVERROOT."/core/img/filetypes/$mimetype.svg" )){
+ return OC::$WEBROOT."/core/img/filetypes/$mimetype.svg";
}
//try only the first part of the filetype
$mimetype=substr($mimetype,0,strpos($mimetype,'-'));
- if( file_exists( "$SERVERROOT/core/img/filetypes/$mimetype.svg" )){
- return "$WEBROOT/core/img/filetypes/$mimetype.svg";
+ if( file_exists( OC::$SERVERROOT."/core/img/filetypes/$mimetype.svg" )){
+ return OC::$WEBROOT."/core/img/filetypes/$mimetype.svg";
}
else{
- return "$WEBROOT/core/img/filetypes/file.svg";
+ return OC::$WEBROOT."/core/img/filetypes/file.svg";
}
}
diff --git a/lib/installer.php b/lib/installer.php
index e6810a267db..83c575032ec 100644
--- a/lib/installer.php
+++ b/lib/installer.php
@@ -55,8 +55,6 @@ class OC_Installer{
* needed to get the app working.
*/
public static function installApp( $data = array()){
- global $SERVERROOT;
-
if(!isset($data['source'])){
error_log("No source specified when installing app");
return false;
@@ -105,7 +103,7 @@ class OC_Installer{
return false;
}
$info=OC_App::getAppInfo($extractDir.'/appinfo/info.xml');
- $basedir=$SERVERROOT.'/apps/'.$info['id'];
+ $basedir=OC::$SERVERROOT.'/apps/'.$info['id'];
//check if an app with the same id is already installed
if(self::isInstalled( $info['id'] )){
@@ -246,11 +244,10 @@ class OC_Installer{
* If $enabled is false, apps are installed as disabled.
*/
public static function installShippedApps( $enabled ){
- global $SERVERROOT;
- $dir = opendir( "$SERVERROOT/apps" );
+ $dir = opendir( OC::$SERVERROOT."/apps" );
while( false !== ( $filename = readdir( $dir ))){
- if( substr( $filename, 0, 1 ) != '.' and is_dir("$SERVERROOT/apps/$filename") ){
- if( file_exists( "$SERVERROOT/apps/$filename/appinfo/app.php" )){
+ if( substr( $filename, 0, 1 ) != '.' and is_dir(OC::$SERVERROOT."/apps/$filename") ){
+ if( file_exists( OC::$SERVERROOT."/apps/$filename/appinfo/app.php" )){
if(!OC_Installer::isInstalled($filename)){
OC_Installer::installShippedApp($filename);
if( $enabled ){
diff --git a/lib/l10n.php b/lib/l10n.php
index c0c32185996..54331d44ae4 100644
--- a/lib/l10n.php
+++ b/lib/l10n.php
@@ -57,7 +57,6 @@ class OC_L10N{
* language.
*/
public function __construct($app, $lang = null){
- global $SERVERROOT;
// Find the right language
if(is_null($lang)){
$lang = self::findLanguage($app);
@@ -81,9 +80,9 @@ class OC_L10N{
}
}
- if(file_exists($SERVERROOT.'/core/l10n/l10n-'.$lang.'.php')){
+ if(file_exists(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php')){
// Include the file, save the data from $CONFIG
- include($SERVERROOT.'/core/l10n/l10n-'.$lang.'.php');
+ include(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php');
if(isset($LOCALIZATIONS) && is_array($LOCALIZATIONS)){
$this->localizations = array_merge($this->localizations, $LOCALIZATIONS);
}
@@ -224,17 +223,15 @@ class OC_L10N{
* @returns directory
*/
protected static function findI18nDir($app){
- global $SERVERROOT;
-
// find the i18n dir
- $i18ndir = $SERVERROOT.'/core/l10n/';
+ $i18ndir = OC::$SERVERROOT.'/core/l10n/';
if($app != ''){
// Check if the app is in the app folder
- if(file_exists($SERVERROOT.'/apps/'.$app.'/l10n/')){
- $i18ndir = $SERVERROOT.'/apps/'.$app.'/l10n/';
+ if(file_exists(OC::$SERVERROOT.'/apps/'.$app.'/l10n/')){
+ $i18ndir = OC::$SERVERROOT.'/apps/'.$app.'/l10n/';
}
else{
- $i18ndir = $SERVERROOT.'/'.$app.'/l10n/';
+ $i18ndir = OC::$SERVERROOT.'/'.$app.'/l10n/';
}
}
return $i18ndir;
diff --git a/lib/remote/cloud.php b/lib/remote/cloud.php
index 2d3dee47b1c..75d60155d06 100644
--- a/lib/remote/cloud.php
+++ b/lib/remote/cloud.php
@@ -184,7 +184,6 @@ class OC_REMOTE_CLOUD{
}
public function sendFile($sourceDir,$sourceFile,$targetDir,$targetFile){
- global $WEBROOT;
$source=$sourceDir.'/'.$sourceFile;
$tmp=OC_Filesystem::toTmpFile($source);
return $this->sendTmpFile($tmp,$targetDir,$targetFile);
@@ -192,15 +191,14 @@ class OC_REMOTE_CLOUD{
public function sendTmpFile($tmp,$targetDir,$targetFile){
$token=sha1(uniqid().$tmp);
- global $WEBROOT;
$file=sys_get_temp_dir().'/'.'remoteCloudFile'.$token;
rename($tmp,$file);
if( OC_Config::getValue( "forcessl", false ) or isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') {
- $url = "https://". $_SERVER['SERVER_NAME'] . $WEBROOT;
+ $url = "https://". $_SERVER['SERVER_NAME'] . OC::$WEBROOT;
}else{
- $url = "http://". $_SERVER['SERVER_NAME'] . $WEBROOT;
+ $url = "http://". $_SERVER['SERVER_NAME'] . OC::$WEBROOT;
}
return $this->apiCall('pull',array('dir'=>$targetDir,'file'=>$targetFile,'token'=>$token,'source'=>$url),true);
}
}
- \ No newline at end of file
+
diff --git a/lib/setup.php b/lib/setup.php
index ebdf3ef823e..7183eb624a8 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -3,7 +3,7 @@
$hasSQLite = (is_callable('sqlite_open') or class_exists('SQLite3'));
$hasMySQL = is_callable('mysql_connect');
$hasPostgreSQL = is_callable('pg_connect');
-$datadir = OC_Config::getValue('datadirectory', $SERVERROOT.'/data');
+$datadir = OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data');
$opts = array(
'hasSQLite' => $hasSQLite,
'hasMySQL' => $hasMySQL,
@@ -23,7 +23,7 @@ if(isset($_POST['install']) AND $_POST['install']=='true') {
OC_Template::printGuestPage("", "installation", $options);
}
else {
- header("Location: ".$WEBROOT.'/');
+ header("Location: ".OC::$WEBROOT.'/');
exit();
}
}
@@ -270,21 +270,19 @@ class OC_Setup {
* create .htaccess files for apache hosts
*/
private static function createHtaccess() {
- $SERVERROOT=OC::$SERVERROOT;
- $WEBROOT=OC::$WEBROOT;
- $content = "ErrorDocument 404 $WEBROOT/core/templates/404.php\n";//custom 404 error page
+ $content = "ErrorDocument 404 ".OC::$WEBROOT."/core/templates/404.php\n";//custom 404 error page
$content.= "<IfModule mod_php5.c>\n";
$content.= "php_value upload_max_filesize 512M\n";//upload limit
$content.= "php_value post_max_size 512M\n";
$content.= "SetEnv htaccessWorking true\n";
$content.= "</IfModule>\n";
$content.= "Options -Indexes\n";
- @file_put_contents($SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it
+ @file_put_contents(OC::$SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it
$content = "deny from all\n";
$content.= "IndexIgnore *";
- file_put_contents(OC_Config::getValue('datadirectory', $SERVERROOT.'/data').'/.htaccess', $content);
- file_put_contents(OC_Config::getValue('datadirectory', $SERVERROOT.'/data').'/index.html', '');
+ file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/.htaccess', $content);
+ file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/index.html', '');
}
}
diff --git a/lib/template.php b/lib/template.php
index adedd4f901a..a293e63b437 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -124,18 +124,15 @@ class OC_Template{
* "admin".
*/
public function __construct( $app, $name, $renderas = "" ){
- // Global vars we need
- global $SERVERROOT;
-
// Get the right template folder
- $template = "$SERVERROOT/core/templates/";
+ $template = OC::$SERVERROOT."/core/templates/";
if( $app != "" ){
// Check if the app is in the app folder
- if( file_exists( "$SERVERROOT/apps/$app/templates/" )){
- $template = "$SERVERROOT/apps/$app/templates/";
+ if( file_exists( OC::$SERVERROOT."/apps/$app/templates/" )){
+ $template = OC::$SERVERROOT."/apps/$app/templates/";
}
else{
- $template = "$SERVERROOT/$app/templates/";
+ $template = OC::$SERVERROOT."/$app/templates/";
}
}
@@ -222,9 +219,6 @@ class OC_Template{
* will produce a full page.
*/
public function fetchPage(){
- // global Data we need
- global $WEBROOT;
- global $SERVERROOT;
$data = $this->_fetch();
if( $this->renderas ){
@@ -247,25 +241,25 @@ class OC_Template{
// Add the css and js files
foreach(OC_Util::$scripts as $script){
- if(is_file("$SERVERROOT/apps/$script.js" )){
- $page->append( "jsfiles", "$WEBROOT/apps/$script.js" );
+ if(is_file(OC::$SERVERROOT."/apps/$script.js" )){
+ $page->append( "jsfiles", OC::$WEBROOT."/apps/$script.js" );
}
- elseif(is_file("$SERVERROOT/$script.js" )){
- $page->append( "jsfiles", "$WEBROOT/$script.js" );
+ elseif(is_file(OC::$SERVERROOT."/$script.js" )){
+ $page->append( "jsfiles", OC::$WEBROOT."/$script.js" );
}
else{
- $page->append( "jsfiles", "$WEBROOT/core/$script.js" );
+ $page->append( "jsfiles", OC::$WEBROOT."/core/$script.js" );
}
}
foreach(OC_Util::$styles as $style){
- if(is_file("$SERVERROOT/apps/$style.css" )){
- $page->append( "cssfiles", "$WEBROOT/apps/$style.css" );
+ if(is_file(OC::$SERVERROOT."/apps/$style.css" )){
+ $page->append( "cssfiles", OC::$WEBROOT."/apps/$style.css" );
}
- elseif(is_file("$SERVERROOT/$style.css" )){
- $page->append( "cssfiles", "$WEBROOT/$style.css" );
+ elseif(is_file(OC::$SERVERROOT."/$style.css" )){
+ $page->append( "cssfiles", OC::$WEBROOT."/$style.css" );
}
else{
- $page->append( "cssfiles", "$WEBROOT/core/$style.css" );
+ $page->append( "cssfiles", OC::$WEBROOT."/core/$style.css" );
}
}
diff --git a/lib/util.php b/lib/util.php
index f4ca879a9bc..e6c4eb83b33 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -16,19 +16,15 @@ class OC_Util {
return false;
}
- // Global Variables
- global $SERVERROOT;
- global $CONFIG_DATADIRECTORY;
-
- $CONFIG_DATADIRECTORY_ROOT = OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
- $CONFIG_BACKUPDIRECTORY = OC_Config::getValue( "backupdirectory", "$SERVERROOT/backup" );
+ $CONFIG_DATADIRECTORY_ROOT = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
+ $CONFIG_BACKUPDIRECTORY = OC_Config::getValue( "backupdirectory", OC::$SERVERROOT."/backup" );
// Create root dir
if(!is_dir($CONFIG_DATADIRECTORY_ROOT)){
$success=@mkdir($CONFIG_DATADIRECTORY_ROOT);
if(!$success) {
$tmpl = new OC_Template( '', 'error', 'guest' );
- $tmpl->assign('errors',array(1=>array('error'=>"Can't create data directory ($CONFIG_DATADIRECTORY_ROOT)",'hint'=>"You can usually fix this by setting the owner of '$SERVERROOT' to the user that the web server uses (".exec('whoami').")")));
+ $tmpl->assign('errors',array(1=>array('error'=>"Can't create data directory (".$CONFIG_DATADIRECTORY_ROOT.")",'hint'=>"You can usually fix this by setting the owner of '".OC::$SERVERROOT."' to the user that the web server uses (".exec('whoami').")")));
$tmpl->printPage();
exit;
}
@@ -57,9 +53,9 @@ class OC_Util {
$sharedStorage = OC_Filesystem::createStorage('shared',array('datadir'=>'/'.OC_User::getUser().'/files/Shared'));
OC_Filesystem::mount($sharedStorage,'/'.OC_User::getUser().'/files/Shared/');
- $CONFIG_DATADIRECTORY = "$CONFIG_DATADIRECTORY_ROOT/$user/$root";
- if( !is_dir( $CONFIG_DATADIRECTORY )){
- mkdir( $CONFIG_DATADIRECTORY, 0755, true );
+ OC::$CONFIG_DATADIRECTORY = $CONFIG_DATADIRECTORY_ROOT."/$user/$root";
+ if( !is_dir( OC::$CONFIG_DATADIRECTORY )){
+ mkdir( OC::$CONFIG_DATADIRECTORY, 0755, true );
}
// TODO: find a cool way for doing this
@@ -193,11 +189,8 @@ class OC_Util {
* @return array arrays with error messages and hints
*/
public static function checkServer(){
- global $SERVERROOT;
- global $CONFIG_DATADIRECTORY;
-
- $CONFIG_DATADIRECTORY_ROOT = OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
- $CONFIG_BACKUPDIRECTORY = OC_Config::getValue( "backupdirectory", "$SERVERROOT/backup" );
+ $CONFIG_DATADIRECTORY_ROOT = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" );
+ $CONFIG_BACKUPDIRECTORY = OC_Config::getValue( "backupdirectory", OC::$SERVERROOT."/backup" );
$CONFIG_INSTALLED = OC_Config::getValue( "installed", false );
$errors=array();
diff --git a/search/index.php b/search/index.php
index 7369a6d81ce..c781c31f549 100644
--- a/search/index.php
+++ b/search/index.php
@@ -38,7 +38,7 @@ $query=(isset($_POST['query']))?$_POST['query']:'';
if($query){
$results=OC_Search::search($query);
}else{
- header("Location: ".$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
+ header("Location: ".OC::$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
exit();
}
#n2186'>2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259
kind: pipeline
name: checkers

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: checkers
  image: nextcloudci/php7.3:php7.3-5
  commands:
    - ./autotest-checkers.sh
  secrets: [ github_token ]

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: litmus

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: litmus-v1
  image: nextcloudci/litmus-php7.3:litmus-php7.3-1
  commands:
    - bash tests/travis/install.sh sqlite
    - bash apps/dav/tests/travis/litmus-v1/script.sh
- name: litmus-v2
  image: nextcloudci/litmus-php7.3:litmus-php7.3-1
  commands:
    - bash tests/travis/install.sh sqlite
    - bash apps/dav/tests/travis/litmus-v2/script.sh

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: caldavtester-new-endpoint

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: caldavtester-new-endpoint
  image: nextcloudci/litmus-php7.3:litmus-php7.3-1
  commands:
    - bash tests/travis/install.sh sqlite
    - bash apps/dav/tests/travis/caldav/install.sh
    - bash apps/dav/tests/travis/caldav/script-new-endpoint.sh

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: caldavtester-old-endpoint

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: caldavtester-old-endpoint
  image: nextcloudci/litmus-php7.3:litmus-php7.3-1
  commands:
    - bash tests/travis/install.sh sqlite
    - bash apps/dav/tests/travis/caldav/install.sh
    - bash apps/dav/tests/travis/caldav/script-old-endpoint.sh

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: carddavtester-new-endpoint

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: carddavtester-new-endpoint
  image: nextcloudci/litmus-php7.3:litmus-php7.3-1
  commands:
    - bash tests/travis/install.sh sqlite
    - bash apps/dav/tests/travis/carddav/install.sh
    - bash apps/dav/tests/travis/carddav/script-new-endpoint.sh

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: carddavtester-old-endpoint

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: carddavtester-old-endpoint
  image: nextcloudci/litmus-php7.3:litmus-php7.3-1
  commands:
    - bash tests/travis/install.sh sqlite
    - bash apps/dav/tests/travis/carddav/install.sh
    - bash apps/dav/tests/travis/carddav/script-old-endpoint.sh

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: samba

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: sqlite-php7.3-samba-native
  image: nextcloudci/samba-native-php7.3:samba-native-php7.3-1
  commands:
    - smbd -D -FS &
    - ./autotest-external.sh sqlite smb-linux
    - wget https://codecov.io/bash -O codecov.sh
    - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite.xml; fi"
    - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite.xml; fi"
    - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite-smb-linux.xml; fi"
    - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite-smb-linux.xml; fi"
- name: sqlite-php7.3-samba-non-native
  image: nextcloudci/samba-non-native-php7.3:samba-non-native-php7.3-1
  commands:
    - smbd -D -FS &
    - ./autotest-external.sh sqlite smb-linux
    - wget https://codecov.io/bash -O codecov.sh
    - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite.xml; fi"
    - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite.xml; fi"
    - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite-smb-linux.xml; fi"
    - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite-smb-linux.xml; fi"

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: sqlite-php7.3-webdav-apache

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: sqlite-php7.3-webdav-apache
  image: nextcloudci/webdav-apache-php7.3:webdav-apache-php7.3-3
  commands:
    - apache2
    - ./autotest-external.sh sqlite webdav-apachedrone
    - wget https://codecov.io/bash -O codecov.sh
    - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite.xml; fi"
    - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite.xml; fi"
    - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite-webdav-apachedrone.xml; fi"
    - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-external-clover-sqlite-webdav-apachedrone.xml; fi"

services:
- name: cache
  image: redis

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: nodb

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: nodb-php7.3
  image: nextcloudci/php7.3:php7.3-5
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
- name: nodb-php7.4
  image: nextcloudci/php7.4:php7.4-3
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite
- name: nodb-php8.0
  image: nextcloudci/php8.0:latest
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite

services:
- name: cache
  image: redis

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: sqlite

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: sqlite-php7.3
  image: nextcloudci/php7.3:php7.3-5
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
- name: sqlite-php7.4
  image: nextcloudci/php7.4:php7.4-3
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite
- name: sqlite-php8.0
  image: nextcloudci/php8.0:latest
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh sqlite

services:
- name: cache
  image: redis

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: mariadb10.1-php7.3

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: mariadb10.1-php7.3
  image: nextcloudci/php7.3:php7.3-5
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb

services:
- name: cache
  image: redis
- name: mariadb
  image: mariadb:10.1
  environment:
    MYSQL_ROOT_PASSWORD: owncloud
    MYSQL_USER: oc_autotest
    MYSQL_PASSWORD: owncloud
    MYSQL_DATABASE: oc_autotest
  tmpfs:
    - /var/lib/mysql

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: mariadb10.2-php7.3

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: mariadb10.2-php7.3
  image: nextcloudci/php7.3:php7.3-5
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb

services:
- name: cache
  image: redis
- name: mariadb
  image: mariadb:10.2
  environment:
    MYSQL_ROOT_PASSWORD: owncloud
    MYSQL_USER: oc_autotest
    MYSQL_PASSWORD: owncloud
    MYSQL_DATABASE: oc_autotest
  tmpfs:
    - /var/lib/mysql

trigger:
  branch:
    - master
    - stable*
  event:
    - push

---
kind: pipeline
name: mariadb10.3-php7.3

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: mariadb10.3-php7.3
  image: nextcloudci/php7.3:php7.3-5
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb

services:
- name: cache
  image: redis
- name: mariadb
  image: mariadb:10.3
  environment:
    MYSQL_ROOT_PASSWORD: owncloud
    MYSQL_USER: oc_autotest
    MYSQL_PASSWORD: owncloud
    MYSQL_DATABASE: oc_autotest
  tmpfs:
    - /var/lib/mysql

trigger:
  branch:
    - master
    - stable*
  event:
    - push

---
kind: pipeline
name: mariadb10.4-php7.4
#name: mariadb10.4-php8.0

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: mariadb10.4-php7.4
  image: nextcloudci/php7.4:php7.4-3
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb
#- name: mariadb10.4-php8.0
#  image: nextcloudci/php8.0:latest
#  commands:
#    - bash tests/drone-run-php-tests.sh || exit 0
#    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mariadb

services:
- name: cache
  image: redis
- name: mariadb
  image: mariadb:10.4
  environment:
    MYSQL_ROOT_PASSWORD: owncloud
    MYSQL_USER: oc_autotest
    MYSQL_PASSWORD: owncloud
    MYSQL_DATABASE: oc_autotest
  tmpfs:
    - /var/lib/mysql

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: mysql8.0-php7.4

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: mysql-php7.4
  image: nextcloudci/php7.4:php7.4-3
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysql

services:
- name: cache
  image: redis
- name: mysql
  image: mysql:8.0
  command: [ "--default-authentication-plugin=mysql_native_password" ]
  environment:
    MYSQL_ROOT_PASSWORD: owncloud
    MYSQL_USER: oc_autotest
    MYSQL_PASSWORD: owncloud
    MYSQL_DATABASE: oc_autotest
  tmpfs:
    - /var/lib/mysql

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: postgres9.6-php7.3

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: postgres-php7.3
  image: nextcloudci/php7.3:php7.3-5
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - sleep 10 # gives the database enough time to initialize
    - POSTGRES=9 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql

services:
- name: cache
  image: redis
- name: postgres-9
  image: postgres:9.6
  environment:
    POSTGRES_USER: oc_autotest
    POSTGRES_DB: oc_autotest_dummy
    POSTGRES_PASSWORD: owncloud
  tmpfs:
    - /var/lib/postgresql/data

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: postgres10-php7.3

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: postgres-php7.3
  image: nextcloudci/php7.3:php7.3-5
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - sleep 10 # gives the database enough time to initialize
    - POSTGRES=10 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql

services:
- name: cache
  image: redis
- name: postgres-10
  image: postgres:10
  environment:
    POSTGRES_USER: oc_autotest
    POSTGRES_DB: oc_autotest_dummy
    POSTGRES_PASSWORD: owncloud
  tmpfs:
    - /var/lib/postgresql/data

trigger:
  branch:
    - master
    - stable*
  event:
    - push

---
kind: pipeline
name: postgres11-php7.4

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: postgres-php7.4
  image: nextcloudci/php7.4:php7.4-3
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - sleep 10 # gives the database enough time to initialize
    - POSTGRES=11 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql

services:
- name: cache
  image: redis
- name: postgres-11
  image: postgres:11
  environment:
    POSTGRES_USER: oc_autotest
    POSTGRES_DB: oc_autotest_dummy
    POSTGRES_PASSWORD: owncloud
  tmpfs:
    - /var/lib/postgresql/data

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: postgres12-php7.4

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: postgres-php7.4
  image: nextcloudci/php7.4:php7.4-3
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - sleep 10 # gives the database enough time to initialize
    - POSTGRES=12 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql

services:
- name: cache
  image: redis
- name: postgres-12
  image: postgres:12
  environment:
    POSTGRES_USER: oc_autotest
    POSTGRES_DB: oc_autotest_dummy
    POSTGRES_PASSWORD: owncloud
  tmpfs:
    - /var/lib/postgresql/data

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: postgres13-php7.4

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: postgres-php7.4
  image: nextcloudci/php7.4:php7.4-3
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - sleep 10 # gives the database enough time to initialize
    - POSTGRES=13 NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh pgsql

services:
- name: cache
  image: redis
- name: postgres-13
  image: postgres:13
  environment:
    POSTGRES_USER: oc_autotest
    POSTGRES_DB: oc_autotest_dummy
    POSTGRES_PASSWORD: owncloud
  tmpfs:
    - /var/lib/postgresql/data

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push
---
kind: pipeline
name: mysqlmb4-php7.4
#name: mysqlmb4-php8.0

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: mysqlmb4-php7.4
  image: nextcloudci/php7.4:php7.4-3
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysqlmb4
#- name: mysqlmb4-php8.0
#  image: nextcloudci/php8.0:latest
#  commands:
#    - bash tests/drone-run-php-tests.sh || exit 0
#    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysqlmb4

services:
- name: cache
  image: redis
- name: mysqlmb4
  image: mysql:5.7.22
  environment:
    MYSQL_ROOT_PASSWORD: owncloud
    MYSQL_USER: oc_autotest
    MYSQL_PASSWORD: owncloud
    MYSQL_DATABASE: oc_autotest
  command: [ "--innodb_large_prefix=true", "--innodb_file_format=barracuda", "--innodb_file_per_table=true" ]
  tmpfs:
    - /var/lib/mysql

trigger:
  branch:
    - master
    - stable*
  event:
    - push

---
kind: pipeline
name: mysqlmb4-php7.3

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: mysqlmb4-php7.3
  image: nextcloudci/php7.3:php7.3-5
  commands:
    - bash tests/drone-run-php-tests.sh || exit 0
    - NOCOVERAGE=true TEST_SELECTION=DB ./autotest.sh mysqlmb4

services:
- name: cache
  image: redis
- name: mysqlmb4
  image: mysql:5.7.22
  environment:
    MYSQL_ROOT_PASSWORD: owncloud
    MYSQL_USER: oc_autotest
    MYSQL_PASSWORD: owncloud
    MYSQL_DATABASE: oc_autotest
  command: [ "--innodb_large_prefix=true", "--innodb_file_format=barracuda", "--innodb_file_per_table=true" ]
  tmpfs:
    - /var/lib/mysql

trigger:
  branch:
    - master
    - stable*
  event:
    - push

---
kind: pipeline
name: integration-capabilities_features

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-capabilities_features
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh capabilities_features/capabilities.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-federation_features

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-federation_features
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin
    - cd build/integration
    - ./run.sh federation_features/federated.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-auth

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-auth
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/auth.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-avatar

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-avatar
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/avatar.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-maintenance-mode

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-maintenance-mode
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/maintenance-mode.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-ratelimiting

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-ratelimiting
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - ./occ config:system:set redis host --value=cache
    - ./occ config:system:set redis port --value=6379 --type=integer
    - ./occ config:system:set redis timeout --value=0 --type=integer
    - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.local
    - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.distributed
    - ./occ app:enable testing
    - cd build/integration
    - ./run.sh features/ratelimiting.feature

services:
- name: cache
  image: redis

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-carddav

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-carddav
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/carddav.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-dav-v2

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-dav-v2
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/dav-v2.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-ocs-v1

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-ocs-v1
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/ocs-v1.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-checksums-v1

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-checksums-v1
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/checksums.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-external-storage

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-external-storage
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/external-storage.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-provisioning-v1

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-provisioning-v1
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/provisioning-v1.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-tags

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-tags
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/tags.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-caldav

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-caldav
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/caldav.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-comments

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-comments
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/comments.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-comments-search

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-comments-search
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/comments-search.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-favorites

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-favorites
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/favorites.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-provisioning-v2

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-provisioning-v2
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/provisioning-v2.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-webdav-related

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-webdav-related
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/webdav-related.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-sharees-features

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-sharees-features
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh sharees_features/sharees.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-sharees-v2-features

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-sharees-v2-features
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh sharees_features/sharees_provisioningapiv2.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-sharing-v1

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-sharing-v1
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh sharing_features/sharing-v1.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-sharing-v1-part2

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-sharing-v1-part2
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh sharing_features/sharing-v1-part2.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-sharing-v1-part3

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-sharing-v1-part3
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh sharing_features/sharing-v1-part3.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-sharing-v1-video-verification

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: install-talk
  image: docker:git
  commands:
    # JavaScript files are not used in integration tests so it is not needed to
    # build them.
    - git clone --depth 1 https://github.com/nextcloud/spreed apps/spreed
- name: integration-sharing-v1-video-verification
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh sharing_features/sharing-v1-video-verification.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-setup-features

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-setup-features
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - cd build/integration
    - ./run.sh setup_features/setup.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-filesdrop-features

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-filesdrop-features
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh filesdrop_features/filesdrop.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-transfer-ownership-features

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-transfer-ownership-features
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/transfer-ownership.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-ldap-features

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-ldap-features
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh ldap_features/ldap-ocs.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-ldap-openldap-features

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-ldap-openldap-features
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - ./occ config:system:set redis host --value=cache
    - ./occ config:system:set redis port --value=6379 --type=integer
    - ./occ config:system:set redis timeout --value=0 --type=integer
    - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.local
    - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.distributed
    - cd build/integration
    - ./run.sh ldap_features/ldap-openldap.feature

services:
- name: cache
  image: redis
- name: openldap
  image: nextcloudci/openldap:openldap-7
  environment:
    SLAPD_DOMAIN: nextcloud.ci
    SLAPD_ORGANIZATION: Nextcloud
    SLAPD_PASSWORD: admin
    SLAPD_ADDITIONAL_MODULES: memberof

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-ldap-openldap-uid-features

steps:
    - name: submodules
      image: docker:git
      commands:
          - git submodule update --init
    - name: integration-ldap-openldap-uid-features
      image: nextcloudci/integration-php7.3:integration-php7.3-2
      commands:
          - bash tests/drone-run-integration-tests.sh || exit 0
          - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
          - ./occ config:system:set redis host --value=cache
          - ./occ config:system:set redis port --value=6379 --type=integer
          - ./occ config:system:set redis timeout --value=0 --type=integer
          - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.local
          - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.distributed
          - cd build/integration
          - ./run.sh ldap_features/openldap-uid-username.feature

services:
    - name: cache
      image: redis
    - name: openldap
      image: nextcloudci/openldap:openldap-7
      environment:
          SLAPD_DOMAIN: nextcloud.ci
          SLAPD_ORGANIZATION: Nextcloud
          SLAPD_PASSWORD: admin
          SLAPD_ADDITIONAL_MODULES: memberof

trigger:
    branch:
        - master
        - stable*
    event:
        - pull_request
        - push
type: docker

---
kind: pipeline
name: integration-ldap-openldap-numerical-id-features

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-ldap-openldap-numerical-id-features
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - ./occ config:system:set redis host --value=cache
    - ./occ config:system:set redis port --value=6379 --type=integer
    - ./occ config:system:set redis timeout --value=0 --type=integer
    - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.local
    - ./occ config:system:set --type string --value "\\OC\\Memcache\\Redis" memcache.distributed
    - cd build/integration
    - ./run.sh ldap_features/openldap-numerical-id.feature

services:
- name: cache
  image: redis
- name: openldap
  image: nextcloudci/openldap:openldap-7
  environment:
    SLAPD_DOMAIN: nextcloud.ci
    SLAPD_ORGANIZATION: Nextcloud
    SLAPD_PASSWORD: admin
    SLAPD_ADDITIONAL_MODULES: memberof

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-trashbin

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-trashbin
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh features/trashbin.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-remote-api

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-remote-api
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh remoteapi_features/remote.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: integration-download

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: integration-download
  image: nextcloudci/integration-php7.3:integration-php7.3-2
  commands:
    - bash tests/drone-run-integration-tests.sh || exit 0
    - ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
    - cd build/integration
    - ./run.sh --tags ~@large features/download.feature

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: acceptance-access-levels

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: acceptance-access-levels
  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
  commands:
    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-access-levels --selenium-server selenium:4444 allow-git-repository-modifications features/access-levels.feature

services:
- name: selenium
  image: selenium/standalone-firefox:2.53.1-beryllium
  environment:
    # Reduce default log level for Selenium server (INFO) as it is too
    # verbose.
    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

#---
#kind: pipeline
#name: acceptance-app-comments
#
#steps:
#- name: submodules
#  image: docker:git
#  commands:
#    - git submodule update --init
#- name: acceptance-app-comments
#  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
#  commands:
#    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-app-comments --selenium-server selenium:4444 allow-git-repository-modifications features/app-comments.feature
#
#services:
#- name: selenium
#  image: selenium/standalone-firefox:2.53.1-beryllium
#  environment:
#    # Reduce default log level for Selenium server (INFO) as it is too
#    # verbose.
#    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING
#
#trigger:
#  branch:
#    - master
#    - stable*
#  event:
#    - pull_request
#    - push
#
---
kind: pipeline
name: acceptance-app-files

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: acceptance-app-files
  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
  commands:
    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-app-files --selenium-server selenium:4444 allow-git-repository-modifications features/app-files.feature

services:
- name: selenium
  image: selenium/standalone-firefox:2.53.1-beryllium
  environment:
    # Reduce default log level for Selenium server (INFO) as it is too
    # verbose.
    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: acceptance-app-files-sharing

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: acceptance-app-files-sharing
  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
  commands:
    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-app-files-sharing --selenium-server selenium:4444 allow-git-repository-modifications features/app-files-sharing.feature

services:
- name: selenium
  image: selenium/standalone-firefox:2.53.1-beryllium
  environment:
    # Reduce default log level for Selenium server (INFO) as it is too
    # verbose.
    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: acceptance-app-files-sharing-link

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: acceptance-app-files-sharing-link
  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
  commands:
    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-app-files-sharing-link --selenium-server selenium:4444 allow-git-repository-modifications features/app-files-sharing-link.feature

services:
- name: selenium
  image: selenium/standalone-firefox:2.53.1-beryllium
  environment:
    # Reduce default log level for Selenium server (INFO) as it is too
    # verbose.
    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: acceptance-app-files-tags

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: acceptance-app-files-tags
  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
  commands:
    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-app-files-tags --selenium-server selenium:4444 allow-git-repository-modifications features/app-files-tags.feature

services:
- name: selenium
  image: selenium/standalone-firefox:2.53.1-beryllium
  environment:
    # Reduce default log level for Selenium server (INFO) as it is too
    # verbose.
    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: acceptance-app-theming

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: acceptance-app-theming
  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
  commands:
    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-app-theming --selenium-server selenium:4444 allow-git-repository-modifications features/app-theming.feature

services:
- name: selenium
  image: selenium/standalone-firefox:2.53.1-beryllium
  environment:
    # Reduce default log level for Selenium server (INFO) as it is too
    # verbose.
    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: acceptance-header

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: acceptance-header
  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
  commands:
    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-header --selenium-server selenium:4444 allow-git-repository-modifications features/header.feature

services:
- name: selenium
  image: selenium/standalone-firefox:2.53.1-beryllium
  environment:
    # Reduce default log level for Selenium server (INFO) as it is too
    # verbose.
    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: acceptance-login

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: acceptance-login
  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
  commands:
    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-login --selenium-server selenium:4444 allow-git-repository-modifications features/login.feature

services:
- name: selenium
  image: selenium/standalone-firefox:2.53.1-beryllium
  environment:
    # Reduce default log level for Selenium server (INFO) as it is too
    # verbose.
    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: acceptance-users

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: acceptance-users
  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
  commands:
    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-users --selenium-server selenium:4444 allow-git-repository-modifications features/users.feature

services:
- name: selenium
  image: selenium/standalone-firefox:2.53.1-beryllium
  environment:
    # Reduce default log level for Selenium server (INFO) as it is too
    # verbose.
    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: acceptance-apps

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: acceptance-apps
  image: nextcloudci/acceptance-php7.3:acceptance-php7.3-2
  commands:
    - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-apps --selenium-server selenium:4444 allow-git-repository-modifications features/apps.feature

services:
- name: selenium
  image: selenium/standalone-firefox:2.53.1-beryllium
  environment:
    # Reduce default log level for Selenium server (INFO) as it is too
    # verbose.
    JAVA_OPTS: -Dselenium.LOGGER.level=WARNING

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: nodb-codecov

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: nodb-codecov
  image: nextcloudci/php7.4:php7.4-3
  environment:
      CODECOV_TOKEN:
          from_secret: CODECOV_TOKEN
  commands:
    - phpenmod xdebug
    - TEST_SELECTION=NODB ./autotest.sh sqlite
    - wget https://codecov.io/bash -O codecov.sh
    - bash codecov.sh -Z -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml

services:
- name: cache
  image: redis

trigger:
  branch:
    - master
    - stable*
  event:
    - push

---
kind: pipeline
name: db-codecov

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: db-codecov
  image: nextcloudci/php7.4:php7.4-3
  environment:
      CODECOV_TOKEN:
          from_secret: CODECOV_TOKEN
  commands:
    - phpenmod xdebug
    - TEST_SELECTION=QUICKDB ./autotest.sh sqlite
    - wget https://codecov.io/bash -O codecov.sh
    - bash codecov.sh -Z -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml

services:
- name: cache
  image: redis

trigger:
  branch:
    - master
    - stable*
  event:
    - push

---
kind: pipeline
name: object-store-s3

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: object-store
  image: nextcloudci/php7.4:php7.4-3
  environment:
      CODECOV_TOKEN:
          from_secret: CODECOV_TOKEN
  commands:
    - phpenmod xdebug
    - ./tests/drone-wait-objectstore.sh
    - TEST_SELECTION=PRIMARY-s3 ./autotest.sh sqlite
    - wget https://codecov.io/bash -O codecov.sh
    - bash codecov.sh -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml

services:
- name: fake-s3
  image: lphoward/fake-s3:latest

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
kind: pipeline
name: object-store-azure

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: object-store
  image: nextcloudci/php7.4:php7.4-3
  environment:
      CODECOV_TOKEN:
          from_secret: CODECOV_TOKEN
  commands:
    - phpenmod xdebug
    - ./tests/drone-wait-objectstore.sh
    - TEST_SELECTION=PRIMARY-azure ./autotest.sh sqlite
    - wget https://codecov.io/bash -O codecov.sh
    - bash codecov.sh -C $DRONE_COMMIT -f tests/autotest-clover-sqlite.xml

services:
- name: azurite
  image: arafato/azurite:latest
  environment:
    executable: blob

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

---
#kind: pipeline
#name: object-store-swift-v2
#
#clone:
#  depth: 1
#
#steps:
#- name: submodules
#  image: docker:git
#  commands:
#    - git submodule update --init
#- name: object-store
#  image: nextcloudci/php7.1:php7.1-16
#  commands:
#    - phpenmod xdebug
#    - ./tests/drone-wait-objectstore.sh
#    - TEST_SELECTION=PRIMARY-${OBJECT_STORE} ./autotest.sh sqlite
#    - wget https://codecov.io/bash -O codecov.sh
#    - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
#    - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
#
#services:
#- name: dockswift
#  image: icewind1991/dockswift:nextcloud-ci
#  environment:
#    IPADDRESS: dockswift
#
#trigger:
#  branch:
#    - master
#    - stable*
#  event:
#    - pull_request
#    - push
#
#---
#kind: pipeline
#name: object-store-swift-v3
#
#clone:
#  depth: 1
#
#steps:
#- name: submodules
#  image: docker:git
#  commands:
#    - git submodule update --init
#- name: object-store
#  image: nextcloudci/php7.1:php7.1-16
#  commands:
#    - phpenmod xdebug
#    - ./tests/drone-wait-objectstore.sh
#    - TEST_SELECTION=PRIMARY-${OBJECT_STORE} ./autotest.sh sqlite
#    - wget https://codecov.io/bash -O codecov.sh
#    - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
#    - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
#
#services:
#- name: dockswift
#  image: icewind1991/dockswift:nextcloud-ci
#  environment:
#    IPADDRESS: dockswift
#
#trigger:
#  branch:
#    - master
#    - stable*
#  event:
#    - pull_request
#    - push
#
#---
kind: pipeline
name: memcache-memcached

steps:
- name: submodules
  image: docker:git
  commands:
    - git submodule update --init
- name: memcache-memcached
  image: nextcloudci/php7.3-memcached:php7.3-memcached-3
  commands:
    - phpenmod xdebug
    - service memcached restart
    - ./autotest.sh sqlite tests/lib/Memcache/MemcachedTest.php
    - wget https://codecov.io/bash -O codecov.sh
    - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
    - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"

trigger:
  branch:
    - master
    - stable*
  event:
    - pull_request
    - push

#---
#kind: pipeline
#name: memcache-redis-cluster
#
#steps:
#- name: submodules
#  image: docker:git
#  commands:
#    - git submodule update --init
#- name: memcache-redis-cluster
#  image: nextcloudci/php7.3:php7.3-5
#  commands:
#    - phpenmod xdebug
#    - sleep 20
#    - ENABLE_REDIS_CLUSTER=true ./autotest.sh sqlite tests/lib/Memcache/RedisTest.php
#    - wget https://codecov.io/bash -O codecov.sh
#    - sh -c "if [ '$DRONE_BUILD_EVENT' = 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -P $DRONE_PULL_REQUEST -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
#    - sh -c "if [ '$DRONE_BUILD_EVENT' != 'pull_request' ]; then bash codecov.sh -B $DRONE_BRANCH -C $DRONE_COMMIT -t 117641e2-a9e8-4b7b-984b-ae872d9b05f5 -f tests/autotest-clover-sqlite.xml; fi"
#
#services:
#- name: cache-cluster
#  image: morrisjobke/redis-cluster
#
#trigger:
#  branch:
#    - master
#    - stable*
#  event:
#    - pull_request
#    - push