From 24b3cb1ac0784ffa2acabf021fdd06c6d49cc7b1 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 1 Feb 2010 16:20:40 +0100 Subject: removed require's in lib/exe/* --- lib/exe/ajax.php | 23 +---------------------- lib/exe/css.php | 4 ---- lib/exe/detail.php | 7 ------- lib/exe/fetch.php | 10 ++-------- lib/exe/indexer.php | 8 -------- lib/exe/js.php | 5 ----- lib/exe/mediamanager.php | 7 ------- lib/exe/xmlrpc.php | 23 ----------------------- 8 files changed, 3 insertions(+), 84 deletions(-) (limited to 'lib/exe') diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index 4618abd71..22de2f0f0 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -13,10 +13,7 @@ if(!count($_POST) && $HTTP_RAW_POST_DATA){ if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../'); require_once(DOKU_INC.'inc/init.php'); -require_once(DOKU_INC.'inc/common.php'); -require_once(DOKU_INC.'inc/pageutils.php'); -require_once(DOKU_INC.'inc/auth.php'); -//close sesseion +//close session session_write_close(); header('Content-Type: text/html; charset=utf-8'); @@ -57,9 +54,6 @@ function ajax_qsearch(){ if(empty($query)) $query = cleanID($_GET['q']); if(empty($query)) return; - require_once(DOKU_INC.'inc/html.php'); - require_once(DOKU_INC.'inc/fulltext.php'); - $data = array(); $data = ft_pageLookup($query); @@ -95,10 +89,6 @@ function ajax_suggestions() { if(empty($query)) $query = cleanID($_GET['q']); if(empty($query)) return; - require_once(DOKU_INC.'inc/html.php'); - require_once(DOKU_INC.'inc/fulltext.php'); - require_once(DOKU_INC.'inc/JSON.php'); - $data = array(); $data = ft_pageLookup($query); if(!count($data)) return; @@ -181,8 +171,6 @@ function ajax_draftdel(){ */ function ajax_medians(){ global $conf; - require_once(DOKU_INC.'inc/search.php'); - require_once(DOKU_INC.'inc/media.php'); // wanted namespace $ns = cleanID($_POST['ns']); @@ -208,8 +196,6 @@ function ajax_medians(){ function ajax_medialist(){ global $conf; global $NS; - require_once(DOKU_INC.'inc/media.php'); - require_once(DOKU_INC.'inc/template.php'); $NS = $_POST['ns']; tpl_mediaContent(true); @@ -222,7 +208,6 @@ function ajax_medialist(){ */ function ajax_mediasearchlist(){ global $conf; - require_once(DOKU_INC.'inc/media.php'); media_searchlist($_POST['ns']); } @@ -234,8 +219,6 @@ function ajax_mediasearchlist(){ */ function ajax_index(){ global $conf; - require_once(DOKU_INC.'inc/search.php'); - require_once(DOKU_INC.'inc/html.php'); // wanted namespace $ns = cleanID($_POST['idx']); @@ -263,7 +246,6 @@ function ajax_index(){ function ajax_linkwiz(){ global $conf; global $lang; - require_once(DOKU_INC.'inc/html.php'); $q = ltrim($_POST['q'],':'); $id = noNS($q); @@ -279,8 +261,6 @@ function ajax_linkwiz(){ if($q && !$ns){ // use index to lookup matching pages - require_once(DOKU_INC.'inc/fulltext.php'); - require_once(DOKU_INC.'inc/parserutils.php'); $pages = array(); $pages = ft_pageLookup($id,false); @@ -312,7 +292,6 @@ function ajax_linkwiz(){ }else{ - require_once(DOKU_INC.'inc/search.php'); $opts = array( 'depth' => 1, 'listfiles' => true, diff --git a/lib/exe/css.php b/lib/exe/css.php index cb689d015..38017af9d 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -10,10 +10,6 @@ if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../'); if(!defined('NOSESSION')) define('NOSESSION',true); // we do not use a session or authentication here (better caching) if(!defined('DOKU_DISABLE_GZIP_OUTPUT')) define('DOKU_DISABLE_GZIP_OUTPUT',1); // we gzip ourself here require_once(DOKU_INC.'inc/init.php'); -require_once(DOKU_INC.'inc/pageutils.php'); -require_once(DOKU_INC.'inc/httputils.php'); -require_once(DOKU_INC.'inc/io.php'); -require_once(DOKU_INC.'inc/confutils.php'); // Main (don't run when UNIT test) if(!defined('SIMPLE_TEST')){ diff --git a/lib/exe/detail.php b/lib/exe/detail.php index f30e039d4..3a04b7b09 100644 --- a/lib/exe/detail.php +++ b/lib/exe/detail.php @@ -2,13 +2,6 @@ if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../'); define('DOKU_MEDIADETAIL',1); require_once(DOKU_INC.'inc/init.php'); - require_once(DOKU_INC.'inc/common.php'); - require_once(DOKU_INC.'inc/lang/en/lang.php'); - require_once(DOKU_INC.'inc/lang/'.$conf['lang'].'/lang.php'); - require_once(DOKU_INC.'inc/JpegMeta.php'); - require_once(DOKU_INC.'inc/html.php'); - require_once(DOKU_INC.'inc/template.php'); - require_once(DOKU_INC.'inc/auth.php'); //close session session_write_close(); diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php index 11877ef36..78de3188b 100644 --- a/lib/exe/fetch.php +++ b/lib/exe/fetch.php @@ -9,14 +9,8 @@ if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../'); define('DOKU_DISABLE_GZIP_OUTPUT', 1); require_once(DOKU_INC.'inc/init.php'); - require_once(DOKU_INC.'inc/common.php'); - require_once(DOKU_INC.'inc/media.php'); - require_once(DOKU_INC.'inc/pageutils.php'); - require_once(DOKU_INC.'inc/httputils.php'); - require_once(DOKU_INC.'inc/confutils.php'); - require_once(DOKU_INC.'inc/auth.php'); - - //close sesseion + + //close session session_write_close(); $mimetypes = getMimeTypes(); diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 84eb9d482..828834c86 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -8,8 +8,6 @@ if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../'); define('DOKU_DISABLE_GZIP_OUTPUT',1); require_once(DOKU_INC.'inc/init.php'); -require_once(DOKU_INC.'inc/auth.php'); -require_once(DOKU_INC.'inc/events.php'); session_write_close(); //close session if(!defined('NL')) define('NL',"\n"); @@ -177,8 +175,6 @@ function runIndexer(){ } if($conf['dperm']) chmod($lock, $conf['dperm']); - require_once(DOKU_INC.'inc/indexer.php'); - // upgrade to version 2 if (!@file_exists($conf['indexdir'].'/pageword.idx')) idx_upgradePageWords(); @@ -211,11 +207,8 @@ function metaUpdate(){ if (@file_exists($file)) return false; if (!@file_exists(wikiFN($ID))) return false; - require_once(DOKU_INC.'inc/common.php'); - require_once(DOKU_INC.'inc/parserutils.php'); global $conf; - // gather some additional info from changelog $info = io_grep($conf['changelog'], '/^(\d+)\t(\d+\.\d+\.\d+\.\d+)\t'.preg_quote($ID,'/').'\t([^\t]+)\t([^\t\n]+)/', @@ -348,7 +341,6 @@ function sendDigest() { if (!$conf['subscribers']) { return; } - require_once DOKU_INC . 'inc/subscription.php'; $subscriptions = subscription_find($ID, array('style' => '(digest|list)', 'escaped' => true)); global $auth; diff --git a/lib/exe/js.php b/lib/exe/js.php index 8648bf18f..044342187 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -11,10 +11,6 @@ if(!defined('NOSESSION')) define('NOSESSION',true); // we do not use a session o if(!defined('NL')) define('NL',"\n"); if(!defined('DOKU_DISABLE_GZIP_OUTPUT')) define('DOKU_DISABLE_GZIP_OUTPUT',1); // we gzip ourself here require_once(DOKU_INC.'inc/init.php'); -require_once(DOKU_INC.'inc/pageutils.php'); -require_once(DOKU_INC.'inc/httputils.php'); -require_once(DOKU_INC.'inc/io.php'); -require_once(DOKU_INC.'inc/JSON.php'); // Main (don't run when UNIT test) if(!defined('SIMPLE_TEST')){ @@ -96,7 +92,6 @@ function js_out(){ echo 'LANG = '.$json->encode($lang['js']).";\n"; // load toolbar - require_once(DOKU_INC.'inc/toolbar.php'); toolbar_JSdefines('toolbar'); // load files diff --git a/lib/exe/mediamanager.php b/lib/exe/mediamanager.php index f6e91b858..1fe363985 100644 --- a/lib/exe/mediamanager.php +++ b/lib/exe/mediamanager.php @@ -6,13 +6,6 @@ @ini_set('session.use_only_cookies',0); require_once(DOKU_INC.'inc/init.php'); - require_once(DOKU_INC.'inc/lang/en/lang.php'); - require_once(DOKU_INC.'inc/lang/'.$conf['lang'].'/lang.php'); - require_once(DOKU_INC.'inc/media.php'); - require_once(DOKU_INC.'inc/common.php'); - require_once(DOKU_INC.'inc/search.php'); - require_once(DOKU_INC.'inc/template.php'); - require_once(DOKU_INC.'inc/auth.php'); trigger_event('MEDIAMANAGER_STARTED',$tmp=array()); session_write_close(); //close session diff --git a/lib/exe/xmlrpc.php b/lib/exe/xmlrpc.php index d3913482f..fb6b79cf3 100644 --- a/lib/exe/xmlrpc.php +++ b/lib/exe/xmlrpc.php @@ -10,15 +10,10 @@ if(isset($HTTP_RAW_POST_DATA)) $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA); define('DOKU_XMLRPC_API_VERSION',2); require_once(DOKU_INC.'inc/init.php'); -require_once(DOKU_INC.'inc/common.php'); -require_once(DOKU_INC.'inc/auth.php'); session_write_close(); //close session if(!$conf['xmlrpc']) die('XML-RPC server not enabled.'); -require_once(DOKU_INC.'inc/IXR_Library.php'); - - /** * Contains needed wrapper functions and registers all available * XMLRPC functions. @@ -378,7 +373,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { $ns = cleanID($ns); $dir = utf8_encodeFN(str_replace(':', '/', $ns)); $data = array(); - require_once(DOKU_INC.'inc/search.php'); $opts['skipacl'] = 0; // no ACL skipping for XMLRPC search($data, $conf['datadir'], 'search_allpages', $opts, $dir); return $data; @@ -407,7 +401,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { $dir = utf8_encodeFN(str_replace(':', '/', $ns)); $data = array(); - require_once(DOKU_INC.'inc/search.php'); search($data, $conf['mediadir'], 'search_media', $options, $dir); $len = count($data); if(!$len) return array(); @@ -426,7 +419,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { * Return a list of backlinks */ function listBackLinks($id){ - require_once(DOKU_INC.'inc/fulltext.php'); return ft_backlinks($id); } @@ -519,8 +511,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { } if($conf['dperm']) chmod($lock, $conf['dperm']); - require_once(DOKU_INC.'inc/indexer.php'); - // do the work idx_addPage($id); @@ -572,7 +562,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { return new IXR_ERROR(1, $lang['uploadexist'].'1'); } // check for valid content - @require_once(DOKU_INC.'inc/media.php'); $ok = media_contentcheck($ftmp, $imime); if($ok == -1) { return new IXR_ERROR(1, sprintf($lang['uploadexist'].'2', ".$iext")); @@ -590,7 +579,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { $data[4] = $overwrite; // trigger event - require_once(DOKU_INC.'inc/events.php'); return trigger_event('MEDIA_UPLOAD_FINISH', $data, array($this, '_media_upload_action'), true); } else { @@ -615,14 +603,12 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { // check for references if needed $mediareferences = array(); if($conf['refcheck']){ - require_once(DOKU_INC.'inc/fulltext.php'); $mediareferences = ft_mediause($id,$conf['refshow']); } if(!count($mediareferences)){ $file = mediaFN($id); if(@unlink($file)){ - require_once(DOKU_INC.'inc/changelog.php'); addMediaLogEntry(time(), $id, DOKU_CHANGE_TYPE_DELETE); io_sweepNS($id,'mediadir'); return 0; @@ -648,7 +634,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { chmod($data[1], $conf['fmode']); media_notify($data[2], $data[1], $data[3]); // add a log entry to the media changelog - require_once(DOKU_INC.'inc/changelog.php'); if ($data[4]) { addMediaLogEntry(time(), $data[2], DOKU_CHANGE_TYPE_EDIT); } else { @@ -728,9 +713,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { if(strlen($timestamp) != 10) return new IXR_Error(20, 'The provided value is not a valid timestamp'); - require_once(DOKU_INC.'inc/changelog.php'); - require_once(DOKU_INC.'inc/pageutils.php'); - $recents = getRecentsSince($timestamp); $changes = array(); @@ -764,9 +746,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { if(strlen($timestamp) != 10) return new IXR_Error(20, 'The provided value is not a valid timestamp'); - require_once(DOKU_INC.'inc/changelog.php'); - require_once(DOKU_INC.'inc/pageutils.php'); - $recents = getRecentsSince($timestamp, null, '', RECENTS_MEDIA_CHANGES); $changes = array(); @@ -803,8 +782,6 @@ class dokuwiki_xmlrpc_server extends IXR_IntrospectionServer { if(empty($id)) return new IXR_Error(1, 'Empty page ID'); - require_once(DOKU_INC.'inc/changelog.php'); - $revisions = getRevisions($id, $first, $conf['recent']+1); if(count($revisions)==0 && $first!=0) { -- cgit v1.2.3