aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/files/factory.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/files/factory.php')
-rw-r--r--phpBB/phpbb/files/factory.php27
1 files changed, 3 insertions, 24 deletions
diff --git a/phpBB/phpbb/files/factory.php b/phpBB/phpbb/files/factory.php
index 9385ad678e..508c50c6ce 100644
--- a/phpBB/phpbb/files/factory.php
+++ b/phpBB/phpbb/files/factory.php
@@ -35,13 +35,15 @@ class factory
*
* @param string $name Service name
*
- * @return object|false Requested service or false if service could not be
+ * @return object|bool Requested service or false if service could not be
* found by the container
*/
public function get($name)
{
$service = false;
+ $name = (strpos($name, 'files.') === false) ? 'files.' . $name : $name;
+
try
{
$service = $this->container->get($name);
@@ -53,27 +55,4 @@ class factory
return $service;
}
-
- /**
- * Magic function for handling get calls, e.g. get_fileupload() or
- * get_filespec() and turning them into call for files. services like
- * files.fileupload.
- *
- * @param string $name Name of called function
- * @param mixed $arguments Possible supplied arguments
- *
- * @return object|false Requested service or false if service could not be
- * found by the container
- */
- public function __call($name, $arguments)
- {
- if (substr($name, 0, 4) === 'get_')
- {
- return $this->get('files.' . substr($name, 4));
- }
- else
- {
- return false;
- }
- }
}