Site vitrine pour donner de lumière aux petits artisans
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

101777 lines
2.1 MiB

#!/usr/bin/env php
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view
* the license that is located at the bottom of this file.
*/
// Avoid APC causing random fatal errors per https://github.com/composer/composer/issues/264
if (extension_loaded('apc') && filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN) && filter_var(ini_get('apc.cache_by_default'), FILTER_VALIDATE_BOOLEAN)) {
if (version_compare(phpversion('apc'), '3.0.12', '>=')) {
ini_set('apc.cache_by_default', 0);
} else {
fwrite(STDERR, 'Warning: APC <= 3.0.12 may cause fatal errors when running composer commands.'.PHP_EOL);
fwrite(STDERR, 'Update APC, or set apc.enable_cli or apc.cache_by_default to 0 in your php.ini.'.PHP_EOL);
}
}
Phar::mapPhar('composer.phar');
require 'phar://composer.phar/bin/composer';
__HALT_COMPILER(); ?>
›ž composer.phar+src/Composer/Autoload/AutoloadGenerator.php×yÿ‡œ_×y£�˹¤+src/Composer/Autoload/ClassMapGenerator.phpîÿ‡œ_îí¼šl¤src/Composer/Cache.phpêÿ‡œ_êø¿=9¤%src/Composer/Command/AboutCommand.phpØÿ‡œ_Øö÷;‡¤'src/Composer/Command/ArchiveCommand.phpÀÿ‡œ_ÀÁ’ =¤$src/Composer/Command/BaseCommand.phpGÿ‡œ_Gp›_ƒ¤.src/Composer/Command/BaseDependencyCommand.php\ÿ‡œ_\©L“Ƥ1src/Composer/Command/CheckPlatformReqsCommand.php›ÿ‡œ_›'#…S¤*src/Composer/Command/ClearCacheCommand.phpóÿ‡œ_óˆ(*Ô¤&src/Composer/Command/ConfigCommand.phpYVÿ‡œ_YV¾-T¤-src/Composer/Command/CreateProjectCommand.phpÐBÿ‡œ_ÐB£Â�ª¤'src/Composer/Command/DependsCommand.phpñÿ‡œ_ñkU‹{¤(src/Composer/Command/DiagnoseCommand.php¾Hÿ‡œ_¾HÁˆn|¤,src/Composer/Command/DumpAutoloadCommand.php±ÿ‡œ_±a#®¤$src/Composer/Command/ExecCommand.php ÿ‡œ_ X?!“¤$src/Composer/Command/FundCommand.phph ÿ‡œ_h !›¤&src/Composer/Command/GlobalCommand.phpÊ ÿ‡œ_Ê �œE¤$src/Composer/Command/HomeCommand.php ÿ‡œ_ àÓ¬¤$src/Composer/Command/InitCommand.php£Zÿ‡œ_£ZK–^ߤ'src/Composer/Command/InstallCommand.php)ÿ‡œ_)”dö¤(src/Composer/Command/LicensesCommand.php[ÿ‡œ_[íŸ!U¤(src/Composer/Command/OutdatedCommand.php� ÿ‡œ_� 7~½=¤)src/Composer/Command/ProhibitsCommand.phpÿ‡œ__¤éS¤&src/Composer/Command/RemoveCommand.php})ÿ‡œ_})¹ƒç¤'src/Composer/Command/RequireCommand.phpß6ÿ‡œ_ß6z=.¤)src/Composer/Command/RunScriptCommand.phpHÿ‡œ_H,_¼Ë¤+src/Composer/Command/ScriptAliasCommand.php¯ÿ‡œ_¯?=Ѥ&src/Composer/Command/SearchCommand.phpU ÿ‡œ_U …ߤ*src/Composer/Command/SelfUpdateCommand.php“Cÿ‡œ_“Cºe�¤$src/Composer/Command/ShowCommand.phpt‹ÿ‡œ_t‹’‚¢¤&src/Composer/Command/StatusCommand.phpòÿ‡œ_òÐ�ô°¤(src/Composer/Command/SuggestsCommand.phpœ ÿ‡œ_œ Ö”¤&src/Composer/Command/UpdateCommand.php12ÿ‡œ_12K†<¤(src/Composer/Command/ValidateCommand.phpMÿ‡œ_MpwÓ’¤src/Composer/Composer.php ÿ‡œ_ ¶’"0¤src/Composer/Config.php¾$ÿ‡œ_¾$zø¡9¤-src/Composer/Config/ConfigSourceInterface.phpÿ‡œ_�û¤(src/Composer/Config/JsonConfigSource.phpÿ‡œ_´ŽØ¤$src/Composer/Console/Application.phpÎ;ÿ‡œ_Î;p.ܤ*src/Composer/Console/GithubActionError.php`ÿ‡œ_`ï×y ¤,src/Composer/Console/HtmlOutputFormatter.php3ÿ‡œ_3Ú�Eu¤-src/Composer/DependencyResolver/Decisions.php<ÿ‡œ_<_$©¤1src/Composer/DependencyResolver/DefaultPolicy.phpüÿ‡œ_üq-=¤/src/Composer/DependencyResolver/GenericRule.php¢ÿ‡œ_¢|x¬_¤8src/Composer/DependencyResolver/LocalRepoTransaction.php”ÿ‡œ_” (o¤3src/Composer/DependencyResolver/LockTransaction.php ÿ‡œ_ Ø(õ‰¤5src/Composer/DependencyResolver/MultiConflictRule.php-ÿ‡œ_-´´š¤>src/Composer/DependencyResolver/Operation/InstallOperation.php·ÿ‡œ_·#Ò­’¤Isrc/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.phpÿ‡œ_RØDå¤Ksrc/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php ÿ‡œ_ ÇA;Ú¤@src/Composer/DependencyResolver/Operation/OperationInterface.phpÚÿ‡œ_ÚQâè¤=src/Composer/DependencyResolver/Operation/SolverOperation.phpFÿ‡œ_F ƒ‹s¤@src/Composer/DependencyResolver/Operation/UninstallOperation.phpŸÿ‡œ_Ÿo ±(¤=src/Composer/DependencyResolver/Operation/UpdateOperation.phpGÿ‡œ_G–ˆ
¤3src/Composer/DependencyResolver/PolicyInterface.php6ÿ‡œ_6³m〤(src/Composer/DependencyResolver/Pool.php8ÿ‡œ_8ãW÷¤/src/Composer/DependencyResolver/PoolBuilder.phpc0ÿ‡œ_c0(¥‚Ö¤+src/Composer/DependencyResolver/Problem.php,6ÿ‡œ_,6­zúܤ+src/Composer/DependencyResolver/Request.phpÿ‡œ_{·Ñ¤(src/Composer/DependencyResolver/Rule.phpÀ%ÿ‡œ_À%1¤1src/Composer/DependencyResolver/Rule2Literals.phpÿ‡œ_ª÷Ϥ+src/Composer/DependencyResolver/RuleSet.phpt ÿ‡œ_t Cyoâ¤4src/Composer/DependencyResolver/RuleSetGenerator.phpVÿ‡œ_V^J §¤3src/Composer/DependencyResolver/RuleSetIterator.php ÿ‡œ_ …gØ,¤2src/Composer/DependencyResolver/RuleWatchChain.phpiÿ‡œ_ihïš,¤2src/Composer/DependencyResolver/RuleWatchGraph.php< ÿ‡œ_< š8¿z¤1src/Composer/DependencyResolver/RuleWatchNode.php3ÿ‡œ_3š±aÖ¤*src/Composer/DependencyResolver/Solver.php^8ÿ‡œ_^8s5Q9¤6src/Composer/DependencyResolver/SolverBugException.php™ÿ‡œ_™Xg6¤;src/Composer/DependencyResolver/SolverProblemsException.phpÒ ÿ‡œ_Ò Íi¾T¤/src/Composer/DependencyResolver/Transaction.phpÂÿ‡œ_ ý¹¤-src/Composer/Downloader/ArchiveDownloader.php£ ÿ‡œ_£ &çâö¤1src/Composer/Downloader/ChangeReportInterface.phpÌÿ‡œ_̯ਿ¤+src/Composer/Downloader/DownloadManager.php;ÿ‡œ_;2q²P¤/src/Composer/Downloader/DownloaderInterface.phpÿ‡œ_<ê ¤3src/Composer/Downloader/DvcsDownloaderInterface.phpÑÿ‡œ_Ñ&Áœ¿¤*src/Composer/Downloader/FileDownloader.phpƒ*ÿ‡œ_ƒ*,ê?¤/src/Composer/Downloader/FilesystemException.php
ÿ‡œ_
.-‹¤,src/Composer/Downloader/FossilDownloader.phpÖ ÿ‡œ_Ö À¯é¤)src/Composer/Downloader/GitDownloader.php€<ÿ‡œ_€<=�>¤*src/Composer/Downloader/GzipDownloader.phpyÿ‡œ_y·Á�]¤(src/Composer/Downloader/HgDownloader.php ÿ‡œ_ «£þ/¤8src/Composer/Downloader/MaxFileSizeExceededException.phpiÿ‡œ_iÖt~p¤*src/Composer/Downloader/PathDownloader.phpÅÿ‡œ_ž\8h¤.src/Composer/Downloader/PerforceDownloader.phpÿ‡œ_ܘ¤*src/Composer/Downloader/PharDownloader.php(ÿ‡œ_(”=K¤)src/Composer/Downloader/RarDownloader.php®ÿ‡œ_®]'ƒÇ¤)src/Composer/Downloader/SvnDownloader.phpFÿ‡œ_FÊD‡¤)src/Composer/Downloader/TarDownloader.php&ÿ‡œ_&C€—€¤.src/Composer/Downloader/TransportException.php=ÿ‡œ_=ZÎÈÞ¤9src/Composer/Downloader/VcsCapableDownloaderInterface.phpÔÿ‡œ_Ô`§ôö¤)src/Composer/Downloader/VcsDownloader.phpAÿ‡œ_ANmm ¤(src/Composer/Downloader/XzDownloader.phpçÿ‡œ_çx�3.¤)src/Composer/Downloader/ZipDownloader.php«ÿ‡œ_«Õò¤&src/Composer/EventDispatcher/Event.php ÿ‡œ_ ±™jï¤0src/Composer/EventDispatcher/EventDispatcher.php/.ÿ‡œ_/.KÜ€§¤9src/Composer/EventDispatcher/EventSubscriberInterface.php©ÿ‡œ_©h·0¤9src/Composer/EventDispatcher/ScriptExecutionException.phpvÿ‡œ_vwZ8S¤9src/Composer/Exception/IrrecoverableDownloadException.phpvÿ‡œ_vDM½y¤)src/Composer/Exception/NoSslException.phphÿ‡œ_hˆdñÓ¤src/Composer/Factory.php×Aÿ‡œ_×Aƒê¤src/Composer/IO/BaseIO.phpÿ‡œ_´ó|¤src/Composer/IO/BufferIO.php·ÿ‡œ_· i² ¤src/Composer/IO/ConsoleIO.phpºÿ‡œ_º'ü¤ø¤src/Composer/IO/IOInterface.phpØÿ‡œ_ØFò°ð¤src/Composer/IO/NullIO.phpÀÿ‡œ_ÀF`sʤ"src/Composer/InstalledVersions.php- ÿ‡œ_- &“ò(¤src/Composer/Installer.phpsÿ‡œ_stÍ è¤*src/Composer/Installer/BinaryInstaller.php
ÿ‡œ_
t¤{ø¤2src/Composer/Installer/BinaryPresenceInterface.phpËÿ‡œ_ËÀ5š¨¤.src/Composer/Installer/InstallationManager.phpA1ÿ‡œ_A1uwµI¤)src/Composer/Installer/InstallerEvent.phpŒÿ‡œ_Œš´Úë¤*src/Composer/Installer/InstallerEvents.php…ÿ‡œ_…nÜ<Á¤-src/Composer/Installer/InstallerInterface.phpJÿ‡œ_JhK.U¤+src/Composer/Installer/LibraryInstaller.phpiÿ‡œ_i‰Á%è¤/src/Composer/Installer/MetapackageInstaller.phpüÿ‡œ_üaNÕ‘¤(src/Composer/Installer/NoopInstaller.php]ÿ‡œ_]Û‰öÓ¤'src/Composer/Installer/PackageEvent.phpÿ‡œ_=ÉФ(src/Composer/Installer/PackageEvents.php¸ÿ‡œ_¸dbØs¤*src/Composer/Installer/PluginInstaller.phpK
ÿ‡œ_K
´S‚¤+src/Composer/Installer/ProjectInstaller.phpfÿ‡œ_fÙÇ“B¤4src/Composer/Installer/SuggestedPackagesReporter.phpÿ‡œ_Vt–¤src/Composer/Json/JsonFile.phpÿÿ‡œ_ÿ²†»Ò¤#src/Composer/Json/JsonFormatter.php^ÿ‡œ_^‚£.î¤%src/Composer/Json/JsonManipulator.php³6ÿ‡œ_³6ŠÛT£¤-src/Composer/Json/JsonValidationException.php\ÿ‡œ_\.Xóܤ%src/Composer/Package/AliasPackage.php½ÿ‡œ_½Y÷ÿa¤7src/Composer/Package/Archiver/ArchivableFilesFilter.php ÿ‡œ_ yY+¦¤7src/Composer/Package/Archiver/ArchivableFilesFinder.phpæÿ‡œ_æU`Ƥ0src/Composer/Package/Archiver/ArchiveManager.phpfÿ‡œ_f‹ ½"¤3src/Composer/Package/Archiver/ArchiverInterface.phpÿ‡œ_ñ´> ¤3src/Composer/Package/Archiver/BaseExcludeFilter.php—ÿ‡œ_—FmÌZ¤7src/Composer/Package/Archiver/ComposerExcludeFilter.phpÿ‡œ_‹SZ0¤2src/Composer/Package/Archiver/GitExcludeFilter.phprÿ‡œ_r3‘Mh¤1src/Composer/Package/Archiver/HgExcludeFilter.php ÿ‡œ_  •¦S¤.src/Composer/Package/Archiver/PharArchiver.php?ÿ‡œ_?®— u¤-src/Composer/Package/Archiver/ZipArchiver.phpXÿ‡œ_X¤k�~¤$src/Composer/Package/BasePackage.phpÿ‡œ_Þ)’ˤ*src/Composer/Package/Comparer/Comparer.php½ÿ‡œ_½¡fK}¤(src/Composer/Package/CompletePackage.php§ÿ‡œ_§ h“¤1src/Composer/Package/CompletePackageInterface.phpÿ‡œ_2%ž¤+src/Composer/Package/Dumper/ArrayDumper.php ÿ‡œ_ Ã@Q¤src/Composer/Package/Link.phpÝÿ‡œ_ÝÃðÿФ+src/Composer/Package/Loader/ArrayLoader.phpã&ÿ‡œ_ã&ª>l¤7src/Composer/Package/Loader/InvalidPackageException.phpEÿ‡œ_Exb¾¤*src/Composer/Package/Loader/JsonLoader.php°ÿ‡œ_°Vœ\‹¤/src/Composer/Package/Loader/LoaderInterface.php²ÿ‡œ_²¦}úΤ1src/Composer/Package/Loader/RootPackageLoader.php•ÿ‡œ_•ÀUŽ|¤5src/Composer/Package/Loader/ValidatingArrayLoader.php«Aÿ‡œ_«Açë‹á¤src/Composer/Package/Locker.php"$ÿ‡œ_"$hññw¤ src/Composer/Package/Package.phpÿ‡œ_¯°æg¤)src/Composer/Package/PackageInterface.php� ÿ‡œ_� H^K_¤)src/Composer/Package/RootAliasPackage.phpH ÿ‡œ_H ëie`¤$src/Composer/Package/RootPackage.phpIÿ‡œ_Iq]V¤-src/Composer/Package/RootPackageInterface.php¹ÿ‡œ_¹"maV¤0src/Composer/Package/Version/StabilityFilter.phpëÿ‡œ_ë�H ¤/src/Composer/Package/Version/VersionGuesser.phpº$ÿ‡œ_º$ÐDJT¤.src/Composer/Package/Version/VersionParser.phpýÿ‡œ_ý4º�Τ0src/Composer/Package/Version/VersionSelector.phpÿÿ‡œ_ÿG/”²¤&src/Composer/Platform/HhvmDetector.phpðÿ‡œ_ðË›ª¤!src/Composer/Platform/Runtime.php@ÿ‡œ_@ª™ˆ`¤!src/Composer/Platform/Version.php’ÿ‡œ_’wLão¤-src/Composer/Plugin/Capability/Capability.phpWÿ‡œ_Wæ_¨1¤2src/Composer/Plugin/Capability/CommandProvider.php—ÿ‡œ_—ûOâ>¤src/Composer/Plugin/Capable.phpÿ‡œ_Æq+¤$src/Composer/Plugin/CommandEvent.phpâÿ‡œ_â³ÆÇW¤$src/Composer/Plugin/PluginEvents.phpeÿ‡œ_e*U~r¤'src/Composer/Plugin/PluginInterface.phpŽÿ‡œ_Ž�4%~¤%src/Composer/Plugin/PluginManager.phpÜ-ÿ‡œ_Ü-5ÑùC¤-src/Composer/Plugin/PostFileDownloadEvent.phpäÿ‡œ_äÀ¤}ý¤*src/Composer/Plugin/PreCommandRunEvent.phpõÿ‡œ_õ:ðd¤,src/Composer/Plugin/PreFileDownloadEvent.phpOÿ‡œ_O¾­wÀ¤*src/Composer/Plugin/PrePoolCreateEvent.phpuÿ‡œ_u6sS„¤4src/Composer/Question/StrictConfirmationQuestion.phpÿ‡œ_'.³è¤+src/Composer/Repository/ArrayRepository.phpìÿ‡œ_쌆ó6¤.src/Composer/Repository/ArtifactRepository.phpô ÿ‡œ_ô ›©Ñn¤.src/Composer/Repository/ComposerRepository.php¨‡ÿ‡œ_¨‡œ¿{¤/src/Composer/Repository/CompositeRepository.phpO ÿ‡œ_O ·P¯¤;src/Composer/Repository/ConfigurableRepositoryInterface.php…ÿ‡œ_…±Ÿ_¤0src/Composer/Repository/FilesystemRepository.phpzÿ‡œ_zë½ʤ,src/Composer/Repository/FilterRepository.phpÿ‡œ_×y¯¢¤4src/Composer/Repository/InstalledArrayRepository.php3ÿ‡œ_3…¥)n¤9src/Composer/Repository/InstalledFilesystemRepository.php1ÿ‡œ_1y&êͤ/src/Composer/Repository/InstalledRepository.phpîÿ‡œ_î™5| ¤8src/Composer/Repository/InstalledRepositoryInterface.php¥ÿ‡œ_¥Ã%¤6src/Composer/Repository/InvalidRepositoryException.phpnÿ‡œ_nà“똤/src/Composer/Repository/LockArrayRepository.php¥ÿ‡œ_¥524¤-src/Composer/Repository/PackageRepository.phpÒÿ‡œ_ÒåÒd¤*src/Composer/Repository/PathRepository.php%ÿ‡œ_%õœjš¤*src/Composer/Repository/PearRepository.phpQÿ‡œ_Qcø¤.src/Composer/Repository/PlatformRepository.php¡Hÿ‡œ_¡H�¨Iÿ¤-src/Composer/Repository/RepositoryFactory.php¦ÿ‡œ_¦Ÿ�&<¤/src/Composer/Repository/RepositoryInterface.php;ÿ‡œ_; _‹¤-src/Composer/Repository/RepositoryManager.php ÿ‡œ_ ´=x¤7src/Composer/Repository/RepositorySecurityException.phpoÿ‡œ_opÕ«ª¤)src/Composer/Repository/RepositorySet.phpÏÿ‡œ_Ï^ì È¤1src/Composer/Repository/RootPackageRepository.php@ÿ‡œ_@X¦Ž¤/src/Composer/Repository/Vcs/BitbucketDriver.php¢ ÿ‡œ_¢ L
W¤,src/Composer/Repository/Vcs/FossilDriver.phplÿ‡œ_lwàù ¤2src/Composer/Repository/Vcs/GitBitbucketDriver.phpÿ‡œ_Q¿C
¤)src/Composer/Repository/Vcs/GitDriver.phpôÿ‡œ_ôíI�`¤,src/Composer/Repository/Vcs/GitHubDriver.phpü4ÿ‡œ_ü4¸Ðtå¤,src/Composer/Repository/Vcs/GitLabDriver.php+ÿ‡œ_+´P•z¤1src/Composer/Repository/Vcs/HgBitbucketDriver.phpãÿ‡œ_ã¬}ñ¤(src/Composer/Repository/Vcs/HgDriver.phpÿ‡œ__8¬­¤.src/Composer/Repository/Vcs/PerforceDriver.php¾ ÿ‡œ_¾ ˆáÀ¤)src/Composer/Repository/Vcs/SvnDriver.php›ÿ‡œ_›†
\ô¤)src/Composer/Repository/Vcs/VcsDriver.phpz
ÿ‡œ_z
}ãh¤2src/Composer/Repository/Vcs/VcsDriverInterface.php÷ÿ‡œ_÷ÇX[‰¤)src/Composer/Repository/VcsRepository.php`2ÿ‡œ_`2twˆJ¤1src/Composer/Repository/VersionCacheInterface.php”ÿ‡œ_”A?Rï¤3src/Composer/Repository/WritableArrayRepository.phpmÿ‡œ_mš11`¤7src/Composer/Repository/WritableRepositoryInterface.phpéÿ‡œ_éïŸÒ¥¤src/Composer/Script/Event.phpšÿ‡œ_šÓô©¤$src/Composer/Script/ScriptEvents.phpÜÿ‡œ_ÜÆíÁ¤ src/Composer/SelfUpdate/Keys.php�ÿ‡œ_� îÊN¤$src/Composer/SelfUpdate/Versions.phpRÿ‡œ_RÏ×8�¤ src/Composer/Util/AuthHelper.php(ÿ‡œ_( rG¤src/Composer/Util/Bitbucket.phpÜÿ‡œ_ܨ0Á›¤$src/Composer/Util/ComposerMirror.php±ÿ‡œ_±­½øؤ%src/Composer/Util/ConfigValidator.php:ÿ‡œ_:«hñŽ¤"src/Composer/Util/ErrorHandler.php»ÿ‡œ_»O›rk¤ src/Composer/Util/Filesystem.phpà2ÿ‡œ_à2µŒç¤src/Composer/Util/Git.phpÁ0ÿ‡œ_Á0W¶ÂK¤src/Composer/Util/GitHub.phpW ÿ‡œ_W –¹H¤src/Composer/Util/GitLab.php’ÿ‡œ_’vu˜¼¤src/Composer/Util/Hg.php¶ÿ‡œ_¶²?ܤ)src/Composer/Util/Http/CurlDownloader.phpM<ÿ‡œ_M<Ùiƒ ¤&src/Composer/Util/Http/ProxyHelper.php>
ÿ‡œ_>
ú¤'src/Composer/Util/Http/ProxyManager.phpU
ÿ‡œ_U
bP‘¤'src/Composer/Util/Http/RequestProxy.phpÿ‡œ_üA8¤#src/Composer/Util/Http/Response.php#ÿ‡œ_#Ûûß$¤$src/Composer/Util/HttpDownloader.phpÁ#ÿ‡œ_Á#Þ¿q¤src/Composer/Util/IniHelper.phphÿ‡œ_h;FP¤src/Composer/Util/Loop.phpÀÿ‡œ_ÀùÿKä&src/Composer/Util/MetadataMinifier.php¼ÿ‡œ_¼$Ž.w¤$src/Composer/Util/NoProxyPattern.php|ÿ‡œ_|¸|ää¤#src/Composer/Util/PackageSorter.phpðÿ‡œ_ð9hÑ­¤src/Composer/Util/Perforce.php^2ÿ‡œ_^2=´MÔ¤src/Composer/Util/Platform.phpÿ‡œ__ë3+¤%src/Composer/Util/ProcessExecutor.phpÿ‡œ_Gs˜X¤&src/Composer/Util/RemoteFilesystem.php­Mÿ‡œ_­M§¨¤src/Composer/Util/Silencer.phpéÿ‡œ_é“Vjf¤*src/Composer/Util/StreamContextFactory.php¬ÿ‡œ_¬lÔÙa¤src/Composer/Util/Svn.php)ÿ‡œ_)¬íGj¤ src/Composer/Util/SyncHelper.php;ÿ‡œ_;Ž(¸¤src/Composer/Util/Tar.phpbÿ‡œ_bå]–¤src/Composer/Util/TlsHelper.phpL
ÿ‡œ_L
" i¤src/Composer/Util/Url.phpö ÿ‡œ_ö 'úÁ…¤src/Composer/Util/Zip.php*ÿ‡œ_**Ø%Ǥsrc/bootstrap.php¹ÿ‡œ_¹I}œ¤%src/Composer/Autoload/ClassLoader.php£4ÿ‡œ_£4?ÁT¨¤#res/composer-repository-schema.jsonñÿ‡œ_ñ|0à„¤res/composer-schema.json€ªÿ‡œ_€ªÅÇH¤vendor/autoload.php‚ÿ‡œ_‚*î`ý¤vendor/composer/ClassLoader.php¶ÿ‡œ_¶ôJ1¤%vendor/composer/InstalledVersions.php–ÿ‡œ_–pbæ¤%vendor/composer/autoload_classmap.phpµÿ‡œ_µx’ý»¤"vendor/composer/autoload_files.phpŒÿ‡œ_Œ� ¤'vendor/composer/autoload_namespaces.php¢ÿ‡œ_¢�R7c¤!vendor/composer/autoload_psr4.php÷ÿ‡œ_÷Å*š¤!vendor/composer/autoload_real.phpGÿ‡œ_G ”_¤#vendor/composer/autoload_static.php¹ ÿ‡œ_¹ Nt¤!vendor/composer/ca-bundle/LICENSEÿ‡œ_G _¤(vendor/composer/ca-bundle/res/cacert.pemÜcÿ‡œ_Üc9ç‹ù¤*vendor/composer/ca-bundle/src/CaBundle.phpRÿ‡œ_R!Ã%¤vendor/composer/installed.phpu ÿ‡œ_u ´`9¤vendor/composer/semver/LICENSEÿ‡œ_ÇSRm¤)vendor/composer/semver/src/Comparator.phpÿ‡œ_^ÝŠ’¤/vendor/composer/semver/src/CompilingMatcher.phpoÿ‡œ_oÆ7L§¤/vendor/composer/semver/src/Constraint/Bound.phptÿ‡œ_tùÛœ¤4vendor/composer/semver/src/Constraint/Constraint.phpjÿ‡œ_j7k)¤=vendor/composer/semver/src/Constraint/ConstraintInterface.php˜ÿ‡œ_˜œ?[¤<vendor/composer/semver/src/Constraint/MatchAllConstraint.php§ÿ‡œ_§ÃÛé¤=vendor/composer/semver/src/Constraint/MatchNoneConstraint.phpÁÿ‡œ_Áê´ �¤9vendor/composer/semver/src/Constraint/MultiConstraint.php!ÿ‡œ_!q)Åà¤'vendor/composer/semver/src/Interval.phpèÿ‡œ_è È�Û¤(vendor/composer/semver/src/Intervals.phpù+ÿ‡œ_ù+Íòc»¤%vendor/composer/semver/src/Semver.phpüÿ‡œ_ü`°e¤,vendor/composer/semver/src/VersionParser.phpÊ+ÿ‡œ_Ê+7m¤%vendor/composer/spdx-licenses/LICENSEÿ‡œ_ÇSRm¤6vendor/composer/spdx-licenses/res/spdx-exceptions.json¸ ÿ‡œ_¸ Â4DC¤4vendor/composer/spdx-licenses/res/spdx-licenses.jsoná£ÿ‡œ_á£Ú¼Ó¤2vendor/composer/spdx-licenses/src/SpdxLicenses.phpHÿ‡œ_H͉T¤&vendor/composer/xdebug-handler/LICENSE+ÿ‡œ_+Öã@T¤0vendor/composer/xdebug-handler/src/PhpConfig.php´ÿ‡œ_´*D’¤.vendor/composer/xdebug-handler/src/Process.phpp ÿ‡œ_p i,i‘¤-vendor/composer/xdebug-handler/src/Status.php
ÿ‡œ_
$Ÿv-¤4vendor/composer/xdebug-handler/src/XdebugHandler.php@#ÿ‡œ_@#üt펤(vendor/justinrainbow/json-schema/LICENSE"ÿ‡œ_" |»™¤Nvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/BaseConstraint.php¡ ÿ‡œ_¡ †wÌl¤Tvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/CollectionConstraint.php�
ÿ‡œ_�
ÍèÓ¯¤Jvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php§ ÿ‡œ_§ ›VؤSvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ConstraintInterface.php¼ÿ‡œ_¼ÿ Qœ¤Nvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php]ÿ‡œ_]VŽU<¤Gvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Factory.phpã ÿ‡œ_ã á0;¤Pvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php…ÿ‡œ_…“TœÚ¤Pvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/NumberConstraint.php‡ ÿ‡œ_‡ ï›(¤Pvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.phpÃÿ‡œ_éżx¤Pvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php0 ÿ‡œ_0 ×j´˜¤Pvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.phpÿ‡œ_¥wš‡¤Xvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeCheck/LooseTypeCheck.phpaÿ‡œ_a qäYvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeCheck/StrictTypeCheck.php—ÿ‡œ_—4~¾ ¤\vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeCheck/TypeCheckInterface.php‰ÿ‡œ_‰“µ+j¤Nvendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeConstraint.php&ÿ‡œ_&4˜©T¤Svendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.phpS"ÿ‡œ_S"¼¾õ:¤Fvendor/justinrainbow/json-schema/src/JsonSchema/Entity/JsonPointer.phpèÿ‡œ_è{N–¤Pvendor/justinrainbow/json-schema/src/JsonSchema/Exception/ExceptionInterface.phpIÿ‡œ_I%|°¤Vvendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidArgumentException.php•ÿ‡œ_•‹àG¤Tvendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidConfigException.phplÿ‡œ_lA!LפTvendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSchemaException.phplÿ‡œ_lè2÷þ¤]vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSchemaMediaTypeException.phpuÿ‡œ_u=hç¤Wvendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSourceUriException.phpwÿ‡œ_wN-ò[¤Svendor/justinrainbow/json-schema/src/JsonSchema/Exception/JsonDecodingException.phpÞÿ‡œ_Þ\¸
¤Wvendor/justinrainbow/json-schema/src/JsonSchema/Exception/ResourceNotFoundException.phpoÿ‡œ_opíÛù¤Nvendor/justinrainbow/json-schema/src/JsonSchema/Exception/RuntimeException.php…ÿ‡œ_…%…—¤^vendor/justinrainbow/json-schema/src/JsonSchema/Exception/UnresolvableJsonPointerException.php€ÿ‡œ_€u-#1¤Rvendor/justinrainbow/json-schema/src/JsonSchema/Exception/UriResolverException.phpjÿ‡œ_jå>�¤Qvendor/justinrainbow/json-schema/src/JsonSchema/Exception/ValidationException.phpfÿ‡œ_f¬¤„þ¤Kvendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.phpþÿ‡œ_þM�„õ¤;vendor/justinrainbow/json-schema/src/JsonSchema/Rfc3339.php ÿ‡œ_ f4÷³¤Avendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorage.phpœ ÿ‡œ_œ åfO¤Jvendor/justinrainbow/json-schema/src/JsonSchema/SchemaStorageInterface.phpÿ‡œ_oŠ+}¤Tvendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/AbstractRetriever.phpáÿ‡œ_á[þA�¤Gvendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php¥ÿ‡œ_¥Ô§Lb¤Rvendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php%ÿ‡œ_%5" ¤Rvendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php,ÿ‡œ_,1•5þ¤Xvendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/UriRetrieverInterface.php®ÿ‡œ_®ÿ‹Áå¤Cvendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php ÿ‡œ_ £Ÿ)à¤Dvendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriRetriever.phpFÿ‡œ_F¨IaD¤Hvendor/justinrainbow/json-schema/src/JsonSchema/UriResolverInterface.phpƒÿ‡œ_ƒJ€¤Ivendor/justinrainbow/json-schema/src/JsonSchema/UriRetrieverInterface.php…ÿ‡œ_…íæe¤=vendor/justinrainbow/json-schema/src/JsonSchema/Validator.phpvÿ‡œ_võÍg¤vendor/psr/log/LICENSE?ÿ‡œ_?„ù ¤)vendor/psr/log/Psr/Log/AbstractLogger.php;ÿ‡œ_;ñ>3[¤3vendor/psr/log/Psr/Log/InvalidArgumentException.php`ÿ‡œ_` ˆX1¤#vendor/psr/log/Psr/Log/LogLevel.phpûÿ‡œ_ûjðñ8¤/vendor/psr/log/Psr/Log/LoggerAwareInterface.php|ÿ‡œ_|$£ˆ¤+vendor/psr/log/Psr/Log/LoggerAwareTrait.php§ÿ‡œ_§T½úB¤*vendor/psr/log/Psr/Log/LoggerInterface.phpÈÿ‡œ_Èšx¤&vendor/psr/log/Psr/Log/LoggerTrait.phpkÿ‡œ_k£}‰’¤%vendor/psr/log/Psr/Log/NullLogger.php ÿ‡œ_ ÆDi¯¤)vendor/psr/log/Psr/Log/Test/DummyTest.phppÿ‡œ_pΤ3vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php ÿ‡œ_ $/Ò¤*vendor/psr/log/Psr/Log/Test/TestLogger.php<ÿ‡œ_<þ(åI¤vendor/react/promise/LICENSE'ÿ‡œ_'¶-º„¤Fvendor/react/promise/src/React/Promise/CancellablePromiseInterface.php�ÿ‡œ_� ƒ<�¤3vendor/react/promise/src/React/Promise/Deferred.phpð ÿ‡œ_ð o(ퟤ:vendor/react/promise/src/React/Promise/DeferredPromise.phpÇÿ‡œ_Ǻ`W¤;vendor/react/promise/src/React/Promise/DeferredResolver.phpÃÿ‡œ_Ã7Ëu¤;vendor/react/promise/src/React/Promise/FulfilledPromise.phpÍÿ‡œ_Í´–U¤6vendor/react/promise/src/React/Promise/LazyPromise.phpÿ‡œ_Š»¤2vendor/react/promise/src/React/Promise/Promise.phpÿ‡œ_º6Jµ¤;vendor/react/promise/src/React/Promise/PromiseInterface.phpŸÿ‡œ_Ÿ ½¨n¤<vendor/react/promise/src/React/Promise/PromisorInterface.php\ÿ‡œ_\Wèêà¤:vendor/react/promise/src/React/Promise/RejectedPromise.php¾ÿ‡œ_¾fC¿¤<vendor/react/promise/src/React/Promise/ResolverInterface.php¼ÿ‡œ_¼û �O¤/vendor/react/promise/src/React/Promise/Util.phpèÿ‡œ_èËý$:¤/vendor/react/promise/src/React/Promise/When.phpÇÿ‡œ_Ǥo¤4vendor/react/promise/src/React/Promise/functions.phpÒ ÿ‡œ_Ò š§Ë¥¤<vendor/react/promise/src/React/Promise/functions_include.php\ÿ‡œ_\1…‰^¤vendor/seld/jsonlint/LICENSE$ÿ‡œ_$4:‡~¤@vendor/seld/jsonlint/src/Seld/JsonLint/DuplicateKeyException.phpkÿ‡œ_kZù¶Ã¤5vendor/seld/jsonlint/src/Seld/JsonLint/JsonParser.phpU2ÿ‡œ_U2ús.Ƥ0vendor/seld/jsonlint/src/Seld/JsonLint/Lexer.php#ÿ‡œ_#Úá@,¤;vendor/seld/jsonlint/src/Seld/JsonLint/ParsingException.php%ÿ‡œ_%`a„|¤4vendor/seld/jsonlint/src/Seld/JsonLint/Undefined.php>ÿ‡œ_>ÿqŸŸ¤vendor/seld/phar-utils/LICENSE$ÿ‡œ_$š,M§¤%vendor/seld/phar-utils/src/Linter.phpÏÿ‡œ_Ï_Aª¤)vendor/seld/phar-utils/src/Timestamps.php­ ÿ‡œ_­ È?$Ž¤&vendor/symfony/console/Application.php=Xÿ‡œ_=X� S’¤*vendor/symfony/console/Command/Command.phpî"ÿ‡œ_î"x°jÕ¤.vendor/symfony/console/Command/HelpCommand.phpØÿ‡œ_ئÚ-:¤.vendor/symfony/console/Command/ListCommand.phpZÿ‡œ_Z»w`¤(vendor/symfony/console/ConsoleEvents.phpéÿ‡œ_éRÛÔe¤<vendor/symfony/console/Descriptor/ApplicationDescription.phpÐÿ‡œ_ЙŽ5°¤0vendor/symfony/console/Descriptor/Descriptor.php�ÿ‡œ_�¿N•¤9vendor/symfony/console/Descriptor/DescriptorInterface.phpüÿ‡œ_ü±Qµ¤4vendor/symfony/console/Descriptor/JsonDescriptor.phpÜ ÿ‡œ_Ü *û�ɤ8vendor/symfony/console/Descriptor/MarkdownDescriptor.php¶ÿ‡œ_¶·Ô;ݤ4vendor/symfony/console/Descriptor/TextDescriptor.php¼ÿ‡œ_¼òç$¤3vendor/symfony/console/Descriptor/XmlDescriptor.phpÿ‡œ_b{<¤4vendor/symfony/console/Event/ConsoleCommandEvent.php°ÿ‡œ_°!Ȥ-vendor/symfony/console/Event/ConsoleEvent.phpÅÿ‡œ_ÅÒxÛ\¤6vendor/symfony/console/Event/ConsoleExceptionEvent.phpÿ‡œ_á2é¤6vendor/symfony/console/Event/ConsoleTerminateEvent.phpzÿ‡œ_z³,îL¤=vendor/symfony/console/Exception/CommandNotFoundException.phpÔÿ‡œ_ÔÈ÷ L¤7vendor/symfony/console/Exception/ExceptionInterface.phpfÿ‡œ_f¡ABª¤=vendor/symfony/console/Exception/InvalidArgumentException.php¦ÿ‡œ_¦Ö̽Z¤;vendor/symfony/console/Exception/InvalidOptionException.php¦ÿ‡œ_¦Ë×H¤3vendor/symfony/console/Exception/LogicException.php’ÿ‡œ_’ÍO\e¤5vendor/symfony/console/Exception/RuntimeException.php–ÿ‡œ_–Ùí,6¤4vendor/symfony/console/Formatter/OutputFormatter.php6ÿ‡œ_6?=¨¤=vendor/symfony/console/Formatter/OutputFormatterInterface.phpŒÿ‡œ_ŒòññÀ¤9vendor/symfony/console/Formatter/OutputFormatterStyle.phpFÿ‡œ_F𦴤Bvendor/symfony/console/Formatter/OutputFormatterStyleInterface.php„ÿ‡œ_„÷½G¤>vendor/symfony/console/Formatter/OutputFormatterStyleStack.php@ÿ‡œ_@G¨ýU¤6vendor/symfony/console/Helper/DebugFormatterHelper.phpyÿ‡œ_yÌ8ÆФ2vendor/symfony/console/Helper/DescriptorHelper.phpwÿ‡œ_w|¦C¤.vendor/symfony/console/Helper/DialogHelper.phpÿ‡œ_¹ÜÃ_¤1vendor/symfony/console/Helper/FormatterHelper.phpdÿ‡œ_d§×,¸¤(vendor/symfony/console/Helper/Helper.php«ÿ‡œ_«!�§—¤1vendor/symfony/console/Helper/HelperInterface.phpåÿ‡œ_加¤+vendor/symfony/console/Helper/HelperSet.phpÊÿ‡œ_ÊáÏW"¤2vendor/symfony/console/Helper/InputAwareHelper.phpcÿ‡œ_cÌøƒ¤/vendor/symfony/console/Helper/ProcessHelper.phpÓ ÿ‡œ_Ó ©w‚R¤-vendor/symfony/console/Helper/ProgressBar.phpl%ÿ‡œ_l% díÛ¤0vendor/symfony/console/Helper/ProgressHelper.php]ÿ‡œ_]ù»‰X¤3vendor/symfony/console/Helper/ProgressIndicator.phpNÿ‡œ_Nÿ§³l¤0vendor/symfony/console/Helper/QuestionHelper.phplÿ‡œ_lNtó¤7vendor/symfony/console/Helper/SymfonyQuestionHelper.php–
ÿ‡œ_–
- ؤ'vendor/symfony/console/Helper/Table.phpÄ*ÿ‡œ_Ä*¾™ØT¤+vendor/symfony/console/Helper/TableCell.php�ÿ‡œ_�åV^¤-vendor/symfony/console/Helper/TableHelper.php ÿ‡œ_ ›uô™¤0vendor/symfony/console/Helper/TableSeparator.phpÊÿ‡œ_Êaz¤,vendor/symfony/console/Helper/TableStyle.php
ÿ‡œ_
_ÍI"¤*vendor/symfony/console/Input/ArgvInput.phpÿ‡œ_×ö†›¤+vendor/symfony/console/Input/ArrayInput.php) ÿ‡œ_) ¥ÑC¤&vendor/symfony/console/Input/Input.php£ ÿ‡œ_£ f¡?¤.vendor/symfony/console/Input/InputArgument.phpÿ‡œ_D £¤4vendor/symfony/console/Input/InputAwareInterface.php˜ÿ‡œ_˜­O°¤0vendor/symfony/console/Input/InputDefinition.php†ÿ‡œ_†¤U)¤¤/vendor/symfony/console/Input/InputInterface.php£ÿ‡œ_£ÆBŒ'¤,vendor/symfony/console/Input/InputOption.php ÿ‡œ_ \¢Ü=¤,vendor/symfony/console/Input/StringInput.phpšÿ‡œ_šžµ è¤vendor/symfony/console/LICENSE+ÿ‡œ_+²‹ g¤/vendor/symfony/console/Logger/ConsoleLogger.php0 ÿ‡œ_0 …� ¸¤0vendor/symfony/console/Output/BufferedOutput.php_ÿ‡œ__‹ >P¤/vendor/symfony/console/Output/ConsoleOutput.php±ÿ‡œ_±nì!f¤8vendor/symfony/console/Output/ConsoleOutputInterface.phpàÿ‡œ_à‡†Æʤ,vendor/symfony/console/Output/NullOutput.phpÏÿ‡œ_Ï®˜‹Z¤(vendor/symfony/console/Output/Output.php˜ ÿ‡œ_˜ 0p¤1vendor/symfony/console/Output/OutputInterface.phpÿ‡œ_ì&¤.vendor/symfony/console/Output/StreamOutput.php�ÿ‡œ_�Ä’Oç¤2vendor/symfony/console/Question/ChoiceQuestion.phpx
ÿ‡œ_x
W€!¤8vendor/symfony/console/Question/ConfirmationQuestion.phpèÿ‡œ_è/Ô�¤,vendor/symfony/console/Question/Question.phpÎ ÿ‡œ_Î lF¤ vendor/symfony/console/Shell.phpæÿ‡œ_æ¼XÒA¤,vendor/symfony/console/Style/OutputStyle.php\ÿ‡œ_\wפ¤/vendor/symfony/console/Style/StyleInterface.phpÏÿ‡œ_Ï&nÅѤ-vendor/symfony/console/Style/SymfonyStyle.phpäÿ‡œ_ä­å (¤3vendor/symfony/console/Tester/ApplicationTester.phpÏÿ‡œ_Ïsž9i¤/vendor/symfony/console/Tester/CommandTester.phpªÿ‡œ_ª¬K z¤(vendor/symfony/debug/BufferingLogger.phptÿ‡œ_t=hܤvendor/symfony/debug/Debug.php,ÿ‡œ_,Ë~Ž.¤)vendor/symfony/debug/DebugClassLoader.phpµÿ‡œ_µ1rEÓ¤%vendor/symfony/debug/ErrorHandler.phpHÿ‡œ_H¹:D#¤9vendor/symfony/debug/Exception/ClassNotFoundException.php–ÿ‡œ_–i‰æô¤8vendor/symfony/debug/Exception/ContextErrorException.php˜ÿ‡œ_˜-
d2¤1vendor/symfony/debug/Exception/DummyException.phpÿ‡œ_®+Ãê¤6vendor/symfony/debug/Exception/FatalErrorException.phpÿ‡œ_™Ä¤6vendor/symfony/debug/Exception/FatalThrowableError.phpWÿ‡œ_W?àèK¤3vendor/symfony/debug/Exception/FlattenException.php¼ÿ‡œ_¼ פ7vendor/symfony/debug/Exception/OutOfMemoryException.php~ÿ‡œ_~ë¨oâ¤=vendor/symfony/debug/Exception/UndefinedFunctionException.phpšÿ‡œ_š�ñJÀ¤;vendor/symfony/debug/Exception/UndefinedMethodException.php˜ÿ‡œ_˜nöêؤ)vendor/symfony/debug/ExceptionHandler.php)3ÿ‡œ_)3�h5=¤Ivendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.phpAÿ‡œ_AϤ¹l¤Evendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.phpÿ‡œ_ĹBV¤Mvendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.phpxÿ‡œ_x~ò"¤Kvendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.phpOÿ‡œ_O�ž¦*¤vendor/symfony/debug/LICENSE+ÿ‡œ_+²‹ g¤:vendor/symfony/filesystem/Exception/ExceptionInterface.phpiÿ‡œ_i$ ÿ›¤=vendor/symfony/filesystem/Exception/FileNotFoundException.php¼ÿ‡œ_¼pí\¶¤3vendor/symfony/filesystem/Exception/IOException.php‡ÿ‡œ_‡€ü#Ѥ<vendor/symfony/filesystem/Exception/IOExceptionInterface.php¦ÿ‡œ_¦jÙwM¤(vendor/symfony/filesystem/Filesystem.phpc4ÿ‡œ_c4‹×@þ¤!vendor/symfony/filesystem/LICENSE+ÿ‡œ_+²‹ g¤)vendor/symfony/filesystem/LockHandler.phpöÿ‡œ_öŸZµ1¤1vendor/symfony/finder/Adapter/AbstractAdapter.php\ ÿ‡œ_\ hˆB¤5vendor/symfony/finder/Adapter/AbstractFindAdapter.php�ÿ‡œ_�HC€/¤2vendor/symfony/finder/Adapter/AdapterInterface.php›ÿ‡œ_›Mþ¤0vendor/symfony/finder/Adapter/BsdFindAdapter.php3ÿ‡œ_375$·¤0vendor/symfony/finder/Adapter/GnuFindAdapter.phpÿ‡œ_Ÿ`]¤,vendor/symfony/finder/Adapter/PhpAdapter.phpôÿ‡œ_ôÞdè;¤/vendor/symfony/finder/Comparator/Comparator.php�ÿ‡œ_�¾üœµ¤3vendor/symfony/finder/Comparator/DateComparator.php#ÿ‡œ_#°Τ5vendor/symfony/finder/Comparator/NumberComparator.php|ÿ‡œ_|ITÇͤ9vendor/symfony/finder/Exception/AccessDeniedException.php„ÿ‡œ_„½¾sœ¤;vendor/symfony/finder/Exception/AdapterFailureException.php¬ÿ‡œ_¬wR¤6vendor/symfony/finder/Exception/ExceptionInterface.php„ÿ‡œ_„Gz-¤Avendor/symfony/finder/Exception/OperationNotPermitedException.php)ÿ‡œ_)x§e¤@vendor/symfony/finder/Exception/ShellCommandFailureException.phpºÿ‡œ_º˜þ˜¤/vendor/symfony/finder/Expression/Expression.phpÿ‡œ_i¥:Ť)vendor/symfony/finder/Expression/Glob.phpfÿ‡œ_fDÞcj¤*vendor/symfony/finder/Expression/Regex.phpÿ‡œ_ü(ÃϤ3vendor/symfony/finder/Expression/ValueInterface.phpÍÿ‡œ_Í\p4†¤ vendor/symfony/finder/Finder.phpc.ÿ‡œ_c.:ˆ5g¤vendor/symfony/finder/Glob.phpLÿ‡œ_LjÍ9פ7vendor/symfony/finder/Iterator/CustomFilterIterator.php]ÿ‡œ_]ÎoÅƤ:vendor/symfony/finder/Iterator/DateRangeFilterIterator.phpxÿ‡œ_xôP¤;vendor/symfony/finder/Iterator/DepthRangeFilterIterator.phpîÿ‡œ_îüÍ�q¤Avendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.phpíÿ‡œ_ínõH¤4vendor/symfony/finder/Iterator/FilePathsIterator.php#ÿ‡œ_#G?T½¤9vendor/symfony/finder/Iterator/FileTypeFilterIterator.phpZÿ‡œ_Z(&ø¤<vendor/symfony/finder/Iterator/FilecontentFilterIterator.php5ÿ‡œ_5ší¤9vendor/symfony/finder/Iterator/FilenameFilterIterator.phprÿ‡œ_rtu¤1vendor/symfony/finder/Iterator/FilterIterator.phpÃÿ‡œ_Ú+µÞ¤=vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php-ÿ‡œ_-ºÎÒ_¤5vendor/symfony/finder/Iterator/PathFilterIterator.phpÐÿ‡œ_Ђc¤=vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php ÿ‡œ_ ë]í»¤:vendor/symfony/finder/Iterator/SizeRangeFilterIterator.phpeÿ‡œ_eŸ’áé¤3vendor/symfony/finder/Iterator/SortableIterator.php+ÿ‡œ_+õÝË ¤vendor/symfony/finder/LICENSE+ÿ‡œ_+²‹ g¤'vendor/symfony/finder/Shell/Command.php> ÿ‡œ_> _~u ¤%vendor/symfony/finder/Shell/Shell.phprÿ‡œ_rþpN¤%vendor/symfony/finder/SplFileInfo.phpÿ‡œ_þíù¤'vendor/symfony/polyfill-ctype/Ctype.phpH ÿ‡œ_H ³�Õݤ%vendor/symfony/polyfill-ctype/LICENSE+ÿ‡œ_+…»E:¤+vendor/symfony/polyfill-ctype/bootstrap.phpúÿ‡œ_ú|p:¤(vendor/symfony/polyfill-mbstring/LICENSE+ÿ‡œ_+øÛ{¤-vendor/symfony/polyfill-mbstring/Mbstring.php‚Gÿ‡œ_‚Gֽ̤Dvendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8Ëÿ‡œ_ËÚ�.‚¤@vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php÷Tÿ‡œ_÷Tß2ª?¤Fvendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.phpãÿ‡œ_ãöy_•¤@vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.phpîUÿ‡œ_îU`þ8Q¤.vendor/symfony/polyfill-mbstring/bootstrap.phpÿ‡œ_þJ¾¤7vendor/symfony/process/Exception/ExceptionInterface.phpfÿ‡œ_f]ö>T¤=vendor/symfony/process/Exception/InvalidArgumentException.php¨ÿ‡œ_¨ÐÀ+_¤3vendor/symfony/process/Exception/LogicException.php”ÿ‡œ_” ³ãñ¤;vendor/symfony/process/Exception/ProcessFailedException.phpxÿ‡œ_x¨Ìzy¤=vendor/symfony/process/Exception/ProcessTimedOutException.phpÿ‡œ_﫤5vendor/symfony/process/Exception/RuntimeException.php˜ÿ‡œ_˜¢Ø:¤+vendor/symfony/process/ExecutableFinder.php�ÿ‡œ_�ûus€¤vendor/symfony/process/LICENSE+ÿ‡œ_+²‹ g¤.vendor/symfony/process/PhpExecutableFinder.phpÏÿ‡œ_ÏÎ%h¤%vendor/symfony/process/PhpProcess.phpüÿ‡œ_ü‡jûü¤.vendor/symfony/process/Pipes/AbstractPipes.php½ÿ‡œ_½æ†¤/vendor/symfony/process/Pipes/PipesInterface.phpDÿ‡œ_DvØ*vendor/symfony/process/Pipes/UnixPipes.php>ÿ‡œ_>ª•ir¤-vendor/symfony/process/Pipes/WindowsPipes.phpp ÿ‡œ_p âU~ɤ"vendor/symfony/process/Process.php·Rÿ‡œ_·RŠ`Õ¤)vendor/symfony/process/ProcessBuilder.phpâ
ÿ‡œ_â
†M¶¤'vendor/symfony/process/ProcessUtils.phpQÿ‡œ_Qb-$m¤ bin/composer6ÿ‡œ_6 9Øï¤LICENSE.ÿ‡œ_. Õ¤<?php
namespace Composer\Autoload;
use Composer\Config;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Installer\InstallationManager;
use Composer\IO\IOInterface;
use Composer\Package\AliasPackage;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Repository\PlatformRepository;
use Composer\Semver\Constraint\Bound;
use Composer\Semver\Constraint\MatchAllConstraint;
use Composer\Util\Filesystem;
use Composer\Script\ScriptEvents;
use Composer\Util\PackageSorter;
class AutoloadGenerator
{
private $eventDispatcher;
private $io;
private $devMode = false;
private $classMapAuthoritative = false;
private $apcu = false;
private $apcuPrefix;
private $runScripts = false;
private $ignorePlatformReqs = false;
public function __construct(EventDispatcher $eventDispatcher, IOInterface $io = null)
{
$this->eventDispatcher = $eventDispatcher;
$this->io = $io;
}
public function setDevMode($devMode = true)
{
$this->devMode = (bool) $devMode;
}
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = (bool) $classMapAuthoritative;
}
public function setApcu($apcu, $apcuPrefix = null)
{
$this->apcu = (bool) $apcu;
$this->apcuPrefix = $apcuPrefix !== null ? (string) $apcuPrefix : $apcuPrefix;
}
public function setRunScripts($runScripts = true)
{
$this->runScripts = (bool) $runScripts;
}
public function setIgnorePlatformRequirements($ignorePlatformReqs)
{
if (is_array($ignorePlatformReqs)) {
$this->ignorePlatformReqs = array_filter($ignorePlatformReqs, function ($req) {
return PlatformRepository::isPlatformPackage($req);
});
} else {
$this->ignorePlatformReqs = (bool) $ignorePlatformReqs;
}
}
public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsrPackages = false, $suffix = '')
{
if ($this->classMapAuthoritative) {
$scanPsrPackages = true;
}
if ($this->runScripts) {
$this->eventDispatcher->dispatchScript(ScriptEvents::PRE_AUTOLOAD_DUMP, $this->devMode, array(), array(
'optimize' => (bool) $scanPsrPackages,
));
}
$filesystem = new Filesystem();
$filesystem->ensureDirectoryExists($config->get('vendor-dir'));
$basePath = $filesystem->normalizePath(realpath(realpath(getcwd())));
$vendorPath = $filesystem->normalizePath(realpath(realpath($config->get('vendor-dir'))));
$useGlobalIncludePath = (bool) $config->get('use-include-path');
$prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';
$targetDir = $vendorPath.'/'.$targetDir;
$filesystem->ensureDirectoryExists($targetDir);
$vendorPathCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
$vendorPathCode52 = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathCode);
$vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, realpath($targetDir), true);
$appBaseDirCode = $filesystem->findShortestPathCode($vendorPath, $basePath, true);
$appBaseDirCode = str_replace('__DIR__', '$vendorDir', $appBaseDirCode);
$namespacesFile = <<<EOF
<?php
// autoload_namespaces.php @generated by Composer
\$vendorDir = $vendorPathCode52;
\$baseDir = $appBaseDirCode;
return array(
EOF;
$psr4File = <<<EOF
<?php
// autoload_psr4.php @generated by Composer
\$vendorDir = $vendorPathCode52;
\$baseDir = $appBaseDirCode;
return array(
EOF;
$packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
$autoloads = $this->parseAutoloads($packageMap, $mainPackage, $this->devMode === false);
foreach ($autoloads['psr-0'] as $namespace => $paths) {
$exportedPaths = array();
foreach ($paths as $path) {
$exportedPaths[] = $this->getPathCode($filesystem, $basePath, $vendorPath, $path);
}
$exportedPrefix = var_export($namespace, true);
$namespacesFile .= " $exportedPrefix => ";
$namespacesFile .= "array(".implode(', ', $exportedPaths)."),\n";
}
$namespacesFile .= ");\n";
foreach ($autoloads['psr-4'] as $namespace => $paths) {
$exportedPaths = array();
foreach ($paths as $path) {
$exportedPaths[] = $this->getPathCode($filesystem, $basePath, $vendorPath, $path);
}
$exportedPrefix = var_export($namespace, true);
$psr4File .= " $exportedPrefix => ";
$psr4File .= "array(".implode(', ', $exportedPaths)."),\n";
}
$psr4File .= ");\n";
$classmapFile = <<<EOF
<?php
// autoload_classmap.php @generated by Composer
\$vendorDir = $vendorPathCode52;
\$baseDir = $appBaseDirCode;
return array(
EOF;
$targetDirLoader = null;
$mainAutoload = $mainPackage->getAutoload();
if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
$levels = substr_count($filesystem->normalizePath($mainPackage->getTargetDir()), '/') + 1;
$prefixes = implode(', ', array_map(function ($prefix) {
return var_export($prefix, true);
}, array_keys($mainAutoload['psr-0'])));
$baseDirFromTargetDirCode = $filesystem->findShortestPathCode($targetDir, $basePath, true);
$targetDirLoader = <<<EOF
public static function autoload(\$class)
{
\$dir = $baseDirFromTargetDirCode . '/';
\$prefixes = array($prefixes);
foreach (\$prefixes as \$prefix) {
if (0 !== strpos(\$class, \$prefix)) {
continue;
}
\$path = \$dir . implode('/', array_slice(explode('\\\\', \$class), $levels)).'.php';
if (!\$path = stream_resolve_include_path(\$path)) {
return false;
}
require \$path;
return true;
}
}
EOF;
}
$excluded = null;
if (!empty($autoloads['exclude-from-classmap'])) {
$excluded = '{(' . implode('|', $autoloads['exclude-from-classmap']) . ')}';
}
$classMap = array();
$ambiguousClasses = array();
$scannedFiles = array();
foreach ($autoloads['classmap'] as $dir) {
$classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $excluded, null, null, $classMap, $ambiguousClasses, $scannedFiles);
}
if ($scanPsrPackages) {
$namespacesToScan = array();
foreach (array('psr-4', 'psr-0') as $psrType) {
foreach ($autoloads[$psrType] as $namespace => $paths) {
$namespacesToScan[$namespace][] = array('paths' => $paths, 'type' => $psrType);
}
}
krsort($namespacesToScan);
foreach ($namespacesToScan as $namespace => $groups) {
foreach ($groups as $group) {
foreach ($group['paths'] as $dir) {
$dir = $filesystem->normalizePath($filesystem->isAbsolutePath($dir) ? $dir : $basePath.'/'.$dir);
if (!is_dir($dir)) {
continue;
}
$classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $excluded, $namespace, $group['type'], $classMap, $ambiguousClasses, $scannedFiles);
}
}
}
}
foreach ($ambiguousClasses as $className => $ambigiousPaths) {
$cleanPath = str_replace(array('$vendorDir . \'', '$baseDir . \'', "',\n"), array($vendorPath, $basePath, ''), $classMap[$className]);
$this->io->writeError(
'<warning>Warning: Ambiguous class resolution, "'.$className.'"'.
' was found '. (count($ambigiousPaths) + 1) .'x: in "'.$cleanPath.'" and "'. implode('", "', $ambigiousPaths) .'", the first will be used.</warning>'
);
}
$classMap['Composer\\InstalledVersions'] = "\$vendorDir . '/composer/InstalledVersions.php',\n";
ksort($classMap);
foreach ($classMap as $class => $code) {
$classmapFile .= ' '.var_export($class, true).' => '.$code;
}
$classmapFile .= ");\n";
if (!$suffix) {
if (!$config->get('autoloader-suffix') && is_readable($vendorPath.'/autoload.php')) {
$content = file_get_contents($vendorPath.'/autoload.php');
if (preg_match('{ComposerAutoloaderInit([^:\s]+)::}', $content, $match)) {
$suffix = $match[1];
}
}
if (!$suffix) {
$suffix = $config->get('autoloader-suffix') ?: md5(uniqid('', true));
}
}
$filesystem->filePutContentsIfModified($targetDir.'/autoload_namespaces.php', $namespacesFile);
$filesystem->filePutContentsIfModified($targetDir.'/autoload_psr4.php', $psr4File);
$filesystem->filePutContentsIfModified($targetDir.'/autoload_classmap.php', $classmapFile);
$includePathFilePath = $targetDir.'/include_paths.php';
if ($includePathFileContents = $this->getIncludePathsFile($packageMap, $filesystem, $basePath, $vendorPath, $vendorPathCode52, $appBaseDirCode)) {
$filesystem->filePutContentsIfModified($includePathFilePath, $includePathFileContents);
} elseif (file_exists($includePathFilePath)) {
unlink($includePathFilePath);
}
$includeFilesFilePath = $targetDir.'/autoload_files.php';
if ($includeFilesFileContents = $this->getIncludeFilesFile($autoloads['files'], $filesystem, $basePath, $vendorPath, $vendorPathCode52, $appBaseDirCode)) {
$filesystem->filePutContentsIfModified($includeFilesFilePath, $includeFilesFileContents);
} elseif (file_exists($includeFilesFilePath)) {
unlink($includeFilesFilePath);
}
$filesystem->filePutContentsIfModified($targetDir.'/autoload_static.php', $this->getStaticFile($suffix, $targetDir, $vendorPath, $basePath, $staticPhpVersion));
$checkPlatform = $config->get('platform-check') && $this->ignorePlatformReqs !== true;
$platformCheckContent = null;
if ($checkPlatform) {
$platformCheckContent = $this->getPlatformCheck($packageMap, $this->ignorePlatformReqs ?: array());
if (null === $platformCheckContent) {
$checkPlatform = false;
}
}
if ($checkPlatform) {
$filesystem->filePutContentsIfModified($targetDir.'/platform_check.php', $platformCheckContent);
} elseif (file_exists($targetDir.'/platform_check.php')) {
unlink($targetDir.'/platform_check.php');
}
$filesystem->filePutContentsIfModified($vendorPath.'/autoload.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
$filesystem->filePutContentsIfModified($targetDir.'/autoload_real.php', $this->getAutoloadRealFile(true, (bool) $includePathFileContents, $targetDirLoader, (bool) $includeFilesFileContents, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion, $checkPlatform));
$filesystem->safeCopy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
$filesystem->safeCopy(__DIR__.'/../../../LICENSE', $targetDir.'/LICENSE');
if ($this->runScripts) {
$this->eventDispatcher->dispatchScript(ScriptEvents::POST_AUTOLOAD_DUMP, $this->devMode, array(), array(
'optimize' => (bool) $scanPsrPackages,
));
}
return count($classMap);
}
private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $excluded, $namespaceFilter, $autoloadType, array $classMap, array &$ambiguousClasses, array &$scannedFiles)
{
foreach ($this->generateClassMap($dir, $excluded, $namespaceFilter, $autoloadType, true, $scannedFiles) as $class => $path) {
$pathCode = $this->getPathCode($filesystem, $basePath, $vendorPath, $path).",\n";
if (!isset($classMap[$class])) {
$classMap[$class] = $pathCode;
} elseif ($this->io && $classMap[$class] !== $pathCode && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class].' '.$path, '\\', '/'))) {
$ambiguousClasses[$class][] = $path;
}
}
return $classMap;
}
private function generateClassMap($dir, $excluded, $namespaceFilter, $autoloadType, $showAmbiguousWarning, array &$scannedFiles)
{
return ClassMapGenerator::createMap($dir, $excluded, $showAmbiguousWarning ? $this->io : null, $namespaceFilter, $autoloadType, $scannedFiles);
}
public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)
{
$packageMap = array(array($mainPackage, ''));
foreach ($packages as $package) {
if ($package instanceof AliasPackage) {
continue;
}
$this->validatePackage($package);
$packageMap[] = array(
$package,
$installationManager->getInstallPath($package),
);
}
return $packageMap;
}
protected function validatePackage(PackageInterface $package)
{
$autoload = $package->getAutoload();
if (!empty($autoload['psr-4']) && null !== $package->getTargetDir()) {
$name = $package->getName();
$package->getTargetDir();
throw new \InvalidArgumentException("PSR-4 autoloading is incompatible with the target-dir property, remove the target-dir in package '$name'.");
}
if (!empty($autoload['psr-4'])) {
foreach ($autoload['psr-4'] as $namespace => $dirs) {
if ($namespace !== '' && '\\' !== substr($namespace, -1)) {
throw new \InvalidArgumentException("psr-4 namespaces must end with a namespace separator, '$namespace' does not, use '$namespace\\'.");
}
}
}
}
public function parseAutoloads(array $packageMap, PackageInterface $mainPackage, $filterOutRequireDevPackages = false)
{
$mainPackageMap = array_shift($packageMap);
if ($filterOutRequireDevPackages) {
$packageMap = $this->filterPackageMap($packageMap, $mainPackage);
}
$sortedPackageMap = $this->sortPackageMap($packageMap);
$sortedPackageMap[] = $mainPackageMap;
array_unshift($packageMap, $mainPackageMap);
$psr0 = $this->parseAutoloadsType($packageMap, 'psr-0', $mainPackage);
$psr4 = $this->parseAutoloadsType($packageMap, 'psr-4', $mainPackage);
$classmap = $this->parseAutoloadsType(array_reverse($sortedPackageMap), 'classmap', $mainPackage);
$files = $this->parseAutoloadsType($sortedPackageMap, 'files', $mainPackage);
$exclude = $this->parseAutoloadsType($sortedPackageMap, 'exclude-from-classmap', $mainPackage);
krsort($psr0);
krsort($psr4);
return array(
'psr-0' => $psr0,
'psr-4' => $psr4,
'classmap' => $classmap,
'files' => $files,
'exclude-from-classmap' => $exclude,
);
}
public function createLoader(array $autoloads)
{
$loader = new ClassLoader();
if (isset($autoloads['psr-0'])) {
foreach ($autoloads['psr-0'] as $namespace => $path) {
$loader->add($namespace, $path);
}
}
if (isset($autoloads['psr-4'])) {
foreach ($autoloads['psr-4'] as $namespace => $path) {
$loader->addPsr4($namespace, $path);
}
}
if (isset($autoloads['classmap'])) {
$excluded = null;
if (!empty($autoloads['exclude-from-classmap'])) {
$excluded = '{(' . implode('|', $autoloads['exclude-from-classmap']) . ')}';
}
$scannedFiles = array();
foreach ($autoloads['classmap'] as $dir) {
try {
$loader->addClassMap($this->generateClassMap($dir, $excluded, null, null, false, $scannedFiles));
} catch (\RuntimeException $e) {
$this->io->writeError('<warning>'.$e->getMessage().'</warning>');
}
}
}
return $loader;
}
protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode)
{
$includePaths = array();
foreach ($packageMap as $item) {
list($package, $installPath) = $item;
if (null !== $package->getTargetDir() && strlen($package->getTargetDir()) > 0) {
$installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
}
foreach ($package->getIncludePaths() as $includePath) {
$includePath = trim($includePath, '/');
$includePaths[] = empty($installPath) ? $includePath : $installPath.'/'.$includePath;
}
}
if (!$includePaths) {
return;
}
$includePathsCode = '';
foreach ($includePaths as $path) {
$includePathsCode .= " " . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
}
return <<<EOF
<?php
// include_paths.php @generated by Composer
\$vendorDir = $vendorPathCode;
\$baseDir = $appBaseDirCode;
return array(
$includePathsCode);
EOF;
}
protected function getIncludeFilesFile(array $files, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode)
{
$filesCode = '';
foreach ($files as $fileIdentifier => $functionFile) {
$filesCode .= ' ' . var_export($fileIdentifier, true) . ' => '
. $this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile) . ",\n";
}
if (!$filesCode) {
return false;
}
return <<<EOF
<?php
// autoload_files.php @generated by Composer
\$vendorDir = $vendorPathCode;
\$baseDir = $appBaseDirCode;
return array(
$filesCode);
EOF;
}
protected function getPathCode(Filesystem $filesystem, $basePath, $vendorPath, $path)
{
if (!$filesystem->isAbsolutePath($path)) {
$path = $basePath . '/' . $path;
}
$path = $filesystem->normalizePath($path);
$baseDir = '';
if (strpos($path.'/', $vendorPath.'/') === 0) {
$path = substr($path, strlen($vendorPath));
$baseDir = '$vendorDir';
if ($path !== false) {
$baseDir .= " . ";
}
} else {
$path = $filesystem->normalizePath($filesystem->findShortestPath($basePath, $path, true));
if (!$filesystem->isAbsolutePath($path)) {
$baseDir = '$baseDir . ';
$path = '/' . $path;
}
}
if (strpos($path, '.phar') !== false) {
$baseDir = "'phar://' . " . $baseDir;
}
return $baseDir . (($path !== false) ? var_export($path, true) : "");
}
protected function getPlatformCheck($packageMap, array $ignorePlatformReqs)
{
$lowestPhpVersion = Bound::zero();
$requiredExtensions = array();
$extensionProviders = array();
foreach ($packageMap as $item) {
$package = $item[0];
foreach (array_merge($package->getReplaces(), $package->getProvides()) as $link) {
if (preg_match('{^ext-(.+)$}iD', $link->getTarget(), $match)) {
$extensionProviders[$match[1]][] = $link->getConstraint() ?: new MatchAllConstraint();
}
}
}
foreach ($packageMap as $item) {
$package = $item[0];
foreach ($package->getRequires() as $link) {
if (in_array($link->getTarget(), $ignorePlatformReqs, true)) {
continue;
}
if ('php' === $link->getTarget() && ($constraint = $link->getConstraint())) {
if ($constraint->getLowerBound()->compareTo($lowestPhpVersion, '>')) {
$lowestPhpVersion = $constraint->getLowerBound();
}
}
if (preg_match('{^ext-(.+)$}iD', $link->getTarget(), $match)) {
if (isset($extensionProviders[$match[1]])) {
foreach ($extensionProviders[$match[1]] as $provided) {
if (!$link->getConstraint() || $provided->matches($link->getConstraint())) {
continue 2;
}
}
}
if ($match[1] === 'zend-opcache') {
$match[1] = 'zend opcache';
}
$extension = var_export($match[1], true);
if ($match[1] === 'pcntl' || $match[1] === 'readline') {
$requiredExtensions[$extension] = "PHP_SAPI !== 'cli' || extension_loaded($extension) || \$missingExtensions[] = $extension;\n";
} else {
$requiredExtensions[$extension] = "extension_loaded($extension) || \$missingExtensions[] = $extension;\n";
}
}
}
}
ksort($requiredExtensions);
$formatToPhpVersionId = function (Bound $bound) {
if ($bound->isZero()) {
return 0;
}
if ($bound->isPositiveInfinity()) {
return 99999;
}
$version = str_replace('-', '.', $bound->getVersion());
$chunks = array_map('intval', explode('.', $version));
return $chunks[0] * 10000 + $chunks[1] * 100 + $chunks[2];
};
$formatToHumanReadable = function (Bound $bound) {
if ($bound->isZero()) {
return 0;
}
if ($bound->isPositiveInfinity()) {
return 99999;
}
$version = str_replace('-', '.', $bound->getVersion());
$chunks = explode('.', $version);
$chunks = array_slice($chunks, 0, 3);
return implode('.', $chunks);
};
$requiredPhp = '';
$requiredPhpError = '';
if (!$lowestPhpVersion->isZero()) {
$operator = $lowestPhpVersion->isInclusive() ? '>=' : '>';
$requiredPhp = 'PHP_VERSION_ID '.$operator.' '.$formatToPhpVersionId($lowestPhpVersion);
$requiredPhpError = '"'.$operator.' '.$formatToHumanReadable($lowestPhpVersion).'"';
}
if ($requiredPhp) {
$requiredPhp = <<<PHP_CHECK
if (!($requiredPhp)) {
\$issues[] = 'Your Composer dependencies require a PHP version $requiredPhpError. You are running ' . PHP_VERSION . '.';
}
PHP_CHECK;
}
$requiredExtensions = implode('', $requiredExtensions);
if ('' !== $requiredExtensions) {
$requiredExtensions = <<<EXT_CHECKS
\$missingExtensions = array();
$requiredExtensions
if (\$missingExtensions) {
\$issues[] = 'Your Composer dependencies require the following PHP extensions to be installed: ' . implode(', ', \$missingExtensions);
}
EXT_CHECKS;
}
if (!$requiredPhp && !$requiredExtensions) {
return null;
}
return <<<PLATFORM_CHECK
<?php
// platform_check.php @generated by Composer
\$issues = array();
${requiredPhp}${requiredExtensions}
if (\$issues) {
echo 'Composer detected issues in your platform:' . "\\n\\n" . implode("\\n", \$issues);
exit(104);
}
PLATFORM_CHECK;
}
protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix)
{
$lastChar = $vendorPathToTargetDirCode[strlen($vendorPathToTargetDirCode) - 1];
if ("'" === $lastChar || '"' === $lastChar) {
$vendorPathToTargetDirCode = substr($vendorPathToTargetDirCode, 0, -1).'/autoload_real.php'.$lastChar;
} else {
$vendorPathToTargetDirCode .= " . '/autoload_real.php'";
}
return <<<AUTOLOAD
<?php
// autoload.php @generated by Composer
require_once $vendorPathToTargetDirCode;
return ComposerAutoloaderInit$suffix::getLoader();
AUTOLOAD;
}
protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $useIncludeFiles, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion, $checkPlatform)
{
$file = <<<HEADER
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit$suffix
{
private static \$loader;
public static function loadClassLoader(\$class)
{
if ('Composer\\Autoload\\ClassLoader' === \$class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::\$loader) {
return self::\$loader;
}
HEADER;
if ($checkPlatform) {
$file .= <<<'PLATFORM_CHECK'
require __DIR__ . '/platform_check.php';
PLATFORM_CHECK;
}
$file .= <<<CLASSLOADER_INIT
spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'), true, $prependAutoloader);
self::\$loader = \$loader = new \\Composer\\Autoload\\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'));
CLASSLOADER_INIT;
if ($useIncludePath) {
$file .= <<<'INCLUDE_PATH'
$includePaths = require __DIR__ . '/include_paths.php';
$includePaths[] = get_include_path();
set_include_path(implode(PATH_SEPARATOR, $includePaths));
INCLUDE_PATH;
}
$file .= <<<STATIC_INIT
\$useStaticLoader = PHP_VERSION_ID >= $staticPhpVersion && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if (\$useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit$suffix::getInitializer(\$loader));
} else {
STATIC_INIT;
if (!$this->classMapAuthoritative) {
$file .= <<<'PSR04'
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
PSR04;
}
if ($useClassMap) {
$file .= <<<'CLASSMAP'
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
CLASSMAP;
}
$file .= " }\n\n";
if ($this->classMapAuthoritative) {
$file .= <<<'CLASSMAPAUTHORITATIVE'
$loader->setClassMapAuthoritative(true);
CLASSMAPAUTHORITATIVE;
}
if ($this->apcu) {
$apcuPrefix = var_export(($this->apcuPrefix !== null ? $this->apcuPrefix : substr(base64_encode(md5(uniqid('', true), true)), 0, -3)), true);
$file .= <<<APCU
\$loader->setApcuPrefix($apcuPrefix);
APCU;
}
if ($useGlobalIncludePath) {
$file .= <<<'INCLUDEPATH'
$loader->setUseIncludePath(true);
INCLUDEPATH;
}
if ($targetDirLoader) {
$file .= <<<REGISTER_TARGET_DIR_AUTOLOAD
spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true, true);
REGISTER_TARGET_DIR_AUTOLOAD;
}
$file .= <<<REGISTER_LOADER
\$loader->register($prependAutoloader);
REGISTER_LOADER;
if ($useIncludeFiles) {
$file .= <<<INCLUDE_FILES
if (\$useStaticLoader) {
\$includeFiles = Composer\Autoload\ComposerStaticInit$suffix::\$files;
} else {
\$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach (\$includeFiles as \$fileIdentifier => \$file) {
composerRequire$suffix(\$fileIdentifier, \$file);
}
INCLUDE_FILES;
}
$file .= <<<METHOD_FOOTER
return \$loader;
}
METHOD_FOOTER;
$file .= $targetDirLoader;
if ($useIncludeFiles) {
return $file . <<<FOOTER
}
function composerRequire$suffix(\$fileIdentifier, \$file)
{
if (empty(\$GLOBALS['__composer_autoload_files'][\$fileIdentifier])) {
require \$file;
\$GLOBALS['__composer_autoload_files'][\$fileIdentifier] = true;
}
}
FOOTER;
}
return $file . <<<FOOTER
}
FOOTER;
}
protected function getStaticFile($suffix, $targetDir, $vendorPath, $basePath, &$staticPhpVersion)
{
$staticPhpVersion = 50600;
$file = <<<HEADER
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit$suffix
{
HEADER;
$loader = new ClassLoader();
$map = require $targetDir . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require $targetDir . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require $targetDir . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
$filesystem = new Filesystem();
$vendorPathCode = ' => ' . $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true, true) . " . '/";
$vendorPharPathCode = ' => \'phar://\' . ' . $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true, true) . " . '/";
$appBaseDirCode = ' => ' . $filesystem->findShortestPathCode(realpath($targetDir), $basePath, true, true) . " . '/";
$appBaseDirPharCode = ' => \'phar://\' . ' . $filesystem->findShortestPathCode(realpath($targetDir), $basePath, true, true) . " . '/";
$absoluteVendorPathCode = ' => ' . substr(var_export(rtrim($vendorDir, '\\/') . '/', true), 0, -1);
$absoluteVendorPharPathCode = ' => ' . substr(var_export(rtrim('phar://' . $vendorDir, '\\/') . '/', true), 0, -1);
$absoluteAppBaseDirCode = ' => ' . substr(var_export(rtrim($baseDir, '\\/') . '/', true), 0, -1);
$absoluteAppBaseDirPharCode = ' => ' . substr(var_export(rtrim('phar://' . $baseDir, '\\/') . '/', true), 0, -1);
$initializer = '';
$prefix = "\0Composer\Autoload\ClassLoader\0";
$prefixLen = strlen($prefix);
if (file_exists($targetDir . '/autoload_files.php')) {
$maps = array('files' => require $targetDir . '/autoload_files.php');
} else {
$maps = array();
}
foreach ((array) $loader as $prop => $value) {
if ($value && 0 === strpos($prop, $prefix)) {
$maps[substr($prop, $prefixLen)] = $value;
}
}
foreach ($maps as $prop => $value) {
if (count($value) > 32767) {
$staticPhpVersion = 70000;
}
$value = strtr(
var_export($value, true),
array(
$absoluteVendorPathCode => $vendorPathCode,
$absoluteVendorPharPathCode => $vendorPharPathCode,
$absoluteAppBaseDirCode => $appBaseDirCode,
$absoluteAppBaseDirPharCode => $appBaseDirPharCode,
)
);
$value = ltrim(preg_replace('/^ */m', ' $0$0', $value));
$file .= sprintf(" public static $%s = %s;\n\n", $prop, $value);
if ('files' !== $prop) {
$initializer .= " \$loader->$prop = ComposerStaticInit$suffix::\$$prop;\n";
}
}
return $file . <<<INITIALIZER
public static function getInitializer(ClassLoader \$loader)
{
return \Closure::bind(function () use (\$loader) {
$initializer
}, null, ClassLoader::class);
}
}
INITIALIZER;
}
protected function parseAutoloadsType(array $packageMap, $type, PackageInterface $mainPackage)
{
$autoloads = array();
foreach ($packageMap as $item) {
list($package, $installPath) = $item;
$autoload = $package->getAutoload();
if ($this->devMode && $package === $mainPackage) {
$autoload = array_merge_recursive($autoload, $package->getDevAutoload());
}
if (!isset($autoload[$type]) || !is_array($autoload[$type])) {
continue;
}
if (null !== $package->getTargetDir() && $package !== $mainPackage) {
$installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
}
foreach ($autoload[$type] as $namespace => $paths) {
foreach ((array) $paths as $path) {
if (($type === 'files' || $type === 'classmap' || $type === 'exclude-from-classmap') && $package->getTargetDir() && !is_readable($installPath.'/'.$path)) {
if ($package === $mainPackage) {
$targetDir = str_replace('\\<dirsep\\>', '[\\\\/]', preg_quote(str_replace(array('/', '\\'), '<dirsep>', $package->getTargetDir())));
$path = ltrim(preg_replace('{^'.$targetDir.'}', '', ltrim($path, '\\/')), '\\/');
} else {
$path = $package->getTargetDir() . '/' . $path;
}
}
if ($type === 'exclude-from-classmap') {
$path = preg_replace('{/+}', '/', preg_quote(trim(strtr($path, '\\', '/'), '/')));
$path = strtr($path, array('\\*\\*' => '.+?', '\\*' => '[^/]+?'));
$updir = null;
$path = preg_replace_callback(
'{^((?:(?:\\\\\\.){1,2}+/)+)}',
function ($matches) use (&$updir) {
if (isset($matches[1])) {
$updir = str_replace('\\.', '.', $matches[1]);
}
return '';
},
$path
);
if (empty($installPath)) {
$installPath = strtr(getcwd(), '\\', '/');
}
$resolvedPath = realpath($installPath . '/' . $updir);
$autoloads[] = preg_quote(strtr($resolvedPath, '\\', '/')) . '/' . $path . '($|/)';
continue;
}
$relativePath = empty($installPath) ? (empty($path) ? '.' : $path) : $installPath.'/'.$path;
if ($type === 'files') {
$autoloads[$this->getFileIdentifier($package, $path)] = $relativePath;
continue;
}
if ($type === 'classmap') {
$autoloads[] = $relativePath;
continue;
}
$autoloads[$namespace][] = $relativePath;
}
}
}
return $autoloads;
}
protected function getFileIdentifier(PackageInterface $package, $path)
{
return md5($package->getName() . ':' . $path);
}
protected function filterPackageMap(array $packageMap, PackageInterface $mainPackage)
{
$packages = array();
$include = array();
$replacedBy = array();
foreach ($packageMap as $item) {
$package = $item[0];
$name = $package->getName();
$packages[$name] = $package;
foreach ($package->getReplaces() as $replace) {
$replacedBy[$replace->getTarget()] = $name;
}
}
$add = function (PackageInterface $package) use (&$add, $packages, &$include, $replacedBy) {
foreach ($package->getRequires() as $link) {
$target = $link->getTarget();
if (isset($replacedBy[$target])) {
$target = $replacedBy[$target];
}
if (!isset($include[$target])) {
$include[$target] = true;
if (isset($packages[$target])) {
$add($packages[$target]);
}
}
}
};
$add($mainPackage);
return array_filter(
$packageMap,
function ($item) use ($include) {
$package = $item[0];
foreach ($package->getNames() as $name) {
if (isset($include[$name])) {
return true;
}
}
return false;
}
);
}
protected function sortPackageMap(array $packageMap)
{
$packages = array();
$paths = array();
foreach ($packageMap as $item) {
list($package, $path) = $item;
$name = $package->getName();
$packages[$name] = $package;
$paths[$name] = $path;
}
$sortedPackages = PackageSorter::sortPackages($packages);
$sortedPackageMap = array();
foreach ($sortedPackages as $package) {
$name = $package->getName();
$sortedPackageMap[] = array($packages[$name], $paths[$name]);
}
return $sortedPackageMap;
}
}
<?php
namespace Composer\Autoload;
use Symfony\Component\Finder\Finder;
use Composer\IO\IOInterface;
use Composer\Util\Filesystem;
class ClassMapGenerator
{
public static function dump($dirs, $file)
{
$maps = array();
foreach ($dirs as $dir) {
$maps = array_merge($maps, static::createMap($dir));
}
file_put_contents($file, sprintf('<?php return %s;', var_export($maps, true)));
}
public static function createMap($path, $excluded = null, IOInterface $io = null, $namespace = null, $autoloadType = null, &$scannedFiles = array())
{
$basePath = $path;
if (is_string($path)) {
if (is_file($path)) {
$path = array(new \SplFileInfo($path));
} elseif (is_dir($path) || strpos($path, '*') !== false) {
$path = Finder::create()->files()->followLinks()->name('/\.(php|inc|hh)$/')->in($path);
} else {
throw new \RuntimeException(
'Could not scan for classes inside "'.$path.
'" which does not appear to be a file nor a folder'
);
}
} elseif (null !== $autoloadType) {
throw new \RuntimeException('Path must be a string when specifying an autoload type');
}
$map = array();
$filesystem = new Filesystem();
$cwd = realpath(getcwd());
foreach ($path as $file) {
$filePath = $file->getPathname();
if (!in_array(pathinfo($filePath, PATHINFO_EXTENSION), array('php', 'inc', 'hh'))) {
continue;
}
if (!$filesystem->isAbsolutePath($filePath)) {
$filePath = $cwd . '/' . $filePath;
$filePath = $filesystem->normalizePath($filePath);
} else {
$filePath = preg_replace('{[\\\\/]{2,}}', '/', $filePath);
}
$realPath = realpath($filePath);
if (isset($scannedFiles[$realPath])) {
continue;
}
if ($excluded && preg_match($excluded, strtr($realPath, '\\', '/'))) {
continue;
}
if ($excluded && preg_match($excluded, strtr($filePath, '\\', '/'))) {
continue;
}
$classes = self::findClasses($filePath);
if (null !== $autoloadType) {
$classes = self::filterByNamespace($classes, $filePath, $namespace, $autoloadType, $basePath, $io);
if ($classes) {
$scannedFiles[$realPath] = true;
}
} else {
$scannedFiles[$realPath] = true;
}
foreach ($classes as $class) {
if (null === $autoloadType && null !== $namespace && '' !== $namespace && 0 !== strpos($class, $namespace)) {
continue;
}
if (!isset($map[$class])) {
$map[$class] = $filePath;
} elseif ($io && $map[$class] !== $filePath && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($map[$class].' '.$filePath, '\\', '/'))) {
$io->writeError(
'<warning>Warning: Ambiguous class resolution, "'.$class.'"'.
' was found in both "'.$map[$class].'" and "'.$filePath.'", the first will be used.</warning>'
);
}
}
}
return $map;
}
private static function filterByNamespace($classes, $filePath, $baseNamespace, $namespaceType, $basePath, $io)
{
$validClasses = array();
$rejectedClasses = array();
$realSubPath = substr($filePath, strlen($basePath) + 1);
$realSubPath = substr($realSubPath, 0, strrpos($realSubPath, '.'));
foreach ($classes as $class) {
if ('' !== $baseNamespace && 0 !== strpos($class, $baseNamespace)) {
continue;
}
if ('psr-0' === $namespaceType) {
$namespaceLength = strrpos($class, '\\');
if (false !== $namespaceLength) {
$namespace = substr($class, 0, $namespaceLength + 1);
$className = substr($class, $namespaceLength + 1);
$subPath = str_replace('\\', DIRECTORY_SEPARATOR, $namespace)
. str_replace('_', DIRECTORY_SEPARATOR, $className);
}
else {
$subPath = str_replace('_', DIRECTORY_SEPARATOR, $class);
}
} elseif ('psr-4' === $namespaceType) {
$subNamespace = ('' !== $baseNamespace) ? substr($class, strlen($baseNamespace)) : $class;
$subPath = str_replace('\\', DIRECTORY_SEPARATOR, $subNamespace);
} else {
throw new \RuntimeException("namespaceType must be psr-0 or psr-4, $namespaceType given");
}
if ($subPath === $realSubPath) {
$validClasses[] = $class;
} else {
$rejectedClasses[] = $class;
}
}
if (empty($validClasses)) {
foreach ($rejectedClasses as $class) {
if ($io) {
$io->writeError("<warning>Class $class located in ".preg_replace('{^'.preg_quote(getcwd()).'}', '.', $filePath, 1)." does not comply with $namespaceType autoloading standard. Skipping.</warning>");
}
}
return array();
}
return $validClasses;
}
private static function findClasses($path)
{
$extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait';
if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>=')) {
$extraTypes .= '|enum';
}
$contents = @php_strip_whitespace($path);
if (!$contents) {
if (!file_exists($path)) {
$message = 'File at "%s" does not exist, check your classmap definitions';
} elseif (!is_readable($path)) {
$message = 'File at "%s" is not readable, check its permissions';
} elseif ('' === trim(file_get_contents($path))) {
return array();
} else {
$message = 'File at "%s" could not be parsed as PHP, it may be binary or corrupted';
}
$error = error_get_last();
if (isset($error['message'])) {
$message .= PHP_EOL . 'The following message may be helpful:' . PHP_EOL . $error['message'];
}
throw new \RuntimeException(sprintf($message, $path));
}
if (!preg_match('{\b(?:class|interface'.$extraTypes.')\s}i', $contents)) {
return array();
}
$contents = preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)(?:\s*)\\2(?=\s+|[;,.)])}s', 'null', $contents);
$contents = preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\\]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents);
if (strpos($contents, '<?') !== 0) {
$contents = preg_replace('{^.+?<\?}s', '<?', $contents, 1, $replacements);
if ($replacements === 0) {
return array();
}
}
$contents = preg_replace('{\?>(?:[^<]++|<(?!\?))*+<\?}s', '?><?', $contents);
$pos = strrpos($contents, '?>');
if (false !== $pos && false === strpos(substr($contents, $pos), '<?')) {
$contents = substr($contents, 0, $pos);
}
if (preg_match('{(<\?)(?!(php|hh))}i', $contents)) {
$contents = preg_replace('{//.* | /\*(?:[^*]++|\*(?!/))*\*/}x', '', $contents);
}
preg_match_all('{
(?:
\b(?<![\$:>])(?P<type>class|interface'.$extraTypes.') \s++ (?P<name>[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+)
| \b(?<![\$:>])(?P<ns>namespace) (?P<nsname>\s++[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\s*+\\\\\s*+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)*+)? \s*+ [\{;]
)
}ix', $contents, $matches);
$classes = array();
$namespace = '';
for ($i = 0, $len = count($matches['type']); $i < $len; $i++) {
if (!empty($matches['ns'][$i])) {
$namespace = str_replace(array(' ', "\t", "\r", "\n"), '', $matches['nsname'][$i]) . '\\';
} else {
$name = $matches['name'][$i];
if ($name === 'extends' || $name === 'implements') {
continue;
}
if ($name[0] === ':') {
$name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1);
} elseif ($matches['type'][$i] === 'enum') {
$name = rtrim($name, ':');
}
$classes[] = ltrim($namespace . $name, '\\');
}
}
return $classes;
}
}
<?php
namespace Composer;
use Composer\IO\IOInterface;
use Composer\Util\Filesystem;
use Composer\Util\Silencer;
use Symfony\Component\Finder\Finder;
class Cache
{
private static $cacheCollected = false;
private $io;
private $root;
private $enabled = true;
private $allowlist;
private $filesystem;
private $readOnly;
public function __construct(IOInterface $io, $cacheDir, $allowlist = 'a-z0-9.', Filesystem $filesystem = null, $readOnly = false)
{
$this->io = $io;
$this->root = rtrim($cacheDir, '/\\') . '/';
$this->allowlist = $allowlist;
$this->filesystem = $filesystem ?: new Filesystem();
$this->readOnly = (bool) $readOnly;
if (!self::isUsable($cacheDir)) {
$this->enabled = false;
return;
}
if (
(!is_dir($this->root) && !Silencer::call('mkdir', $this->root, 0777, true))
|| !is_writable($this->root)
) {
$this->io->writeError('<warning>Cannot create cache directory ' . $this->root . ', or directory is not writable. Proceeding without cache</warning>');
$this->enabled = false;
}
}
public function setReadOnly($readOnly)
{
$this->readOnly = (bool) $readOnly;
}
public function isReadOnly()
{
return $this->readOnly;
}
public static function isUsable($path)
{
return !preg_match('{(^|[\\\\/])(\$null|nul|NUL|/dev/null)([\\\\/]|$)}', $path);
}
public function isEnabled()
{
return $this->enabled;
}
public function getRoot()
{
return $this->root;
}
public function read($file)
{
if ($this->enabled) {
$file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
$this->io->writeError('Reading '.$this->root . $file.' from cache', true, IOInterface::DEBUG);
return file_get_contents($this->root . $file);
}
}
return false;
}
public function write($file, $contents)
{
if ($this->enabled && !$this->readOnly) {
$file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
$this->io->writeError('Writing '.$this->root . $file.' into cache', true, IOInterface::DEBUG);
try {
return file_put_contents($this->root . $file, $contents);
} catch (\ErrorException $e) {
$this->io->writeError('<warning>Failed to write into cache: '.$e->getMessage().'</warning>', true, IOInterface::DEBUG);
if (preg_match('{^file_put_contents\(\): Only ([0-9]+) of ([0-9]+) bytes written}', $e->getMessage(), $m)) {
unlink($this->root . $file);
$message = sprintf(
'<warning>Writing %1$s into cache failed after %2$u of %3$u bytes written, only %4$u bytes of free space available</warning>',
$this->root . $file,
$m[1],
$m[2],
@disk_free_space($this->root . dirname($file))
);
$this->io->writeError($message);
return false;
}
throw $e;
}
}
return false;
}
public function copyFrom($file, $source)
{
if ($this->enabled && !$this->readOnly) {
$file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
$this->filesystem->ensureDirectoryExists(dirname($this->root . $file));
if (!file_exists($source)) {
$this->io->writeError('<error>'.$source.' does not exist, can not write into cache</error>');
} elseif ($this->io->isDebug()) {
$this->io->writeError('Writing '.$this->root . $file.' into cache from '.$source);
}
return copy($source, $this->root . $file);
}
return false;
}
public function copyTo($file, $target)
{
if ($this->enabled) {
$file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
try {
touch($this->root . $file, filemtime($this->root . $file), time());
} catch (\ErrorException $e) {
Silencer::call('touch', $this->root . $file);
}
$this->io->writeError('Reading '.$this->root . $file.' from cache', true, IOInterface::DEBUG);
return copy($this->root . $file, $target);
}
}
return false;
}
public function gcIsNecessary()
{
return (!self::$cacheCollected && !mt_rand(0, 50));
}
public function remove($file)
{
if ($this->enabled) {
$file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
return $this->filesystem->unlink($this->root . $file);
}
}
return false;
}
public function clear()
{
if ($this->enabled) {
$this->filesystem->emptyDirectory($this->root);
return true;
}
return false;
}
public function gc($ttl, $maxSize)
{
if ($this->enabled) {
$expire = new \DateTime();
$expire->modify('-'.$ttl.' seconds');
$finder = $this->getFinder()->date('until '.$expire->format('Y-m-d H:i:s'));
foreach ($finder as $file) {
$this->filesystem->unlink($file->getPathname());
}
$totalSize = $this->filesystem->size($this->root);
if ($totalSize > $maxSize) {
$iterator = $this->getFinder()->sortByAccessedTime()->getIterator();
while ($totalSize > $maxSize && $iterator->valid()) {
$filepath = $iterator->current()->getPathname();
$totalSize -= $this->filesystem->size($filepath);
$this->filesystem->unlink($filepath);
$iterator->next();
}
}
self::$cacheCollected = true;
return true;
}
return false;
}
public function sha1($file)
{
if ($this->enabled) {
$file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
return sha1_file($this->root . $file);
}
}
return false;
}
public function sha256($file)
{
if ($this->enabled) {
$file = preg_replace('{[^'.$this->allowlist.']}i', '-', $file);
if (file_exists($this->root . $file)) {
return hash_file('sha256', $this->root . $file);
}
}
return false;
}
protected function getFinder()
{
return Finder::create()->in($this->root)->files();
}
}
<?php
namespace Composer\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class AboutCommand extends BaseCommand
{
protected function configure()
{
$this
->setName('about')
->setDescription('Shows the short information about Composer.')
->setHelp(
<<<EOT
<info>php composer.phar about</info>
EOT
)
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->getIO()->write(
<<<EOT
<info>Composer - Dependency Manager for PHP</info>
<comment>Composer is a dependency manager tracking local dependencies of your projects and libraries.
See https://getcomposer.org/ for more information.</comment>
EOT
);
return 0;
}
}
<?php
namespace Composer\Command;
use Composer\Factory;
use Composer\IO\IOInterface;
use Composer\Config;
use Composer\Composer;
use Composer\Repository\CompositeRepository;
use Composer\Repository\RepositoryFactory;
use Composer\Script\ScriptEvents;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
use Composer\Util\Filesystem;
use Composer\Util\Loop;
use Composer\Util\ProcessExecutor;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class ArchiveCommand extends BaseCommand
{
protected function configure()
{
$this
->setName('archive')
->setDescription('Creates an archive of this composer package.')
->setDefinition(array(
new InputArgument('package', InputArgument::OPTIONAL, 'The package to archive instead of the current project'),
new InputArgument('version', InputArgument::OPTIONAL, 'A version constraint to find the package to archive'),
new InputOption('format', 'f', InputOption::VALUE_REQUIRED, 'Format of the resulting archive: tar or zip'),
new InputOption('dir', null, InputOption::VALUE_REQUIRED, 'Write the archive to this directory'),
new InputOption('file', null, InputOption::VALUE_REQUIRED, 'Write the archive with the given file name.'
.' Note that the format will be appended.'),
new InputOption('ignore-filters', false, InputOption::VALUE_NONE, 'Ignore filters when saving package'),
))
->setHelp(
<<<EOT
The <info>archive</info> command creates an archive of the specified format
containing the files and directories of the Composer project or the specified
package in the specified version and writes it to the specified directory.
<info>php composer.phar archive [--format=zip] [--dir=/foo] [package [version]]</info>
Read more at https://getcomposer.org/doc/03-cli.md#archive
EOT
)
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$composer = $this->getComposer(false);
$config = null;
if ($composer) {
$config = $composer->getConfig();
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'archive', $input, $output);
$eventDispatcher = $composer->getEventDispatcher();
$eventDispatcher->dispatch($commandEvent->getName(), $commandEvent);
$eventDispatcher->dispatchScript(ScriptEvents::PRE_ARCHIVE_CMD);
}
if (!$config) {
$config = Factory::createConfig();
}
if (null === $input->getOption('format')) {
$input->setOption('format', $config->get('archive-format'));
}
if (null === $input->getOption('dir')) {
$input->setOption('dir', $config->get('archive-dir'));
}
$returnCode = $this->archive(
$this->getIO(),
$config,
$input->getArgument('package'),
$input->getArgument('version'),
$input->getOption('format'),
$input->getOption('dir'),
$input->getOption('file'),
$input->getOption('ignore-filters'),
$composer
);
if (0 === $returnCode && $composer) {
$composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_ARCHIVE_CMD);
}
return $returnCode;
}
protected function archive(IOInterface $io, Config $config, $packageName = null, $version = null, $format = 'tar', $dest = '.', $fileName = null, $ignoreFilters = false, Composer $composer = null)
{
if ($composer) {
$archiveManager = $composer->getArchiveManager();
} else {
$factory = new Factory;
$process = new ProcessExecutor();
$httpDownloader = Factory::createHttpDownloader($io, $config);
$downloadManager = $factory->createDownloadManager($io, $config, $httpDownloader, $process);
$archiveManager = $factory->createArchiveManager($config, $downloadManager, new Loop($httpDownloader, $process));
}
if ($packageName) {
$package = $this->selectPackage($io, $packageName, $version);
if (!$package) {
return 1;
}
} else {
$package = $this->getComposer()->getPackage();
}
$io->writeError('<info>Creating the archive into "'.$dest.'".</info>');
$packagePath = $archiveManager->archive($package, $format, $dest, $fileName, $ignoreFilters);
$fs = new Filesystem;
$shortPath = $fs->findShortestPath(getcwd(), $packagePath, true);
$io->writeError('Created: ', false);
$io->write(strlen($shortPath) < strlen($packagePath) ? $shortPath : $packagePath);
return 0;
}
protected function selectPackage(IOInterface $io, $packageName, $version = null)
{
$io->writeError('<info>Searching for the specified package.</info>');
if ($composer = $this->getComposer(false)) {
$localRepo = $composer->getRepositoryManager()->getLocalRepository();
$repo = new CompositeRepository(array_merge(array($localRepo), $composer->getRepositoryManager()->getRepositories()));
} else {
$defaultRepos = RepositoryFactory::defaultRepos($this->getIO());
$io->writeError('No composer.json found in the current directory, searching packages from ' . implode(', ', array_keys($defaultRepos)));
$repo = new CompositeRepository($defaultRepos);
}
$packages = $repo->findPackages($packageName, $version);
if (count($packages) > 1) {
$package = reset($packages);
$io->writeError('<info>Found multiple matches, selected '.$package->getPrettyString().'.</info>');
$io->writeError('Alternatives were '.implode(', ', array_map(function ($p) {
return $p->getPrettyString();
}, $packages)).'.');
$io->writeError('<comment>Please use a more specific constraint to pick a different package.</comment>');
} elseif ($packages) {
$package = reset($packages);
$io->writeError('<info>Found an exact match '.$package->getPrettyString().'.</info>');
} else {
$io->writeError('<error>Could not find a package matching '.$packageName.'.</error>');
return false;
}
return $package;
}
}
<?php
namespace Composer\Command;
use Composer\Composer;
use Composer\Config;
use Composer\Console\Application;
use Composer\Factory;
use Composer\IO\IOInterface;
use Composer\IO\NullIO;
use Composer\Plugin\PreCommandRunEvent;
use Composer\Package\Version\VersionParser;
use Composer\Plugin\PluginEvents;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Command\Command;
abstract class BaseCommand extends Command
{
private $composer;
private $io;
public function getComposer($required = true, $disablePlugins = null)
{
if (null === $this->composer) {
$application = $this->getApplication();
if ($application instanceof Application) {
$this->composer = $application->getComposer($required, $disablePlugins);
} elseif ($required) {
throw new \RuntimeException(
'Could not create a Composer\Composer instance, you must inject '.
'one if this command is not used with a Composer\Console\Application instance'
);
}
}
return $this->composer;
}
public function setComposer(Composer $composer)
{
$this->composer = $composer;
}
public function resetComposer()
{
$this->composer = null;
$this->getApplication()->resetComposer();
}
public function isProxyCommand()
{
return false;
}
public function getIO()
{
if (null === $this->io) {
$application = $this->getApplication();
if ($application instanceof Application) {
$this->io = $application->getIO();
} else {
$this->io = new NullIO();
}
}
return $this->io;
}
public function setIO(IOInterface $io)
{
$this->io = $io;
}
protected function initialize(InputInterface $input, OutputInterface $output)
{
$disablePlugins = $input->hasParameterOption('--no-plugins');
$composer = $this->getComposer(false, $disablePlugins);
if (null === $composer) {
$composer = Factory::createGlobal($this->getIO(), $disablePlugins);
}
if ($composer) {
$preCommandRunEvent = new PreCommandRunEvent(PluginEvents::PRE_COMMAND_RUN, $input, $this->getName());
$composer->getEventDispatcher()->dispatch($preCommandRunEvent->getName(), $preCommandRunEvent);
}
if (true === $input->hasParameterOption(array('--no-ansi')) && $input->hasOption('no-progress')) {
$input->setOption('no-progress', true);
}
parent::initialize($input, $output);
}
protected function getPreferredInstallOptions(Config $config, InputInterface $input, $keepVcsRequiresPreferSource = false)
{
$preferSource = false;
$preferDist = false;
switch ($config->get('preferred-install')) {
case 'source':
$preferSource = true;
break;
case 'dist':
$preferDist = true;
break;
case 'auto':
default:
break;
}
if ($input->getOption('prefer-source') || $input->getOption('prefer-dist') || ($keepVcsRequiresPreferSource && $input->hasOption('keep-vcs') && $input->getOption('keep-vcs'))) {
$preferSource = $input->getOption('prefer-source') || ($keepVcsRequiresPreferSource && $input->hasOption('keep-vcs') && $input->getOption('keep-vcs'));
$preferDist = (bool) $input->getOption('prefer-dist');
}
return array($preferSource, $preferDist);
}
protected function formatRequirements(array $requirements)
{
$requires = array();
$requirements = $this->normalizeRequirements($requirements);
foreach ($requirements as $requirement) {
if (!isset($requirement['version'])) {
throw new \UnexpectedValueException('Option '.$requirement['name'] .' is missing a version constraint, use e.g. '.$requirement['name'].':^1.0');
}
$requires[$requirement['name']] = $requirement['version'];
}
return $requires;
}
protected function normalizeRequirements(array $requirements)
{
$parser = new VersionParser();
return $parser->parseNameVersionPairs($requirements);
}
protected function renderTable(array $table, OutputInterface $output)
{
$renderer = new Table($output);
$renderer->setStyle('compact');
$rendererStyle = $renderer->getStyle();
if (method_exists($rendererStyle, 'setVerticalBorderChars')) {
$rendererStyle->setVerticalBorderChars('');
} else {
$rendererStyle->setVerticalBorderChar('');
}
$rendererStyle->setCellRowContentFormat('%s ');
$renderer->setRows($table)->render();
}
}
<?php
namespace Composer\Command;
use Composer\Package\Link;
use Composer\Package\PackageInterface;
use Composer\Package\RootPackage;
use Composer\Repository\InstalledArrayRepository;
use Composer\Repository\CompositeRepository;
use Composer\Repository\RootPackageRepository;
use Composer\Repository\InstalledRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\RepositoryFactory;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
use Composer\Package\Version\VersionParser;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class BaseDependencyCommand extends BaseCommand
{
const ARGUMENT_PACKAGE = 'package';
const ARGUMENT_CONSTRAINT = 'constraint';
const OPTION_RECURSIVE = 'recursive';
const OPTION_TREE = 'tree';
protected $colors;
protected function configure()
{
$this->setDefinition(array(
new InputArgument(self::ARGUMENT_PACKAGE, InputArgument::REQUIRED, 'Package to inspect'),
new InputArgument(self::ARGUMENT_CONSTRAINT, InputArgument::OPTIONAL, 'Optional version constraint', '*'),
new InputOption(self::OPTION_RECURSIVE, 'r', InputOption::VALUE_NONE, 'Recursively resolves up to the root package'),
new InputOption(self::OPTION_TREE, 't', InputOption::VALUE_NONE, 'Prints the results as a nested tree'),
));
}
protected function doExecute(InputInterface $input, OutputInterface $output, $inverted = false)
{
$composer = $this->getComposer();
$commandEvent = new CommandEvent(PluginEvents::COMMAND, $this->getName(), $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
$platformOverrides = $composer->getConfig()->get('platform') ?: array();
$installedRepo = new InstalledRepository(array(
new RootPackageRepository($composer->getPackage()),
$composer->getRepositoryManager()->getLocalRepository(),
new PlatformRepository(array(), $platformOverrides),
));
list($needle, $textConstraint) = array_pad(
explode(':', $input->getArgument(self::ARGUMENT_PACKAGE)),
2,
$input->getArgument(self::ARGUMENT_CONSTRAINT)
);
$packages = $installedRepo->findPackagesWithReplacersAndProviders($needle);
if (empty($packages)) {
throw new \InvalidArgumentException(sprintf('Could not find package "%s" in your project', $needle));
}
if (!$installedRepo->findPackage($needle, $textConstraint)) {
$defaultRepos = new CompositeRepository(RepositoryFactory::defaultRepos($this->getIO()));
if ($match = $defaultRepos->findPackage($needle, $textConstraint)) {
$installedRepo->addRepository(new InstalledArrayRepository(array(clone $match)));
}
}
$needles = array($needle);
if ($inverted) {
foreach ($packages as $package) {
$needles = array_merge($needles, array_map(function (Link $link) {
return $link->getTarget();
}, $package->getReplaces()));
}
}
if ('*' !== $textConstraint) {
$versionParser = new VersionParser();
$constraint = $versionParser->parseConstraints($textConstraint);
} else {
$constraint = null;
}
$renderTree = $input->getOption(self::OPTION_TREE);
$recursive = $renderTree || $input->getOption(self::OPTION_RECURSIVE);
$results = $installedRepo->getDependents($needles, $constraint, $inverted, $recursive);
if (empty($results)) {
$extra = (null !== $constraint) ? sprintf(' in versions %smatching %s', $inverted ? 'not ' : '', $textConstraint) : '';
$this->getIO()->writeError(sprintf(
'<info>There is no installed package depending on "%s"%s</info>',
$needle,
$extra
));
} elseif ($renderTree) {
$this->initStyles($output);
$root = $packages[0];
$this->getIO()->write(sprintf('<info>%s</info> %s %s', $root->getPrettyName(), $root->getPrettyVersion(), $root->getDescription()));
$this->printTree($results);
} else {
$this->printTable($output, $results);
}
return 0;
}
protected function printTable(OutputInterface $output, $results)
{
$table = array();
$doubles = array();
do {
$queue = array();
$rows = array();
foreach ($results as $result) {
list($package, $link, $children) = $result;
$unique = (string) $link;
if (isset($doubles[$unique])) {
continue;
}
$doubles[$unique] = true;
$version = $package->getPrettyVersion() === RootPackage::DEFAULT_PRETTY_VERSION ? '-' : $package->getPrettyVersion();
$rows[] = array($package->getPrettyName(), $version, $link->getDescription(), sprintf('%s (%s)', $link->getTarget(), $link->getPrettyConstraint()));
if ($children) {
$queue = array_merge($queue, $children);
}
}
$results = $queue;
$table = array_merge($rows, $table);
} while (!empty($results));
$this->renderTable($table, $output);
}
protected function initStyles(OutputInterface $output)
{
$this->colors = array(
'green',
'yellow',
'cyan',
'magenta',
'blue',
);
foreach ($this->colors as $color) {
$style = new OutputFormatterStyle($color);
$output->getFormatter()->setStyle($color, $style);
}
}
protected function printTree($results, $prefix = '', $level = 1)
{
$count = count($results);
$idx = 0;
foreach ($results as $result) {
list($package, $link, $children) = $result;
$color = $this->colors[$level % count($this->colors)];
$prevColor = $this->colors[($level - 1) % count($this->colors)];
$isLast = (++$idx == $count);
$versionText = $package->getPrettyVersion() === RootPackage::DEFAULT_PRETTY_VERSION ? '' : $package->getPrettyVersion();
$packageText = rtrim(sprintf('<%s>%s</%1$s> %s', $color, $package->getPrettyName(), $versionText));
$linkText = sprintf('%s <%s>%s</%2$s> %s', $link->getDescription(), $prevColor, $link->getTarget(), $link->getPrettyConstraint());
$circularWarn = $children === false ? '(circular dependency aborted here)' : '';
$this->writeTreeLine(rtrim(sprintf("%s%s%s (%s) %s", $prefix, $isLast ? '└──' : '├──', $packageText, $linkText, $circularWarn)));
if ($children) {
$this->printTree($children, $prefix . ($isLast ? ' ' : '│ '), $level + 1);
}
}
}
private function writeTreeLine($line)
{
$io = $this->getIO();
if (!$io->isDecorated()) {
$line = str_replace(array('└', '├', '──', '│'), array('`-', '|-', '-', '|'), $line);
}
$io->write($line);
}
}
<?php
namespace Composer\Command;
use Composer\Package\Link;
use Composer\Package\PackageInterface;
use Composer\Semver\Constraint\Constraint;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Repository\PlatformRepository;
use Composer\Repository\RootPackageRepository;
use Composer\Repository\InstalledRepository;
class CheckPlatformReqsCommand extends BaseCommand
{
protected function configure()
{
$this->setName('check-platform-reqs')
->setDescription('Check that platform requirements are satisfied.')
->setDefinition(array(
new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables checking of require-dev packages requirements, implies --lock.'),
new InputOption('lock', null, InputOption::VALUE_NONE, 'Checks requirements only from the lock file, not from installed packages.'),
))
->setHelp(
<<<EOT
Checks that your PHP and extensions versions match the platform requirements of the installed packages.
Unlike update/install, this command will ignore config.platform settings and check the real platform packages so you can be certain you have the required platform dependencies.
<info>php composer.phar check-platform-reqs</info>
EOT
);
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$composer = $this->getComposer();
$requires = array();
if ($input->getOption('no-dev') || $input->getOption('lock')) {
if ($input->getOption('lock')) {
$this->getIO()->writeError('<info>Checking '.($input->getOption('no-dev') ? 'non-dev ' : '').'platform requirements using the lock file</info>');
} else {
$this->getIO()->writeError('<warning>The --no-dev option implies --lock, checking platform requirements from lock file instead of vendor dir</warning>');
}
$installedRepo = $composer->getLocker()->getLockedRepository(!$input->getOption('no-dev'));
} else {
$installedRepo = $composer->getRepositoryManager()->getLocalRepository();
if (!$installedRepo->getPackages()) {
$this->getIO()->writeError('<warning>No vendor dir present, checking platform requirements from the lock file</warning>');
$installedRepo = $composer->getLocker()->getLockedRepository(true);
} else {
$this->getIO()->writeError('<info>Checking platform requirements for packages in the vendor dir</info>');
}
}
if (!$input->getOption('no-dev')) {
$requires += $composer->getPackage()->getDevRequires();
}
foreach ($requires as $require => $link) {
$requires[$require] = array($link);
}
$installedRepo = new InstalledRepository(array($installedRepo, new RootPackageRepository($composer->getPackage())));
foreach ($installedRepo->getPackages() as $package) {
foreach ($package->getRequires() as $require => $link) {
$requires[$require][] = $link;
}
}
ksort($requires);
$installedRepo->addRepository(new PlatformRepository(array(), array()));
$results = array();
$exitCode = 0;
foreach ($requires as $require => $links) {
if (PlatformRepository::isPlatformPackage($require)) {
$candidates = $installedRepo->findPackagesWithReplacersAndProviders($require);
if ($candidates) {
$reqResults = array();
foreach ($candidates as $candidate) {
$candidateConstraint = null;
if ($candidate->getName() === $require) {
$candidateConstraint = new Constraint('=', $candidate->getVersion());
$candidateConstraint->setPrettyString($candidate->getPrettyVersion());
} else {
foreach (array_merge($candidate->getProvides(), $candidate->getReplaces()) as $link) {
if ($link->getTarget() === $require) {
$candidateConstraint = $link->getConstraint();
break;
}
}
}
if (!$candidateConstraint) {
continue;
}
foreach ($links as $link) {
if (!$link->getConstraint()->matches($candidateConstraint)) {
$reqResults[] = array(
$candidate->getName() === $require ? $candidate->getPrettyName() : $require,
$candidateConstraint->getPrettyString(),
$link,
'<error>failed</error>'.($candidate->getName() === $require ? '' : ' <comment>provided by '.$candidate->getPrettyName().'</comment>'),
);
continue 2;
}
}
$results[] = array(
$candidate->getName() === $require ? $candidate->getPrettyName() : $require,
$candidateConstraint->getPrettyString(),
null,
'<info>success</info>'.($candidate->getName() === $require ? '' : ' <comment>provided by '.$candidate->getPrettyName().'</comment>'),
);
continue 2;
}
$results = array_merge($results, $reqResults);
$exitCode = max($exitCode, 1);
continue;
}
$results[] = array(
$require,
'n/a',
$links[0],
'<error>missing</error>',
);
$exitCode = max($exitCode, 2);
}
}
$this->printTable($output, $results);
return $exitCode;
}
protected function printTable(OutputInterface $output, $results)
{
$rows = array();
foreach ($results as $result) {
list($platformPackage, $version, $link, $status) = $result;
$rows[] = array(
$platformPackage,
$version,
$link ? sprintf('%s %s %s (%s)', $link->getSource(), $link->getDescription(), $link->getTarget(), $link->getPrettyConstraint()) : '',
$status,
);
}
$this->renderTable($rows, $output);
}
}
<?php
namespace Composer\Command;
use Composer\Cache;
use Composer\Factory;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ClearCacheCommand extends BaseCommand
{
protected function configure()
{
$this
->setName('clear-cache')
->setAliases(array('clearcache', 'cc'))
->setDescription('Clears composer\'s internal package cache.')
->setHelp(
<<<EOT
The <info>clear-cache</info> deletes all cached packages from composer's
cache directory.
Read more at https://getcomposer.org/doc/03-cli.md#clear-cache-clearcache-cc
EOT
)
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$config = Factory::createConfig();
$io = $this->getIO();
$cachePaths = array(
'cache-vcs-dir' => $config->get('cache-vcs-dir'),
'cache-repo-dir' => $config->get('cache-repo-dir'),
'cache-files-dir' => $config->get('cache-files-dir'),
'cache-dir' => $config->get('cache-dir'),
);
foreach ($cachePaths as $key => $cachePath) {
$cachePath = realpath($cachePath);
if (!$cachePath) {
$io->writeError("<info>Cache directory does not exist ($key): $cachePath</info>");
continue;
}
$cache = new Cache($io, $cachePath);
$cache->setReadOnly($config->get('cache-read-only'));
if (!$cache->isEnabled()) {
$io->writeError("<info>Cache is not enabled ($key): $cachePath</info>");
continue;
}
$io->writeError("<info>Clearing cache ($key): $cachePath</info>");
$cache->clear();
}
$io->writeError('<info>All caches cleared.</info>');
return 0;
}
}
<?php
namespace Composer\Command;
use Composer\Util\Platform;
use Composer\Util\Silencer;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Config;
use Composer\Config\JsonConfigSource;
use Composer\Factory;
use Composer\IO\IOInterface;
use Composer\Json\JsonFile;
use Composer\Semver\VersionParser;
use Composer\Package\BasePackage;
class ConfigCommand extends BaseCommand
{
protected $config;
protected $configFile;
protected $configSource;
protected $authConfigFile;
protected $authConfigSource;
protected function configure()
{
$this
->setName('config')
->setDescription('Sets config options.')
->setDefinition(array(
new InputOption('global', 'g', InputOption::VALUE_NONE, 'Apply command to the global config file'),
new InputOption('editor', 'e', InputOption::VALUE_NONE, 'Open editor'),
new InputOption('auth', 'a', InputOption::VALUE_NONE, 'Affect auth config file (only used for --editor)'),
new InputOption('unset', null, InputOption::VALUE_NONE, 'Unset the given setting-key'),
new InputOption('list', 'l', InputOption::VALUE_NONE, 'List configuration settings'),
new InputOption('file', 'f', InputOption::VALUE_REQUIRED, 'If you want to choose a different composer.json or config.json'),
new InputOption('absolute', null, InputOption::VALUE_NONE, 'Returns absolute paths when fetching *-dir config values instead of relative'),
new InputOption('json', 'j', InputOption::VALUE_NONE, 'JSON decode the setting value, to be used with extra.* keys'),
new InputOption('merge', 'm', InputOption::VALUE_NONE, 'Merge the setting value with the current value, to be used with extra.* keys in combination with --json'),
new InputOption('append', null, InputOption::VALUE_NONE, 'When adding a repository, append it (lowest priority) to the existing ones instead of prepending it (highest priority)'),
new InputArgument('setting-key', null, 'Setting key'),
new InputArgument('setting-value', InputArgument::IS_ARRAY, 'Setting value'),
))
->setHelp(
<<<EOT
This command allows you to edit composer config settings and repositories
in either the local composer.json file or the global config.json file.
Additionally it lets you edit most properties in the local composer.json.
To set a config setting:
<comment>%command.full_name% bin-dir bin/</comment>
To read a config setting:
<comment>%command.full_name% bin-dir</comment>
Outputs: <info>bin</info>
To edit the global config.json file:
<comment>%command.full_name% --global</comment>
To add a repository:
<comment>%command.full_name% repositories.foo vcs https://bar.com</comment>
To remove a repository (repo is a short alias for repositories):
<comment>%command.full_name% --unset repo.foo</comment>
To disable packagist:
<comment>%command.full_name% repo.packagist false</comment>
You can alter repositories in the global config.json file by passing in the
<info>--global</info> option.
To add or edit suggested packages you can use:
<comment>%command.full_name% suggest.package reason for the suggestion</comment>
To add or edit extra properties you can use:
<comment>%command.full_name% extra.property value</comment>
Or to add a complex value you can use json with:
<comment>%command.full_name% extra.property --json '{"foo":true, "bar": []}'</comment>
To edit the file in an external editor:
<comment>%command.full_name% --editor</comment>
To choose your editor you can set the "EDITOR" env variable.
To get a list of configuration values in the file:
<comment>%command.full_name% --list</comment>
You can always pass more than one option. As an example, if you want to edit the
global config.json file.
<comment>%command.full_name% --editor --global</comment>
Read more at https://getcomposer.org/doc/03-cli.md#config
EOT
)
;
}
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
if ($input->getOption('global') && null !== $input->getOption('file')) {
throw new \RuntimeException('--file and --global can not be combined');
}
$io = $this->getIO();
$this->config = Factory::createConfig($io);
$configFile = $input->getOption('global')
? ($this->config->get('home') . '/config.json')
: ($input->getOption('file') ?: Factory::getComposerFile());
if (
($configFile === 'composer.json' || $configFile === './composer.json')
&& !file_exists($configFile)
&& realpath(getcwd()) === realpath($this->config->get('home'))
) {
file_put_contents($configFile, "{\n}\n");
}
$this->configFile = new JsonFile($configFile, null, $io);
$this->configSource = new JsonConfigSource($this->configFile);
$authConfigFile = $input->getOption('global')
? ($this->config->get('home') . '/auth.json')
: dirname(realpath($configFile)) . '/auth.json';
$this->authConfigFile = new JsonFile($authConfigFile, null, $io);
$this->authConfigSource = new JsonConfigSource($this->authConfigFile, true);
if ($input->getOption('global') && !$this->configFile->exists()) {
touch($this->configFile->getPath());
$this->configFile->write(array('config' => new \ArrayObject));
Silencer::call('chmod', $this->configFile->getPath(), 0600);
}
if ($input->getOption('global') && !$this->authConfigFile->exists()) {
touch($this->authConfigFile->getPath());
$this->authConfigFile->write(array('bitbucket-oauth' => new \ArrayObject, 'github-oauth' => new \ArrayObject, 'gitlab-oauth' => new \ArrayObject, 'gitlab-token' => new \ArrayObject, 'http-basic' => new \ArrayObject, 'bearer' => new \ArrayObject));
Silencer::call('chmod', $this->authConfigFile->getPath(), 0600);
}
if (!$this->configFile->exists()) {
throw new \RuntimeException(sprintf('File "%s" cannot be found in the current directory', $configFile));
}
}
protected function execute(InputInterface $input, OutputInterface $output)
{
if ($input->getOption('editor')) {
$editor = escapeshellcmd(getenv('EDITOR'));
if (!$editor) {
if (Platform::isWindows()) {
$editor = 'notepad';
} else {
foreach (array('editor', 'vim', 'vi', 'nano', 'pico', 'ed') as $candidate) {
if (exec('which '.$candidate)) {
$editor = $candidate;
break;
}
}
}
}
$file = $input->getOption('auth') ? $this->authConfigFile->getPath() : $this->configFile->getPath();
system($editor . ' ' . $file . (Platform::isWindows() ? '' : ' > `tty`'));
return 0;
}
if (!$input->getOption('global')) {
$this->config->merge($this->configFile->read());
$this->config->merge(array('config' => $this->authConfigFile->exists() ? $this->authConfigFile->read() : array()));
}
if ($input->getOption('list')) {
$this->listConfiguration($this->config->all(), $this->config->raw(), $output);
return 0;
}
$settingKey = $input->getArgument('setting-key');
if (!$settingKey || !is_string($settingKey)) {
return 0;
}
if (array() !== $input->getArgument('setting-value') && $input->getOption('unset')) {
throw new \RuntimeException('You can not combine a setting value with --unset');
}
if (array() === $input->getArgument('setting-value') && !$input->getOption('unset')) {
$properties = array('name', 'type', 'description', 'homepage', 'version', 'minimum-stability', 'prefer-stable', 'keywords', 'license', 'extra');
$rawData = $this->configFile->read();
$data = $this->config->all();
if (preg_match('/^repos?(?:itories)?(?:\.(.+))?/', $settingKey, $matches)) {
if (!isset($matches[1]) || $matches[1] === '') {
$value = isset($data['repositories']) ? $data['repositories'] : array();
} else {
if (!isset($data['repositories'][$matches[1]])) {
throw new \InvalidArgumentException('There is no '.$matches[1].' repository defined');
}
$value = $data['repositories'][$matches[1]];
}
} elseif (strpos($settingKey, '.')) {
$bits = explode('.', $settingKey);
if ($bits[0] === 'extra') {
$data = $rawData;
} else {
$data = $data['config'];
}
$match = false;
foreach ($bits as $bit) {
$key = isset($key) ? $key.'.'.$bit : $bit;
$match = false;
if (isset($data[$key])) {
$match = true;
$data = $data[$key];
unset($key);
}
}
if (!$match) {
throw new \RuntimeException($settingKey.' is not defined.');
}
$value = $data;
} elseif (isset($data['config'][$settingKey])) {
$value = $this->config->get($settingKey, $input->getOption('absolute') ? 0 : Config::RELATIVE_PATHS);
} elseif (isset($rawData[$settingKey]) && in_array($settingKey, $properties, true)) {
$value = $rawData[$settingKey];
} else {
throw new \RuntimeException($settingKey.' is not defined');
}
if (is_array($value)) {
$value = json_encode($value);
}
$this->getIO()->write($value, true, IOInterface::QUIET);
return 0;
}
$values = $input->getArgument('setting-value');
$booleanValidator = function ($val) {
return in_array($val, array('true', 'false', '1', '0'), true);
};
$booleanNormalizer = function ($val) {
return $val !== 'false' && (bool) $val;
};
$uniqueConfigValues = array(
'process-timeout' => array('is_numeric', 'intval'),
'use-include-path' => array($booleanValidator, $booleanNormalizer),
'use-github-api' => array($booleanValidator, $booleanNormalizer),
'preferred-install' => array(
function ($val) {
return in_array($val, array('auto', 'source', 'dist'), true);
},
function ($val) {
return $val;
},
),
'store-auths' => array(
function ($val) {
return in_array($val, array('true', 'false', 'prompt'), true);
},
function ($val) {
if ('prompt' === $val) {
return 'prompt';
}
return $val !== 'false' && (bool) $val;
},
),
'notify-on-install' => array($booleanValidator, $booleanNormalizer),
'vendor-dir' => array('is_string', function ($val) {
return $val;
}),
'bin-dir' => array('is_string', function ($val) {
return $val;
}),
'archive-dir' => array('is_string', function ($val) {
return $val;
}),
'archive-format' => array('is_string', function ($val) {
return $val;
}),
'data-dir' => array('is_string', function ($val) {
return $val;
}),
'cache-dir' => array('is_string', function ($val) {
return $val;
}),
'cache-files-dir' => array('is_string', function ($val) {
return $val;
}),
'cache-repo-dir' => array('is_string', function ($val) {
return $val;
}),
'cache-vcs-dir' => array('is_string', function ($val) {
return $val;
}),
'cache-ttl' => array('is_numeric', 'intval'),
'cache-files-ttl' => array('is_numeric', 'intval'),
'cache-files-maxsize' => array(
function ($val) {
return preg_match('/^\s*([0-9.]+)\s*(?:([kmg])(?:i?b)?)?\s*$/i', $val) > 0;
},
function ($val) {
return $val;
},
),
'bin-compat' => array(
function ($val) {
return in_array($val, array('auto', 'full'));
},
function ($val) {
return $val;
},
),
'discard-changes' => array(
function ($val) {
return in_array($val, array('stash', 'true', 'false', '1', '0'), true);
},
function ($val) {
if ('stash' === $val) {
return 'stash';
}
return $val !== 'false' && (bool) $val;
},
),
'autoloader-suffix' => array('is_string', function ($val) {
return $val === 'null' ? null : $val;
}),
'sort-packages' => array($booleanValidator, $booleanNormalizer),
'optimize-autoloader' => array($booleanValidator, $booleanNormalizer),
'classmap-authoritative' => array($booleanValidator, $booleanNormalizer),
'apcu-autoloader' => array($booleanValidator, $booleanNormalizer),
'prepend-autoloader' => array($booleanValidator, $booleanNormalizer),
'disable-tls' => array($booleanValidator, $booleanNormalizer),
'secure-http' => array($booleanValidator, $booleanNormalizer),
'cafile' => array(
function ($val) {
return file_exists($val) && is_readable($val);
},
function ($val) {
return $val === 'null' ? null : $val;
},
),
'capath' => array(
function ($val) {
return is_dir($val) && is_readable($val);
},
function ($val) {
return $val === 'null' ? null : $val;
},
),
'github-expose-hostname' => array($booleanValidator, $booleanNormalizer),
'htaccess-protect' => array($booleanValidator, $booleanNormalizer),
'lock' => array($booleanValidator, $booleanNormalizer),
'platform-check' => array($booleanValidator, $booleanNormalizer),
);
$multiConfigValues = array(
'github-protocols' => array(
function ($vals) {
if (!is_array($vals)) {
return 'array expected';
}
foreach ($vals as $val) {
if (!in_array($val, array('git', 'https', 'ssh'))) {
return 'valid protocols include: git, https, ssh';
}
}
return true;
},
function ($vals) {
return $vals;
},
),
'github-domains' => array(
function ($vals) {
if (!is_array($vals)) {
return 'array expected';
}
return true;
},
function ($vals) {
return $vals;
},
),
'gitlab-domains' => array(
function ($vals) {
if (!is_array($vals)) {
return 'array expected';
}
return true;
},
function ($vals) {
return $vals;
},
),
);
if ($input->getOption('unset') && (isset($uniqueConfigValues[$settingKey]) || isset($multiConfigValues[$settingKey]))) {
if ($settingKey === 'disable-tls' && $this->config->get('disable-tls')) {
$this->getIO()->writeError('<info>You are now running Composer with SSL/TLS protection enabled.</info>');
}
$this->configSource->removeConfigSetting($settingKey);
return 0;
}
if (isset($uniqueConfigValues[$settingKey])) {
$this->handleSingleValue($settingKey, $uniqueConfigValues[$settingKey], $values, 'addConfigSetting');
return 0;
}
if (isset($multiConfigValues[$settingKey])) {
$this->handleMultiValue($settingKey, $multiConfigValues[$settingKey], $values, 'addConfigSetting');
return 0;
}
if (preg_match('/^preferred-install\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
$this->configSource->removeConfigSetting($settingKey);
return 0;
}
list($validator) = $uniqueConfigValues['preferred-install'];
if (!$validator($values[0])) {
throw new \RuntimeException('Invalid value for '.$settingKey.'. Should be one of: auto, source, or dist');
}
$this->configSource->addConfigSetting($settingKey, $values[0]);
return 0;
}
$uniqueProps = array(
'name' => array('is_string', function ($val) {
return $val;
}),
'type' => array('is_string', function ($val) {
return $val;
}),
'description' => array('is_string', function ($val) {
return $val;
}),
'homepage' => array('is_string', function ($val) {
return $val;
}),
'version' => array('is_string', function ($val) {
return $val;
}),
'minimum-stability' => array(
function ($val) {
return isset(BasePackage::$stabilities[VersionParser::normalizeStability($val)]);
},
function ($val) {
return VersionParser::normalizeStability($val);
},
),
'prefer-stable' => array($booleanValidator, $booleanNormalizer),
);
$multiProps = array(
'keywords' => array(
function ($vals) {
if (!is_array($vals)) {
return 'array expected';
}
return true;
},
function ($vals) {
return $vals;
},
),
'license' => array(
function ($vals) {
if (!is_array($vals)) {
return 'array expected';
}
return true;
},
function ($vals) {
return $vals;
},
),
);
if ($input->getOption('global') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]) || strpos($settingKey, 'extra.') === 0)) {
throw new \InvalidArgumentException('The '.$settingKey.' property can not be set in the global config.json file. Use `composer global config` to apply changes to the global composer.json');
}
if ($input->getOption('unset') && (isset($uniqueProps[$settingKey]) || isset($multiProps[$settingKey]))) {
$this->configSource->removeProperty($settingKey);
return 0;
}
if (isset($uniqueProps[$settingKey])) {
$this->handleSingleValue($settingKey, $uniqueProps[$settingKey], $values, 'addProperty');
return 0;
}
if (isset($multiProps[$settingKey])) {
$this->handleMultiValue($settingKey, $multiProps[$settingKey], $values, 'addProperty');
return 0;
}
if (preg_match('/^repos?(?:itories)?\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
$this->configSource->removeRepository($matches[1]);
return 0;
}
if (2 === count($values)) {
$this->configSource->addRepository($matches[1], array(
'type' => $values[0],
'url' => $values[1],
), $input->getOption('append'));
return 0;
}
if (1 === count($values)) {
$value = strtolower($values[0]);
if (true === $booleanValidator($value)) {
if (false === $booleanNormalizer($value)) {
$this->configSource->addRepository($matches[1], false, $input->getOption('append'));
return 0;
}
} else {
$value = JsonFile::parseJson($values[0]);
$this->configSource->addRepository($matches[1], $value, $input->getOption('append'));
return 0;
}
}
throw new \RuntimeException('You must pass the type and a url. Example: php composer.phar config repositories.foo vcs https://bar.com');
}
if (preg_match('/^extra\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
$this->configSource->removeProperty($settingKey);
return 0;
}
$value = $values[0];
if ($input->getOption('json')) {
$value = JsonFile::parseJson($value);
if ($input->getOption('merge')) {
$currentValue = $this->configFile->read();
$bits = explode('.', $settingKey);
foreach ($bits as $bit) {
$currentValue = isset($currentValue[$bit]) ? $currentValue[$bit] : null;
}
if (is_array($currentValue)) {
$value = array_merge($currentValue, $value);
}
}
}
$this->configSource->addProperty($settingKey, $value);
return 0;
}
if (preg_match('/^suggest\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
$this->configSource->removeProperty($settingKey);
return 0;
}
$this->configSource->addProperty($settingKey, implode(' ', $values));
return 0;
}
if (in_array($settingKey, array('suggest', 'extra'), true) && $input->getOption('unset')) {
$this->configSource->removeProperty($settingKey);
return 0;
}
if (preg_match('/^platform\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
$this->configSource->removeConfigSetting($settingKey);
return 0;
}
$this->configSource->addConfigSetting($settingKey, $values[0]);
return 0;
}
if ($settingKey === 'platform' && $input->getOption('unset')) {
$this->configSource->removeConfigSetting($settingKey);
return 0;
}
if (preg_match('/^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic|bearer)\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
$this->authConfigSource->removeConfigSetting($matches[1].'.'.$matches[2]);
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
return 0;
}
if ($matches[1] === 'bitbucket-oauth') {
if (2 !== count($values)) {
throw new \RuntimeException('Expected two arguments (consumer-key, consumer-secret), got '.count($values));
}
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
$this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('consumer-key' => $values[0], 'consumer-secret' => $values[1]));
} elseif (in_array($matches[1], array('github-oauth', 'gitlab-oauth', 'gitlab-token', 'bearer'), true)) {
if (1 !== count($values)) {
throw new \RuntimeException('Too many arguments, expected only one token');
}
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
$this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], $values[0]);
} elseif ($matches[1] === 'http-basic') {
if (2 !== count($values)) {
throw new \RuntimeException('Expected two arguments (username, password), got '.count($values));
}
$this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]);
$this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('username' => $values[0], 'password' => $values[1]));
}
return 0;
}
if (preg_match('/^scripts\.(.+)/', $settingKey, $matches)) {
if ($input->getOption('unset')) {
$this->configSource->removeProperty($settingKey);
return 0;
}
$this->configSource->addProperty($settingKey, count($values) > 1 ? $values : $values[0]);
return 0;
}
throw new \InvalidArgumentException('Setting '.$settingKey.' does not exist or is not supported by this command');
}
protected function handleSingleValue($key, array $callbacks, array $values, $method)
{
list($validator, $normalizer) = $callbacks;
if (1 !== count($values)) {
throw new \RuntimeException('You can only pass one value. Example: php composer.phar config process-timeout 300');
}
if (true !== $validation = $validator($values[0])) {
throw new \RuntimeException(sprintf(
'"%s" is an invalid value'.($validation ? ' ('.$validation.')' : ''),
$values[0]
));
}
$normalizedValue = $normalizer($values[0]);
if ($key === 'disable-tls') {
if (!$normalizedValue && $this->config->get('disable-tls')) {
$this->getIO()->writeError('<info>You are now running Composer with SSL/TLS protection enabled.</info>');
} elseif ($normalizedValue && !$this->config->get('disable-tls')) {
$this->getIO()->writeError('<warning>You are now running Composer with SSL/TLS protection disabled.</warning>');
}
}
return call_user_func(array($this->configSource, $method), $key, $normalizedValue);
}
protected function handleMultiValue($key, array $callbacks, array $values, $method)
{
list($validator, $normalizer) = $callbacks;
if (true !== $validation = $validator($values)) {
throw new \RuntimeException(sprintf(
'%s is an invalid value'.($validation ? ' ('.$validation.')' : ''),
json_encode($values)
));
}
return call_user_func(array($this->configSource, $method), $key, $normalizer($values));
}
protected function listConfiguration(array $contents, array $rawContents, OutputInterface $output, $k = null)
{
$origK = $k;
$io = $this->getIO();
foreach ($contents as $key => $value) {
if ($k === null && !in_array($key, array('config', 'repositories'))) {
continue;
}
$rawVal = isset($rawContents[$key]) ? $rawContents[$key] : null;
if (is_array($value) && (!is_numeric(key($value)) || ($key === 'repositories' && null === $k))) {
$k .= preg_replace('{^config\.}', '', $key . '.');
$this->listConfiguration($value, $rawVal, $output, $k);
$k = $origK;
continue;
}
if (is_array($value)) {
$value = array_map(function ($val) {
return is_array($val) ? json_encode($val) : $val;
}, $value);
$value = '['.implode(', ', $value).']';
}
if (is_bool($value)) {
$value = var_export($value, true);
}
if (is_string($rawVal) && $rawVal != $value) {
$io->write('[<comment>' . $k . $key . '</comment>] <info>' . $rawVal . ' (' . $value . ')</info>', true, IOInterface::QUIET);
} else {
$io->write('[<comment>' . $k . $key . '</comment>] <info>' . $value . '</info>', true, IOInterface::QUIET);
}
}
}
}
<?php
namespace Composer\Command;
use Composer\Config;
use Composer\Factory;
use Composer\Installer;
use Composer\Installer\ProjectInstaller;
use Composer\Installer\InstallationManager;
use Composer\Installer\SuggestedPackagesReporter;
use Composer\IO\IOInterface;
use Composer\Package\BasePackage;
use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\Package\Version\VersionSelector;
use Composer\Package\AliasPackage;
use Composer\Repository\RepositoryFactory;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\InstalledFilesystemRepository;
use Composer\Repository\RepositorySet;
use Composer\Script\ScriptEvents;
use Composer\Util\Silencer;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder;
use Composer\Json\JsonFile;
use Composer\Config\JsonConfigSource;
use Composer\Util\Filesystem;
use Composer\Util\ProcessExecutor;
use Composer\Util\Loop;
use Composer\Package\Version\VersionParser;
use Composer\EventDispatcher\EventDispatcher;
class CreateProjectCommand extends BaseCommand
{
protected $suggestedPackagesReporter;
protected function configure()
{
$this
->setName('create-project')
->setDescription('Creates new project from a package into given directory.')
->setDefinition(array(
new InputArgument('package', InputArgument::OPTIONAL, 'Package name to be installed'),
new InputArgument('directory', InputArgument::OPTIONAL, 'Directory where the files should be created'),
new InputArgument('version', InputArgument::OPTIONAL, 'Version, will default to latest'),
new InputOption('stability', 's', InputOption::VALUE_REQUIRED, 'Minimum-stability allowed (unless a version is specified).'),
new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
new InputOption('prefer-dist', null, InputOption::VALUE_NONE, 'Forces installation from package dist even for dev versions.'),
new InputOption('repository', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Add custom repositories to look the package up, either by URL or using JSON arrays'),
new InputOption('repository-url', null, InputOption::VALUE_REQUIRED, 'DEPRECATED: Use --repository instead.'),
new InputOption('add-repository', null, InputOption::VALUE_NONE, 'Add the custom repository in the composer.json. If a lock file is present it will be deleted and an update will be run instead of install.'),
new InputOption('dev', null, InputOption::VALUE_NONE, 'Enables installation of require-dev packages (enabled by default, only present for BC).'),
new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Disables installation of require-dev packages.'),
new InputOption('no-custom-installers', null, InputOption::VALUE_NONE, 'DEPRECATED: Use no-plugins instead.'),
new InputOption('no-scripts', null, InputOption::VALUE_NONE, 'Whether to prevent execution of all defined scripts in the root package.'),
new InputOption('no-progress', null, InputOption::VALUE_NONE, 'Do not output download progress.'),
new InputOption('no-secure-http', null, InputOption::VALUE_NONE, 'Disable the secure-http config option temporarily while installing the root package. Use at your own risk. Using this flag is a bad idea.'),
new InputOption('keep-vcs', null, InputOption::VALUE_NONE, 'Whether to prevent deleting the vcs folder.'),
new InputOption('remove-vcs', null, InputOption::VALUE_NONE, 'Whether to force deletion of the vcs folder without prompting.'),
new InputOption('no-install', null, InputOption::VALUE_NONE, 'Whether to skip installation of the package dependencies.'),
new InputOption('ignore-platform-req', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Ignore a specific platform requirement (php & ext- packages).'),
new InputOption('ignore-platform-reqs', null, InputOption::VALUE_NONE, 'Ignore all platform requirements (php & ext- packages).'),
new InputOption('ask', null, InputOption::VALUE_NONE, 'Whether to ask for project directory.'),
))
->setHelp(
<<<EOT
The <info>create-project</info> command creates a new project from a given
package into a new directory. If executed without params and in a directory
with a composer.json file it installs the packages for the current project.
You can use this command to bootstrap new projects or setup a clean
version-controlled installation for developers of your project.
<info>php composer.phar create-project vendor/project target-directory [version]</info>
You can also specify the version with the package name using = or : as separator.
<info>php composer.phar create-project vendor/project:version target-directory</info>
To install unstable packages, either specify the version you want, or use the
--stability=dev (where dev can be one of RC, beta, alpha or dev).
To setup a developer workable version you should create the project using the source
controlled code by appending the <info>'--prefer-source'</info> flag.
To install a package from another repository than the default one you
can pass the <info>'--repository=https://myrepository.org'</info> flag.
Read more at https://getcomposer.org/doc/03-cli.md#create-project
EOT
)
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$config = Factory::createConfig();
$io = $this->getIO();
list($preferSource, $preferDist) = $this->getPreferredInstallOptions($config, $input, true);
if ($input->getOption('dev')) {
$io->writeError('<warning>You are using the deprecated option "dev". Dev packages are installed by default now.</warning>');
}
if ($input->getOption('no-custom-installers')) {
$io->writeError('<warning>You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.</warning>');
$input->setOption('no-plugins', true);
}
if ($input->isInteractive() && $input->getOption('ask')) {
$parts = explode("/", strtolower($input->getArgument('package')), 2);
$input->setArgument('directory', $io->ask('New project directory [<comment>'.array_pop($parts).'</comment>]: '));
}
$ignorePlatformReqs = $input->getOption('ignore-platform-reqs') ?: ($input->getOption('ignore-platform-req') ?: false);
return $this->installProject(
$io,
$config,
$input,
$input->getArgument('package'),
$input->getArgument('directory'),
$input->getArgument('version'),
$input->getOption('stability'),
$preferSource,
$preferDist,
!$input->getOption('no-dev'),
$input->getOption('repository') ?: $input->getOption('repository-url'),
$input->getOption('no-plugins'),
$input->getOption('no-scripts'),
$input->getOption('no-progress'),
$input->getOption('no-install'),
$ignorePlatformReqs,
!$input->getOption('no-secure-http'),
$input->getOption('add-repository')
);
}
public function installProject(IOInterface $io, Config $config, InputInterface $input, $packageName, $directory = null, $packageVersion = null, $stability = 'stable', $preferSource = false, $preferDist = false, $installDevPackages = false, $repositories = null, $disablePlugins = false, $noScripts = false, $noProgress = false, $noInstall = false, $ignorePlatformReqs = false, $secureHttp = true, $addRepository = false)
{
$oldCwd = getcwd();
if ($repositories !== null && !is_array($repositories)) {
$repositories = (array) $repositories;
}
$io->loadConfiguration($config);
$this->suggestedPackagesReporter = new SuggestedPackagesReporter($io);
if ($packageName !== null) {
$installedFromVcs = $this->installRootPackage($io, $config, $packageName, $directory, $packageVersion, $stability, $preferSource, $preferDist, $installDevPackages, $repositories, $disablePlugins, $noScripts, $noProgress, $ignorePlatformReqs, $secureHttp);
} else {
$installedFromVcs = false;
}
if ($repositories !== null && $addRepository && is_file('composer.lock')) {
unlink('composer.lock');
}
$composer = Factory::create($io, null, $disablePlugins);
if ($repositories !== null && $addRepository) {
foreach ($repositories as $index => $repo) {
$repoConfig = RepositoryFactory::configFromString($io, $composer->getConfig(), $repo, true);
$composerJsonRepositoriesConfig = $composer->getConfig()->getRepositories();
$name = RepositoryFactory::generateRepositoryName($index, $repoConfig, $composerJsonRepositoriesConfig);
$configSource = new JsonConfigSource(new JsonFile('composer.json'));
if (
(isset($repoConfig['packagist']) && $repoConfig === array('packagist' => false))
|| (isset($repoConfig['packagist.org']) && $repoConfig === array('packagist.org' => false))
) {
$configSource->addRepository('packagist.org', false);
} else {
$configSource->addRepository($name, $repoConfig, false);
}
$composer = Factory::create($io, null, $disablePlugins);
}
}
$process = new ProcessExecutor($io);
$fs = new Filesystem($process);
if ($noScripts === false) {
$composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_ROOT_PACKAGE_INSTALL, $installDevPackages);
}
$config = $composer->getConfig();
list($preferSource, $preferDist) = $this->getPreferredInstallOptions($config, $input);
if ($noInstall === false) {
$composer->getInstallationManager()->setOutputProgress(!$noProgress);
$installer = Installer::create($io, $composer);
$installer->setPreferSource($preferSource)
->setPreferDist($preferDist)
->setDevMode($installDevPackages)
->setRunScripts(!$noScripts)
->setIgnorePlatformRequirements($ignorePlatformReqs)
->setSuggestedPackagesReporter($this->suggestedPackagesReporter)
->setOptimizeAutoloader($config->get('optimize-autoloader'))
->setClassMapAuthoritative($config->get('classmap-authoritative'))
->setApcuAutoloader($config->get('apcu-autoloader'));
if (!$composer->getLocker()->isLocked()) {
$installer->setUpdate(true);
<