From f2782e19870911ad2b65f1dffae49897c481bf8f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 3 Apr 2017 14:05:51 +0200 Subject: rewrite autoloaders --- nextcloud-fedora-autoloader.php | 119 ++++++++++++++++++++-------------------- nextcloud.spec | 40 ++++++++++---- 2 files changed, 86 insertions(+), 73 deletions(-) diff --git a/nextcloud-fedora-autoloader.php b/nextcloud-fedora-autoloader.php index 84f8c1b..a70713d 100644 --- a/nextcloud-fedora-autoloader.php +++ b/nextcloud-fedora-autoloader.php @@ -1,68 +1,65 @@ register(); -} +require_once $vendor . '/Fedora/Autoloader/autoload.php'; // For PEAR components -$fedoraClassLoader->setUseIncludePath(true); +\Fedora\Autoloader\Autoload::addIncludePath(); // Dependencies from 3rdparty composer.json -// "guzzlehttp/guzzle" -require_once $vendor . '/GuzzleHttp/autoload.php'; -// "sabre/dav" -require_once $vendor . '/Sabre/DAV/autoload.php'; -// "doctrine/dbal" -require_once $vendor . '/Doctrine/DBAL/autoload.php'; -// mcnetic/zipstreamer" -require_once $vendor . '/ZipStreamer/autoload.php'; -// "phpeclib/phpseclib" -require_once $vendor . '/phpseclib/autoload.php'; -// "rackspace/php-opencloud" -require_once $vendor . '/OpenCloud/autoload.php'; -// "jeremeamia/superclosure" -require_once $vendor . '/SuperClosure/autoload.php'; -// "bantu/ini-get-wrapper" -require_once $vendor . '/bantu/IniGetWrapper/IniGetWrapper.php'; -// "natxet/CssMin" -require_once $vendor . '/natxet/CssMin/autoload.php'; -// "punic/punic" -require_once $vendor . '/Punic/autoload.php'; -// "patchwork/utf8" -require_once $vendor . '/Patchwork/autoload.php'; -// "symfony/console" -require_once $vendor . '/Symfony/Component/Console/autoload.php'; -// "symfony/event-dispatcher" -require_once $vendor . '/Symfony/Component/EventDispatcher/autoload.php'; -// "symfony/routing" -require_once $vendor . '/Symfony/Component/Routing/autoload.php'; -// "symfony/process" -require_once $vendor . '/Symfony/Component/Process/autoload.php'; -// "pimple/pimple" -require_once $vendor . '/Pimple/autoload.php'; -// "ircmaxell/password-compat" -require_once $vendor . '/password_compat/password.php'; -// "nikic/php-parser" -require_once $vendor . '/PhpParser/autoload.php'; -// "icewind/Streams" -require_once $vendor . '/Icewind/Streams/autoload.php'; -// "swiftmailer/swiftmailer -require_once $vendor . '/Swift/swift_required.php'; -// "league/flysystem" -require_once $vendor . '/League/Flysystem/autoload.php'; -// "interfasys/lognormalizer" -require_once $vendor . '/InterfaSys/LogNormalizer/autoload.php'; -// "deepdiver1975/TarSTreamer" -require_once $vendor . '/ownCloud/TarStreamer/autoload.php'; -// "patchwork/jsqueeze" -require_once $vendor . '/Patchwork/JSqueeze.php'; -// "symfony/polyfill-php{55,56,70}" -require_once $vendor . '/Symfony/Polyfill/autoload.php'; -// "lukasreschke/id3parser": "^0.0.1" -require_once $vendor . '/ID3Parser/autoload.php'; +\Fedora\Autoloader\Dependencies::required(array( + // "guzzlehttp/guzzle" + $vendor . '/GuzzleHttp/autoload.php', + // To avoid having Aws 3 loaded + $vendor . '/Aws/autoload.php', + // "sabre/dav" + $vendor . '/Sabre/DAV/autoload.php', + // "doctrine/dbal" + $vendor . '/Doctrine/DBAL/autoload.php', + // mcnetic/zipstreamer" + $vendor . '/ZipStreamer/autoload.php', + // "phpeclib/phpseclib" + $vendor . '/phpseclib/autoload.php', + // "rackspace/php-opencloud" + $vendor . '/OpenCloud/autoload.php', + // "jeremeamia/superclosure" + $vendor . '/SuperClosure/autoload.php', + // "bantu/ini-get-wrapper" + $vendor . '/bantu/IniGetWrapper/IniGetWrapper.php', + // "natxet/CssMin" + $vendor . '/natxet/CssMin/autoload.php', + // "punic/punic" + $vendor . '/Punic/autoload.php', + // "patchwork/utf8" + $vendor . '/Patchwork/autoload.php', + // "symfony/console" + $vendor . '/Symfony/Component/Console/autoload.php', + // "symfony/event-dispatcher" + $vendor . '/Symfony/Component/EventDispatcher/autoload.php', + // "symfony/routing" + $vendor . '/Symfony/Component/Routing/autoload.php', + // "symfony/process" + $vendor . '/Symfony/Component/Process/autoload.php', + // "pimple/pimple" + $vendor . '/Pimple/autoload.php', + // "ircmaxell/password-compat" + $vendor . '/password_compat/password.php', + // "nikic/php-parser" + $vendor . '/PhpParser/autoload.php', + // "icewind/Streams" + $vendor . '/Icewind/Streams/autoload.php', + // "swiftmailer/swiftmailer + $vendor . '/Swift/swift_required.php', + // "league/flysystem" + $vendor . '/League/Flysystem/autoload.php', + // "interfasys/lognormalizer" + $vendor . '/InterfaSys/LogNormalizer/autoload.php', + // "deepdiver1975/TarSTreamer" + $vendor . '/ownCloud/TarStreamer/autoload.php', + // "patchwork/jsqueeze" + $vendor . '/Patchwork/JSqueeze.php', + // "symfony/polyfill-php{55,56,70}" + $vendor . '/Symfony/Polyfill/autoload.php', + // "lukasreschke/id3parser": "^0.0.1" + $vendor . '/ID3Parser/autoload.php', +)); diff --git a/nextcloud.spec b/nextcloud.spec index 46ad3dd..562d565 100644 --- a/nextcloud.spec +++ b/nextcloud.spec @@ -16,7 +16,7 @@ Name: nextcloud Version: 10.0.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Private file sync and share server Group: Applications/Internet @@ -91,6 +91,8 @@ Requires: crontabs # expand pear macros on install BuildRequires: php-pear +# Use by our autoloader +BuildRequires: php-composer(fedora/autoloader) >= 1.0.0 # For sanity %%check BuildRequires: php-cli BuildRequires: php-composer(sabre/dav) >= 3.0.9 @@ -170,6 +172,8 @@ BuildRequires: php-composer(onelogin/php-saml) < 3.0 Requires: %{name}-webserver = %{version}-%{release} Requires: %{name}-database = %{version}-%{release} +# Use by our autoloader +Requires: php-composer(fedora/autoloader) >= 1.0.0 # Core PHP libs/extensions required by OC core Requires: php-curl Requires: php-dom @@ -592,15 +596,17 @@ rm -r apps/files_external/3rdparty/{icewind,Dropbox,google-api-php-client,aws-sd # include stuff required directly but not in composer too cat << 'EOF' | tee apps/files_external/3rdparty/autoload.php - 10.0.4-3 +- ensure aws/php-sdk v2 loaded before v3 +- rewrite autoloader using fedora/autoloader + * Mon Apr 3 2017 Remi Collet remi@remirepo.net> - 10.0.4-2 - back to remi's repository -- cgit