From 2f807a3c7f6e5a3a8a8e8317a3b3b627d3d68952 Mon Sep 17 00:00:00 2001
From: Jakob Sack <kde@jakobsack.de>
Date: Wed, 27 Jul 2011 19:25:49 +0200
Subject: [PATCH] Delete requires in applications where possible

---
 admin/apps.php                   | 2 --
 admin/system.php                 | 1 -
 admin/users.php                  | 1 -
 apps/files_publiclink/admin.php  | 1 -
 apps/files_publiclink/get.php    | 1 -
 apps/media/index.php             | 1 -
 apps/media/settings.php          | 1 -
 apps/user_ldap/settings.php      | 1 -
 apps/user_ldap/user_ldap.php     | 2 --
 apps/user_openid/phpmyid.php     | 3 ---
 apps/user_openid/settings.php    | 1 -
 apps/user_openid/user_openid.php | 1 -
 core/templates/404.php           | 1 -
 docs/skeleton/admin.php          | 3 ---
 docs/skeleton/index.php          | 1 -
 files/admin.php                  | 1 -
 files/ajax/list.php              | 1 -
 files/download.php               | 1 -
 files/index.php                  | 1 -
 files/settings.php               | 1 -
 files/webdav.php                 | 5 -----
 help/index.php                   | 1 -
 index.php                        | 4 +---
 log/index.php                    | 1 -
 search/index.php                 | 1 -
 settings/index.php               | 1 -
 tests/index.php                  | 2 --
 27 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/admin/apps.php b/admin/apps.php
index bc598a6991..4bbf1c813b 100644
--- a/admin/apps.php
+++ b/admin/apps.php
@@ -22,8 +22,6 @@
 */
 
 require_once('../lib/base.php');
-include_once('../lib/installer.php');
-require( 'template.php' );
 if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
 	header( "Location: ".OC_HELPER::linkTo( "", "index.php" ));
 	exit();
diff --git a/admin/system.php b/admin/system.php
index 284509144e..9286ab9c2b 100644
--- a/admin/system.php
+++ b/admin/system.php
@@ -22,7 +22,6 @@
 */
 
 require_once('../lib/base.php');
-require( 'template.php' );
 if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
 	header( "Location: ".OC_HELPER::linkTo( "index.php" ));
 	exit();
diff --git a/admin/users.php b/admin/users.php
index 8237d06da0..4065cc471f 100644
--- a/admin/users.php
+++ b/admin/users.php
@@ -22,7 +22,6 @@
 */
 
 require_once('../lib/base.php');
-require( 'template.php' );
 if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
 	header( "Location: ".OC_HELPER::linkTo( "index.php" ));
 	exit();
diff --git a/apps/files_publiclink/admin.php b/apps/files_publiclink/admin.php
index afb726da31..9a1a9ce03c 100644
--- a/apps/files_publiclink/admin.php
+++ b/apps/files_publiclink/admin.php
@@ -25,7 +25,6 @@
 // Init owncloud
 require_once('../../lib/base.php');
 require_once( 'lib_public.php' );
-require( 'template.php' );
 
 
 // Check if we are a user
diff --git a/apps/files_publiclink/get.php b/apps/files_publiclink/get.php
index d3e3022e76..3bc961bc37 100644
--- a/apps/files_publiclink/get.php
+++ b/apps/files_publiclink/get.php
@@ -3,7 +3,6 @@ $RUNTIME_NOAPPS=true; //no need to load the apps
 $RUNTIME_NOSETUPFS=true; //don't setup the fs yet
 
 require_once '../../lib/base.php';
-require( 'template.php' );
 
 require_once 'lib_public.php';
 
diff --git a/apps/media/index.php b/apps/media/index.php
index 26e008acab..fbf1c395d9 100644
--- a/apps/media/index.php
+++ b/apps/media/index.php
@@ -32,7 +32,6 @@ if( !OC_USER::isLoggedIn()){
 
 require_once('lib_collection.php');
 require_once('lib_scanner.php');
-require_once('template.php');
 
 OC_UTIL::addScript('media','player');
 OC_UTIL::addScript('media','music');
diff --git a/apps/media/settings.php b/apps/media/settings.php
index 30276601a2..4bd9acfd80 100644
--- a/apps/media/settings.php
+++ b/apps/media/settings.php
@@ -29,7 +29,6 @@ if( !OC_USER::isLoggedIn()){
 	exit();
 }
 
-require( 'template.php' );
 require( 'lib_collection.php' );
 
 OC_UTIL::addStyle('media','style');
diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php
index f7aff1b461..8f9d282d2b 100644
--- a/apps/user_ldap/settings.php
+++ b/apps/user_ldap/settings.php
@@ -22,7 +22,6 @@
  */
 
 require_once('../../lib/base.php');
-require( 'template.php' );
 
 if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
 	header( "Location: ".OC_HELPER::linkTo( "index.php" ));
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index a2fd48cdf0..a197c0a10e 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -21,8 +21,6 @@
  *
  */
 
-require_once('User/backend.php');
-
 class OC_USER_LDAP extends OC_USER_BACKEND {
 
 	protected $ds;
diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php
index 146eb380f7..f35e6811b8 100644
--- a/apps/user_openid/phpmyid.php
+++ b/apps/user_openid/phpmyid.php
@@ -12,9 +12,6 @@
  * @version 0.9
  */
 
-require( 'template.php' );
-
-
 /**
  * Set a constant to indicate that phpMyID is running
  */
diff --git a/apps/user_openid/settings.php b/apps/user_openid/settings.php
index 76316de100..29c18eaa49 100644
--- a/apps/user_openid/settings.php
+++ b/apps/user_openid/settings.php
@@ -1,7 +1,6 @@
 <?php
 
 require_once('../../lib/base.php');
-require( 'template.php' );
 if( !OC_USER::isLoggedIn()){
     header( "Location: ".OC_HELPER::linkTo( "index.php" ));
     exit();
diff --git a/apps/user_openid/user_openid.php b/apps/user_openid/user_openid.php
index ddf5cc9bc2..c18edccf2d 100644
--- a/apps/user_openid/user_openid.php
+++ b/apps/user_openid/user_openid.php
@@ -21,7 +21,6 @@
  *
  */
 
-require_once('User/backend.php');
 require_once('class.openid.v3.php');
 
 /**
diff --git a/core/templates/404.php b/core/templates/404.php
index b78828e630..65cfaec3b7 100644
--- a/core/templates/404.php
+++ b/core/templates/404.php
@@ -1,7 +1,6 @@
 <?php
 if(!isset($_)){//also provide standalone error page
 	require_once '../../lib/base.php';
-	require( 'template.php' );
 	
 	$tmpl = new OC_TEMPLATE( '', '404', 'guest' );
 	$tmpl->printPage();
diff --git a/docs/skeleton/admin.php b/docs/skeleton/admin.php
index aaf6136692..723c7f7612 100644
--- a/docs/skeleton/admin.php
+++ b/docs/skeleton/admin.php
@@ -31,9 +31,6 @@ require_once('../lib/base.php');
 // We need the file system although we said do not load it! Do it by hand now
 OC_UTIL::setupFS();
 
-// We load OC_TEMPLATE, too. This one is not loaded by base
-require( 'template.php' );
-
 // The user should have admin rights. This is an admin page!
 if( !OC_USER::isLoggedIn() || !OC_USER::ingroup( $_SESSION['username'], 'admin' )){
 	// Bad boy! Go to the very first page of owncloud
diff --git a/docs/skeleton/index.php b/docs/skeleton/index.php
index 6d237ed615..5402990e4c 100644
--- a/docs/skeleton/index.php
+++ b/docs/skeleton/index.php
@@ -24,7 +24,6 @@
 
 // Init owncloud
 require_once('../lib/base.php');
-require( 'template.php' );
 
 // Check if we are a user
 if( !OC_USER::isLoggedIn()){
diff --git a/files/admin.php b/files/admin.php
index 5c9923aff8..c0a41335f5 100644
--- a/files/admin.php
+++ b/files/admin.php
@@ -24,7 +24,6 @@
 
 // Init owncloud
 require_once('../lib/base.php');
-require( 'template.php' );
 
 
 // Check if we are a user
diff --git a/files/ajax/list.php b/files/ajax/list.php
index ef43e72fca..26462eb5ab 100644
--- a/files/ajax/list.php
+++ b/files/ajax/list.php
@@ -2,7 +2,6 @@
 
 // Init owncloud
 require_once('../../lib/base.php');
-require_once('../../lib/template.php');
 
 // We send json data
 header( "Content-Type: application/jsonrequest" );
diff --git a/files/download.php b/files/download.php
index f7fbcd0f85..ab3dee5134 100644
--- a/files/download.php
+++ b/files/download.php
@@ -23,7 +23,6 @@
 
 // Init owncloud
 require_once('../lib/base.php');
-require( 'template.php' );
 
 // Check if we are a user
 if( !OC_USER::isLoggedIn()){
diff --git a/files/index.php b/files/index.php
index 550f23541a..4f40e70393 100644
--- a/files/index.php
+++ b/files/index.php
@@ -24,7 +24,6 @@
 
 // Init owncloud
 require_once('../lib/base.php');
-require( 'template.php' );
 
 // Check if we are a user
 if( !OC_USER::isLoggedIn()){
diff --git a/files/settings.php b/files/settings.php
index 23aed4d1b8..447a38b181 100644
--- a/files/settings.php
+++ b/files/settings.php
@@ -24,7 +24,6 @@
 
 // Init owncloud
 require_once('../lib/base.php');
-require( 'template.php' );
 
 // Check if we are a user
 if( !OC_USER::isLoggedIn()){
diff --git a/files/webdav.php b/files/webdav.php
index 7dce0b4819..a59dee70c2 100644
--- a/files/webdav.php
+++ b/files/webdav.php
@@ -28,11 +28,6 @@ $RUNTIME_NOSETUPFS = true;
 
 require_once('../lib/base.php');
 require_once('Sabre/autoload.php');
-require_once('Connector/Sabre/auth.php');
-require_once('Connector/Sabre/node.php');
-require_once('Connector/Sabre/file.php');
-require_once('Connector/Sabre/directory.php');
-require_once('Connector/Sabre/locks.php');
 
 // Create ownCloud Dir
 $publicDir = new OC_Connector_Sabre_Directory('');
diff --git a/help/index.php b/help/index.php
index de461c2941..adcb47f08f 100644
--- a/help/index.php
+++ b/help/index.php
@@ -1,7 +1,6 @@
 <?php
 
 require_once('../lib/base.php');
-require( 'template.php' );
 if( !OC_USER::isLoggedIn()){
     header( "Location: ".OC_HELPER::linkTo( "index.php" ));
     exit();
diff --git a/index.php b/index.php
index dfd7549270..6e580a508c 100644
--- a/index.php
+++ b/index.php
@@ -23,9 +23,7 @@
 
 $RUNTIME_NOAPPS = TRUE; //no apps, yet
 
-require_once(dirname(__FILE__).'/lib/base.php');
-require_once('appconfig.php');
-require_once('template.php');
+require_once('lib/base.php');
 
 OC_UTIL::addScript('setup');
 
diff --git a/log/index.php b/log/index.php
index 4986526e00..096180347e 100644
--- a/log/index.php
+++ b/log/index.php
@@ -23,7 +23,6 @@
 
 //require_once('../../config/config.php');
 require_once('../lib/base.php');
-require_once( 'template.php' );
 
 if( !OC_USER::isLoggedIn()){
 	header( 'Location: '.OC_HELPER::linkTo( 'index.php' ));
diff --git a/search/index.php b/search/index.php
index b348b22387..b9aca57cde 100644
--- a/search/index.php
+++ b/search/index.php
@@ -24,7 +24,6 @@
 
 // Init owncloud
 require_once('../lib/base.php');
-require( 'template.php' );
 
 // Check if we are a user
 if( !OC_USER::isLoggedIn()){
diff --git a/settings/index.php b/settings/index.php
index 07adba142d..17c878b1a2 100644
--- a/settings/index.php
+++ b/settings/index.php
@@ -1,7 +1,6 @@
 <?php
 
 require_once('../lib/base.php');
-require( 'template.php' );
 if( !OC_USER::isLoggedIn()){
     header( "Location: ".OC_HELPER::linkTo( "index.php" ));
     exit();
diff --git a/tests/index.php b/tests/index.php
index 30ebde1123..3d410cd433 100644
--- a/tests/index.php
+++ b/tests/index.php
@@ -26,8 +26,6 @@
  */
  $RUNTIME_NOSETUPFS=true;
 require_once('../lib/base.php');
-require_once('testcase.php');
-require_once('template.php');
 
 $testCases=loadFiles(__DIR__,array('index.php','templates'));
 ob_end_clean();
-- 
GitLab