diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-21 22:53:36 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-21 22:53:36 +0200 |
commit | fe030e7339f5fc9ec4e75d9655b2ced0900da5c2 (patch) | |
tree | d87fc2bc4504392550c3aea0abb18614d36f8abb /appinfo | |
parent | 8c2a1b242c1cd2f7bcb179facc524f3454e7a863 (diff) |
use composer for autoloading repos
Diffstat (limited to 'appinfo')
-rw-r--r-- | appinfo/application.php | 19 | ||||
-rw-r--r-- | appinfo/autoload.php | 31 |
2 files changed, 36 insertions, 14 deletions
diff --git a/appinfo/application.php b/appinfo/application.php index 5b76680c4..27ced3c71 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -55,20 +55,7 @@ use \OCA\News\ArticleEnhancer\XPathArticleEnhancer; use \OCA\News\ArticleEnhancer\RegexArticleEnhancer; -$thirdPartyLibs = [ - '\HTMLPurifier' => 'htmlpurifier/library/HTMLPurifier.auto.php', - '\SimplePie' => 'simplepie/autoloader.php', - '\ZendXML\Security' => 'ZendXml/vendor/autoload.php', - '\Net_URL2' => 'Net_URL2/Net/URL2.php' -]; - -// to prevent clashes with installed app framework versions -foreach ($thirdPartyLibs as $class => $path) { - if (!class_exists($class)) { - require_once __DIR__ . '/../3rdparty/' . $path; - } -} - +require_once __DIR__ . '/autoload.php'; class Application extends App { @@ -427,6 +414,10 @@ class Application extends App { /** * Fetchers */ + $container->registerService('PicoFeedConfig', function($c) { + + }); + $container->registerService('Fetcher', function($c) { $fetcher = new Fetcher(); diff --git a/appinfo/autoload.php b/appinfo/autoload.php new file mode 100644 index 000000000..81302425d --- /dev/null +++ b/appinfo/autoload.php @@ -0,0 +1,31 @@ +<?php +/** + * ownCloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Alessandro Cosentino <cosenal@gmail.com> + * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @copyright Alessandro Cosentino 2012 + * @copyright Bernhard Posselt 2012, 2014 + */ + +/** + * Register all needed autoloaders + */ + +// composer libs +require_once __DIR__ . '/../3rdparty/autoload.php'; + +// non composer libs +$thirdPartyLibs = [ + '\SimplePie' => 'simplepie/autoloader.php', + '\ZendXML\Security' => 'ZendXml/vendor/autoload.php', +]; + +foreach ($thirdPartyLibs as $class => $path) { + if (!class_exists($class)) { + require_once __DIR__ . '/../3rdparty/' . $path; + } +} |