summaryrefslogtreecommitdiffstats
path: root/lib/autoloader.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-05-07 22:24:47 +0200
committerRobin Appelman <icewind@owncloud.com>2013-05-07 22:24:47 +0200
commitcac86bb4db670e868ae61aef176d229c814452c0 (patch)
tree45eae888e16cae893019161fe666bb608cf62e82 /lib/autoloader.php
parentd1fcb7eb5237d597a878e5f7b61693e7dee29ca8 (diff)
downloadnextcloud-server-cac86bb4db670e868ae61aef176d229c814452c0.tar.gz
nextcloud-server-cac86bb4db670e868ae61aef176d229c814452c0.zip
Allow disabling the global classpath in an autoloader
Diffstat (limited to 'lib/autoloader.php')
-rw-r--r--lib/autoloader.php22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/autoloader.php b/lib/autoloader.php
index 9547ddc7d91..94c0ac7cb5d 100644
--- a/lib/autoloader.php
+++ b/lib/autoloader.php
@@ -9,6 +9,8 @@
namespace OC;
class Autoloader {
+ private $useGlobalClassPath = true;
+
private $classPaths = array();
/**
@@ -22,6 +24,20 @@ class Autoloader {
}
/**
+ * disable the usage of the global classpath \OC::$CLASSPATH
+ */
+ public function disableGlobalClassPath() {
+ $this->useGlobalClassPath = false;
+ }
+
+ /**
+ * enable the usage of the global classpath \OC::$CLASSPATH
+ */
+ public function enableGlobalClassPath() {
+ $this->useGlobalClassPath = true;
+ }
+
+ /**
* Load the specified class
*
* @param string $class
@@ -33,15 +49,15 @@ class Autoloader {
$paths = array();
if (array_key_exists($class, $this->classPaths)) {
$paths[] = $this->classPaths[$class];
- } else if (array_key_exists($class, \OC::$CLASSPATH)) {
+ } else if ($this->useGlobalClassPath and array_key_exists($class, \OC::$CLASSPATH)) {
$paths[] = \OC::$CLASSPATH[$class];
/**
* @TODO: Remove this when necessary
* Remove "apps/" from inclusion path for smooth migration to mutli app dir
*/
- if (strpos($path, 'apps/') === 0) {
+ if (strpos(\OC::$CLASSPATH[$class], 'apps/') === 0) {
\OC_Log::write('core', 'include path for class "' . $class . '" starts with "apps/"', \OC_Log::DEBUG);
- $path = str_replace('apps/', '', $path);
+ $path = str_replace('apps/', '', \OC::$CLASSPATH[$class]);
}
} elseif (strpos($class, 'OC_') === 0) {
$paths[] = strtolower(str_replace('_', '/', substr($class, 3)) . '.php');
#fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# 
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: ownCloud\n"
"Report-Msgid-Bugs-To: http://bugs.owncloud.org/\n"
"POT-Creation-Date: 2013-07-14 02:02+0200\n"
"PO-Revision-Date: 2013-07-13 23:15+0000\n"
"Last-Translator: I Robot <owncloud-bot@tmit.eu>\n"
"Language-Team: Slovenian (http://www.transifex.com/projects/p/owncloud/language/sl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: sl\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"

#: ajax/delete.php:42
#, php-format
msgid "Couldn't delete %s permanently"
msgstr "Datoteke %s ni mogoče dokončno izbrisati."

#: ajax/undelete.php:42
#, php-format
msgid "Couldn't restore %s"
msgstr "Ni mogoče obnoviti %s"

#: js/trash.js:7 js/trash.js:97
msgid "perform restore operation"
msgstr "izvedi opravilo obnavljanja"

#: js/trash.js:19 js/trash.js:46 js/trash.js:115 js/trash.js:141
msgid "Error"
msgstr "Napaka"

#: js/trash.js:34
msgid "delete file permanently"
msgstr "dokončno izbriši datoteko"

#: js/trash.js:123
msgid "Delete permanently"
msgstr "Izbriši dokončno"

#: js/trash.js:176 templates/index.php:17
msgid "Name"
msgstr "Ime"

#: js/trash.js:177 templates/index.php:27
msgid "Deleted"
msgstr "Izbrisano"

#: js/trash.js:186
msgid "1 folder"
msgstr "1 mapa"

#: js/trash.js:188
msgid "{count} folders"
msgstr "{count} map"

#: js/trash.js:196
msgid "1 file"
msgstr "1 datoteka"

#: js/trash.js:198
msgid "{count} files"
msgstr "{count} datotek"

#: templates/index.php:9
msgid "Nothing in here. Your trash bin is empty!"
msgstr "Mapa smeti je prazna."

#: templates/index.php:20 templates/index.php:22
msgid "Restore"
msgstr "Obnovi"

#: templates/index.php:30 templates/index.php:31
msgid "Delete"
msgstr "Izbriši"

#: templates/part.breadcrumb.php:9
msgid "Deleted Files"
msgstr "Izbrisane datoteke"