1
0
Fork 0
Commit Graph

557 Commits (2fe3244ddb68aa5260844a57c18ff027e279b83d)

Author SHA1 Message Date
Jordi Boggiano bf940fb21b Fix exclude-from-classmap when a package is installed as a symlink, fixes #6397 2017-08-06 17:21:04 +02:00
Jordi Boggiano 17b7387c37 Merge branch '1.4' 2017-07-06 09:56:17 +02:00
Jordi Boggiano 81f65b7a2a Fix exclude-from-classmap being ignored when cwd has the wrong case on case insensitive filesystems 2017-07-06 09:53:33 +02:00
Jordi Boggiano 47bc2fa51a Fix exclude-from-classmap being ignored when generating on-the-fly class loader, fixes #6503 2017-07-06 09:51:25 +02:00
Saumini Navaratnam 27b8209990 Fix for issue #6492
Able to include specific finle in phar in "files" option in composer
2017-06-19 17:04:16 +02:00
Li Chuangbo 1f4882a3e6 Revert "Fixed an issue when a phar file is used in "files" option in composer.json"
This reverts commit 41e91f3064.

The commit 41e91f3 in current codebase generates absolute path in
autoload_static.php for phar file.

Also according to http://php.net/manual/en/phar.using.intro.php, the `phar://`
prefix is not needed.
2017-06-15 14:38:04 +02:00
Jordi Boggiano 122e422682 CS fixes 2017-03-08 15:16:44 +01:00
David WATTIER e6d648f465 Improve performance on psr4 autoload file finding 2017-03-06 16:56:04 +01:00
Jordi Boggiano 1dcb2b5758 Merge remote-tracking branch 'nicolas-grekas/apcu' 2016-12-07 00:21:13 +01:00
Jordi Boggiano e9d04f2b2d Merge branch '1.2' 2016-12-06 17:04:39 +01:00
Hans-Joachim Michl 817b2747c7 Fix #5672
This fixes the issue reported in #5672.
It just makes sure the ZendGuard encoded files can be autoloaded correctly.
2016-12-06 17:02:27 +01:00
Nicolas Grekas 6d4e60b991 Add --apcu-autoloader option to enable APCu caching of found/not-found classes 2016-12-06 11:21:44 +01:00
Konstantin.Myakshin dc70b40d34 Use implode instead of join 2016-10-11 16:52:29 +03:00
Kévin Dunglas 3e3fd3c6b1
Remove unused variable 2016-10-09 22:40:30 +02:00
Fabien Potencier 2853e82400 removed obsolete code 2016-10-06 11:56:54 -07:00
Jordi Boggiano 902a5c32db Add bug ref 2016-09-29 08:06:44 +02:00
AnrDaemon c774d41a9c Fix realpath() failing on Windows 2016-09-29 08:05:55 +02:00
SpacePossum 2ae0800cd3 Remove useless concat. 2016-09-16 14:50:34 +02:00
Nicolas Grekas c6b26c4e96 Make static inlining more selective 2016-08-30 15:25:17 +02:00
Nicolas Grekas dd67b01ac5 Add ClassLoader::$missingClasses to not trigger a COW 2016-07-28 10:35:44 +02:00
Jordi Boggiano c289776d94 Force-collapse multiple slashes into one, fixes #5387 2016-05-31 19:37:39 +01:00
Jordi Boggiano d1a0502f92 Make sure we only replace complete paths to the base-dir/vendor-dir, not partial dir matches, fixes #5289 2016-05-05 14:57:07 +01:00
Jordi Boggiano 05fab170a7 Merge branch '1.0' 2016-04-24 14:41:02 +01:00
Jordi Boggiano f0d67923a5 Fix classmap generator over anonymous classes extending/implementing something, fixes #5239 2016-04-24 14:40:51 +01:00
Jordi Boggiano 4f6693ad70 Fix regression in 0b44662087, fixes #5199 2016-04-15 15:37:00 +01:00
Jordi Boggiano 0b44662087 Disable static autoloader on HHVM, fixes #5192 2016-04-15 14:57:07 +01:00
Nicolas Grekas 40aca80bd9 Workaround https://bugs.php.net/68057 2016-04-12 09:32:54 +02:00
Nicolas Grekas fd2f51cea8 Speedup autoloading on PHP 5.6 & 7.0+ using static arrays 2016-04-11 19:38:24 +02:00
Jordi Boggiano b9ce06f46b Minor tweaks, refs #5162 2016-04-11 14:47:03 +01:00
Niels Keurentjes eb77c0b7f5 phpDoc cleanup, removed unused imports, variables and parameters. 2016-04-07 23:12:23 +02:00
Jordi Boggiano 5822b58c1f Avoid using realpath when generating classmap, speeds up generation and keeps paths local to project in case of symlinks/path repo 2016-04-01 11:32:04 +01:00
Niels Keurentjes b059cbe37c Removed unused variables and includes, fixed functions being called with more arguments than declared. 2016-02-27 23:21:11 +01:00
Jordi Boggiano cdea645eab Avoid outputing duplicate warnings for ambiguous class resolution, fixes #4953 2016-02-24 13:07:17 +00:00
Niels Keurentjes 0b55a0ca91 Can't use error_clear_last as it was introduced in PHP7. 2016-02-06 02:58:36 +01:00
Niels Keurentjes 6a53b1df42 Further reorganized messy checking code. 2016-02-06 02:40:16 +01:00
Niels Keurentjes bb08f76ad9 Use error_get_last to verify why php_strip_whitespace would return an empty string. 2016-02-06 02:32:08 +01:00
Niels Keurentjes 86fc85fe56 Add a comment explaining the use of @ instead of Silencer in this specific situation. 2016-02-06 02:04:48 +01:00
Niels Keurentjes c2d9960898 Ensure exception is thrown when classmaps are requested for corrupted or binary files. Refs #4885 2016-02-06 02:00:54 +01:00
Niels Keurentjes 18cd4f966b Added silencer utility to more gracefully handle error suppression without hiding errors or worse. Fixes #4203, #4683 2016-01-25 23:37:54 +01:00
Jordi Boggiano bda2c0f9b7 Re-enable include path even when classmap authoritative is present, refs #4556 2016-01-09 19:12:26 +00:00
Jordi Boggiano e05207dbad Merge remote-tracking branch 'bp1222/save-loads' 2016-01-09 19:10:39 +00:00
Markus Staab 5752559ae8 fixed typo 2015-12-28 15:20:42 +01:00
Jordi Boggiano 43f7b762e5 Revert "[ClassLoader] performance improvement: use str_replace instead of strtr" 2015-12-09 15:46:46 +00:00
Tobias Schultze a76ce9b25a [ClassLoader] no need to call str_replace on Windows 2015-12-04 15:15:36 +01:00
Tobias Schultze 314741c1ec [ClassLoader] use str_replace instead of strtr 2015-12-04 14:33:04 +01:00
Jordi Boggiano c5e5bc6fc6 Merge pull request #4589 from dunglas/patch-1
Update the autoloader PHPDoc: PSR-4 instead of PSR-0
2015-11-26 12:37:30 +00:00
Kévin Dunglas 6c5c53c362 Update the PHPDoc: The autoloader supports PSR-0, PSR-4 and classmap. 2015-11-26 13:30:47 +01:00
Jordi Boggiano 8072448cf3 Adjust deduplication of files autoloads, refs 9710b26d3f 2015-11-26 10:39:16 +00:00
Jordi Boggiano 966a982738 CS fixes 2015-11-21 19:28:10 +00:00
Jordi Boggiano 1fe690f810 Autoload generator cleanups 2015-11-21 18:33:17 +00:00
Jordi Boggiano 3748c11709 Simplify files autoload include function, and make sure files are included once per package even if exactly the same, refs #4186 2015-11-21 18:30:44 +00:00
Jordi Boggiano 9710b26d3f Merge remote-tracking branch 'jeskew/feature/require_files_but_once' 2015-11-21 17:31:05 +00:00
Jordi Boggiano c0b49d09f3 Merge remote-tracking branch 'cw-ozaki/no-script-dump-autoload'
Conflicts:
	src/Composer/Autoload/AutoloadGenerator.php
	src/Composer/Command/DumpAutoloadCommand.php
2015-11-21 17:14:33 +00:00
Jordi Boggiano 6f29df01d2 Fix updir regex matching, refs #4607 2015-11-14 15:44:30 +00:00
Omer Karadagli 4046ae042d Up-level relative paths in exclude-from-classmap 2015-11-12 15:53:47 +00:00
Rob Bast 991d25115f fixes #4562 2015-11-05 18:47:30 +01:00
annesosensio 2e4157145b Made wildcard expansion consistent with bash 2015-10-30 21:30:50 +01:00
Jordi Boggiano 6c16510743 Add support for wildcards in exclude-from-classmap, refs #1607 2015-10-30 19:12:30 +00:00
Jordi Boggiano f1b0c073ad Tweaked exclude-from-classmap: windows support, normalize paths and make sure they are all package-relative and do not leak to other packages, refs #1607 2015-10-30 00:22:04 +00:00
Jordi Boggiano 084f6de24e Merge remote-tracking branch 'trivago/add_exclude'
Conflicts:
	doc/04-schema.md
	src/Composer/Autoload/AutoloadGenerator.php
2015-10-30 00:00:44 +00:00
David Walker e0a6419992 When classmap authoratative is enabled, there should be no reason to load 3 files, and process them when autoloader will return false 2015-10-28 14:29:36 -06:00
Jordi Boggiano 6582c337d0 Fix typo 2015-10-28 00:06:21 +00:00
Jordi Boggiano 1160b782c8 Deduplicate classmap creation and add support for loading classmaps on the fly for plugins & co 2015-10-27 17:47:25 +00:00
Rob Bast b523fc0b7b ran fixers 2015-10-13 11:35:51 +02:00
Jordi Boggiano ce08582671 Fix CS 2015-09-28 10:53:24 +01:00
Bryan Davis cc2b9cfca5 Add cli argument for classmap-authoritative
Add a `--classmap-authoritative (-a)` argument to `composer install`,
`composer update` and `composer dumpautoload`. This enables the same
authoritative classmap behavior as the existing `classmap-authoritative`
configuration setting. The option can be used for creating highly
optimized production autoloaders via `composer install --no-dev
--optimize-autoloader --classmap-authoritative` for projects where
multiple autoloaders are present and unnecessary `file_exists` calls
introduce performance issues.

Closes #4361
2015-08-19 22:18:54 -06:00
voroks 154092ba1a Added removing file 'include_path.php' (if it is empty). 2015-08-19 15:08:27 +08:00
voroks 457bc20c34 Explicit comparison was removed. 2015-08-18 16:10:59 +08:00
voroks cca42ff0be Fixed indents: we should use spaces instead tabulation. 2015-08-18 15:29:22 +08:00
voroks 4fa1cb2e9c Removing file autoload_files.php was added (#4254) 2015-08-15 16:12:16 +08:00
Rob Bast 593af4b1bf add license file during autoload dumping
closes #4288
2015-08-14 12:00:21 +02:00
Nicolas Grekas fbae6b1589 Revert "Merge pull request #3975 from marc-mabe/hotfix/3974"
This reverts commit bdb6ecb29e, reversing
changes made to 8a12e50a16.
2015-08-04 10:34:54 +02:00
Jonathan Eskew 42b025776a Move file identifier calculation to compile time 2015-06-30 09:22:51 -07:00
Jordi Boggiano b17ccbfa0d Avoid invalid warnings when scanning the same file twice, fixes #4195, fixes #4197 2015-06-30 13:27:28 +01:00
Jonathan Eskew 24c4322672 Use 5.3 compatible array syntax 2015-06-28 13:47:00 -07:00
Jonathan Eskew 868a872df2 Push the hash to $GLOBALS 2015-06-28 13:44:43 -07:00
Jonathan Eskew 61ed7a9547 Explicitly check if a file has already been required before requiring it 2015-06-27 14:05:59 -07:00
Jordi Boggiano 943107cfe7 Load most specific namespaces always, and dependents before dependencies when building classmaps
This also adds notifications of duplicate classes
2015-06-26 14:40:26 +01:00
Jordi Boggiano e73448ae1e Add possessive quantifiers to avoid backtracking and fix segfault on large files, fixes #4153 2015-06-16 11:22:45 +01:00
elazar 6c029a850c Resolves #4138: Removed *Test.php filtering from AutoloadGenerator->dump() 2015-06-12 10:52:55 -05:00
Possum 29ca21f30e PHP version checks tweaking 2015-05-05 20:18:24 +02:00
Jordi Boggiano 164dc2a097 Reuse prefix only if no prefix is defined 2015-05-01 14:23:20 +01:00
Marc Bennewitz 9455c49053 fixes #3974: Autoloader have to distinguish between files and directories 2015-04-30 19:17:19 +02:00
Jordi Boggiano dbfd47eeca CS fixes 2015-04-15 01:22:19 +01:00
msiebeneicher 7522a33079 Merge branch 'master' of https://github.com/composer/composer into add_exclude
# By Jordi Boggiano (30) and others
# Via Jordi Boggiano (37) and Morgan Campbell (1)
* 'master' of https://github.com/composer/composer: (83 commits)
  Update 01-basic-usage.md
  Revert 331425bcb3 as well, fixes #3612
  Revert "Disable overwrites when no-ansi is present, fixes #3612"
  Update deps
  Use justinrainbow/json-schema 1.4
  Improved wording
  Fix docs basic-auth => http-basic
  Add test for Generics class
  Single variable for traits and enums
  Use HHVM_VERSION instead of HPHP_VERSION
  Add support for using classmap to autoload Hack enums
  Re-use existing autoloader suffix if available, fixes #3701
  Report Travis CI build success early
  Test on HHVM nightly releases. Allow to fail.
  Make parseJson safer
  Use get home from Config instead of factory
  Fix env override regression, fixes #3820
  [create-project] Used no progress value for dependencies
  Add docBlock and fix CS
  Fix output of first line of progress when output is not decorated, refs #3818
  ...
2015-03-25 16:27:23 +01:00
Fred Emmott bdf51ab16d Single variable for traits and enums 2015-03-09 10:05:12 -07:00
Fred Emmott cb1ea889d6 Use HHVM_VERSION instead of HPHP_VERSION 2015-03-09 10:02:10 -07:00
Fred Emmott 33ea86573e Add support for using classmap to autoload Hack enums
fixes composer/composer#3823

Ran tests with both PHP5.5.9-1ubuntu4.5 and HHVM 3.6. Test fails on HHVM only
if I back out the ClassMapGenerator.php change.
2015-03-09 09:38:02 -07:00
Jordi Boggiano b296e654eb Re-use existing autoloader suffix if available, fixes #3701 2015-03-09 11:13:01 +00:00
Rob Bast cb336a5416 Implement writeError throughout Composer 2015-02-25 11:00:35 +01:00
Jordi Boggiano 0b4a9235f4 CS fixes 2015-02-24 14:22:54 +00:00
msiebeneicher 3682a9f5a7 * Cleanup code comments 2015-02-12 10:18:00 +01:00
msiebeneicher dad6b05ca7 Merge branches 'add_exclude' and 'master' of https://github.com/trivago/composer into add_exclude
* Resolve conflicts and update unit test
2015-02-11 18:04:57 +01:00
msiebeneicher f28785a49d Merge branches 'add_exclude' and 'master' of https://github.com/trivago/composer into add_exclude
* 'add_exclude' of https://github.com/trivago/composer:

# By Jordi Boggiano (239) and others
# Via Jordi Boggiano (184) and others
* 'master' of https://github.com/trivago/composer: (638 commits)
  Simplified syntax
  github deprecation changes
  fix bug in GitDriver::supports for remote repo
  strict check, testcase(s)
  Fix regex matching and add more tests for addSubNode, refs #3721, fixes #3716
  solve edge case for `composer remove vendor/pkg`
  chmod 644 src/Composer/Command/RemoveCommand.php
  Avoid failing on composer show of lazy providers
  Show more info when a download fails
  Add notion of autoloader skipping autoload-dev rules
  Satis grammar fix.
  remove unused statements
  removed needless output param
  + limit git ls-remote to heads + escape repo url
  add check for remote Repository in GitDriver::supports
  suppress the prefix
  Improve notice about /usr/local/bin
  Reuse current file permissions
  Add the P character to the regex pattern
  Added deprecated warning for the dev option
  ...

Conflicts:
	src/Composer/Autoload/AutoloadGenerator.php
	src/Composer/Autoload/ClassMapGenerator.php
2015-02-11 17:54:35 +01:00
Bryan Davis 8ceb5714a4 Fix spelling of "Authoritative"
- classMapAuthoratative -> classMapAuthoritative
- getClassMapAuthoratative -> isClassMapAuthoritative
- Don't use elseif since if block returns
2015-01-05 11:48:34 -07:00
Bryan Davis ad1f8e6c5a Add classmap-authoritative config setting
Add a "classmap-authoritative" configuration setting that can be used to
disable searching the various prefix and fallback directories for
classes that have not been registered with the
Composer\Autoload\ClassLoader class map. This setting can be used to
optimize performance by avoiding a potentially large number of
`file_exists` calls when Composer is being used in a program with
additional autoloader facilities. Use of the setting implies
"optimize-autoloader" to ensure that the most complete class map
possible is generated.

Closes #3603
2015-01-03 17:35:25 -07:00
Jordi Boggiano fc3c7838b2 CS fixes 2014-12-07 13:54:29 +00:00
Michael Gusev a531594a4a Issue #3422
https://github.com/composer/composer/issues/3422
2014-11-17 11:05:23 +01:00
Jordi Boggiano 94926218e8 CS fixes 2014-10-17 18:57:27 +01:00
Jordi Boggiano 4ce9252255 Avoid passing args to CLI handlers when none are needed, fixes #3332 2014-10-07 11:27:24 +01:00
Artur Eshenbrener 56482cff0a Changed short array syntzx to long 2014-10-03 18:31:02 +04:00
Artur Eshenbrener ad1d0be420 Accessing to option 'optimize-autoloder' inside 'post-autoload-dump' script event. 2014-10-03 18:28:16 +04:00
cw-ozaki d649cfc6a1 Add --no-scripts argument for dump-autoload command 2014-08-08 16:27:19 +09:00
Jordi Boggiano 0ce0cf42e8 Merge remote-tracking branch 'francoispluchino/fix-phpdoc'
Conflicts:
	src/Composer/EventDispatcher/EventDispatcher.php
2014-07-23 19:19:39 +02:00
Jordi Boggiano 4dfa3c469e Fix class map generator handling of missing files 2014-07-20 19:07:31 +02:00
Jordi Boggiano a227523c4f Fix php_strip_whitespace bugginess, fixes #3030 2014-07-20 00:07:58 +02:00
Jordi Boggiano 799876dd55 Allow dashes in class names for HHVM support, fixes #2967 2014-07-19 19:19:13 +02:00
François Pluchino 8b5c00bff0 Fix phpdoc 2014-07-16 15:17:38 +02:00
Jordi Boggiano ac497feaba CS fixes 2014-06-10 16:13:12 +02:00
jakoch a0e5ead9b0 removed unused variables $baseDir and $vendorDir from "autoloader_real.php" generated by AutoloadGenerator. adjusted tests accordingly. 2014-05-02 17:42:31 +02:00
Jordi Boggiano 05d9912f97 Ignore classes in ClassMapGenerator 2014-04-29 14:36:19 +02:00
Fabien Potencier 12421dd6b7 fixed class map generator when using a heredoc with spaces 2014-04-28 15:21:22 +02:00
Jordi Boggiano 14f35e812c Merge pull request #2912 from ckwalsh/master
Support generating class map for XHP classes
2014-04-14 14:11:15 +02:00
Jordi Boggiano 49d4054e51 Handle files with no php at all, fixes #2910 2014-04-14 12:47:47 +02:00
Cullen Walsh 57d9e9852d Support generating class map for XHP classes 2014-04-14 00:21:53 -04:00
Denis Sokolov 836534067b Avoid ambiguity warning for example directories as well
In particular, PEAR repositories use a classmap and example directories trigger
multiple false positive warnings.
2014-04-10 21:03:35 +09:00
Jordi Boggiano 0902305196 Fix classmap generator warnings and tests 2014-04-01 14:38:31 +02:00
Jordi Boggiano 8974a1ac92 Ignore ambiguous classes in tests/fixtures dirs, fixes #2858 2014-03-31 21:36:48 +02:00
Daniel Karp e3be04c443 Don't show Ambiguous class resolution warning if class when not ambiguous
if a class or interface is defined twice in the same class, this should not produce a warning
2014-03-30 12:53:15 -04:00
Jordi Boggiano 781c97fa9b Refactor to avoid global static state 2014-03-29 17:46:55 +01:00
Jordi Boggiano c3ab09750d Merge remote-tracking branch 'johnikx/ambiguous-reference-warning' 2014-03-29 17:29:55 +01:00
Jan Brecka b94838169d show warning only instead of throwing exception 2014-03-24 14:34:02 +01:00
Jordi Boggiano fc9e1d0cff CS fixes, refs #2823 2014-03-24 00:31:08 +01:00
Jan Brecka a41370b021 fix plural in exception message 2014-03-21 14:26:54 +01:00
Jan Brecka ea7717c8e5 improve exception message 2014-03-20 14:24:42 +01:00
Jan Brecka 13b57112a9 Throw RuntimeException when ambiguous reference was found. 2014-03-20 13:37:05 +01:00
Fred Emmott 7d3274224a Only look for .hh files at runtime if using HHVM
The ClassMap generator will look regardless, but that's not a runtime
cost, so seems desirable (in case composer install/update needs to be
called with php5 for some resaon)
2014-03-18 16:21:45 -07:00
Fred Emmott 734e5e2f2b Add autoload support for .hh files (HHVM)
HHVM is adding support for an alternative extension for files using
HHVM-specific features. Support them in the Class Map and PSR4
autoloaders.

Trivial example: https://github.com/fredemmott/hh_extension_toolset
2014-03-18 14:37:44 -07:00
Jordi Boggiano 5fb005631a Tweaking dispatchScript method to be in line with the rest, and add devMode to *_AUTOLOAD_DUMP events 2014-03-01 21:22:01 +01:00
Jordi Boggiano 023ff131aa Merge remote-tracking branch 'bamarni/autoload-dev' 2014-03-01 20:28:31 +01:00
Jordi Boggiano cea7c07cf2 Fix CS 2014-03-01 19:58:37 +01:00
Bilal Amarni db91454a13 added an autoload-dev section 2014-02-28 00:27:03 +01:00
Olivier Laviale 40e484ed38 Fixed an issue that would lead to scattered autoloading files 2014-02-20 23:18:48 +01:00
Dave Hulbert 81aa3a850c Fix some PHP doc blocks 2014-02-11 10:09:30 +00:00
Nicolas Grekas 00a6f8e38d dedicated scope isolation function for autoload_real 2014-02-06 11:53:42 +01:00
Jordi Boggiano ed02997a7b Fix mode and add docblock, refs #2644 2014-02-06 09:44:14 +01:00
Jordi Boggiano d26dda5c95 Merge remote-tracking branch 'olvlvl/improved_package_sorting_alone' 2014-02-06 09:41:50 +01:00
Nils Adermann aef0483cc9 Merge pull request #2667 from nicolas-grekas/master
scope isolation for user includes
2014-02-05 18:24:55 +01:00
Nicolas Grekas 6d7b9afc4b scope isolation for user includes 2014-02-05 17:33:06 +01:00
Jérôme Macias 01cd990995 Fix PSR-4 autoload classmap generator 2014-02-03 16:53:56 +01:00
Olivier Laviale 17278999ba Coding style compliance 2014-01-29 14:36:34 +01:00
Olivier Laviale 46776c8e23 Improved package sorting 2014-01-29 14:15:32 +01:00
René Kerner b0ec8ee096 * added exclude-from-classmap feature
* updated to latest master version
2014-01-27 11:42:54 +01:00
Jordi Boggiano 3c5000ad7f CS tweaks and cleanups, allow "" to set fallback dirs, refs #2459 2014-01-03 16:31:23 +01:00
Jordi Boggiano b23742e30c Merge remote-tracking branch 'donquixote/feature/psr4-complete' 2014-01-03 14:56:36 +01:00
Stan Lemon 5fd3223aec Updates per @stof 2013-12-23 11:27:33 -05:00
Stan Lemon d6c46f2091 Allow the autoloader suffix to be configured from a project's composer.json 2013-12-22 22:01:42 -05:00
Andreas Hennings c0aad84d8b Validation to make the combination of target-dir with psr-4 illegal. 2013-12-14 16:33:59 +01:00
Andreas Hennings 39c09d5192 Add psr-4 stuff in a few more places. 2013-12-14 16:28:27 +01:00
Andreas Hennings bbf6278905 AutoloadGenerator to support PSR-4. Tests included. 2013-11-26 02:53:44 +01:00
Andreas Hennings b08179e399 PSR-4 ClassLoader: Bug fix: PEAR-like path needs ".php" appended. 2013-11-25 23:22:31 +01:00
Andreas Hennings 5dd3c12d3d Further improve comments. 2013-11-25 23:22:31 +01:00
Andreas Hennings 2e80d148f8 PSR-4 loader: Fix comments: PSR-0 related methods should have comments refering to PSR-0 and prefixes. PSR-4 related methods should have comments refering to PSR-4 and namespaces. 2013-11-25 23:22:30 +01:00
Andreas Hennings c49a651d81 PSR-4 class loader: Add getters for PSR-4 prefixes. Rename PSR-0 related attributes by appending *Psr0. Add more comments. 2013-11-25 23:22:30 +01:00
Andreas Hennings 8142126b16 Add PSR-4 class loader. (tests needed) 2013-11-25 23:22:30 +01:00
Jordi Boggiano 50fbfe4d63 Filesystem/autoload fixes for windows, refs #2304, #2342, #2365 2013-10-28 11:01:17 +01:00
Jordi Boggiano 7682bc0d60 Merge remote-tracking branch 'Devolicious/feature/no-prepend' 2013-10-16 12:15:36 +02:00
Ruud Denivel c7bb3ad746 refactor prepend autoloader from cli option to config var (prepend-autoloader) in composer.json 2013-10-14 18:38:30 +02:00
Jordi Boggiano 11a0d16ccc CS fixes 2013-10-11 20:12:45 -03:00
Ruud Denivel 65c10daaf8 disable prepend option on install 2013-10-09 18:18:34 +02:00
Martin Hasoň 3c0a620ad5 Fixed path analysis 2013-09-26 14:34:41 +02:00
Nils Adermann 242c58c789 Merge pull request #2179 from naderman/plugins
Plugins
2013-09-06 04:42:27 -07:00
Jordi Boggiano 9b70b89b8f Merge pull request #2210 from Firehed/master
Change 'generated' notice to @phpdoc-style annotation
2013-09-02 03:12:29 -07:00
Nils Adermann 786ea2929b Merge remote-tracking branch 'github-composer/master' into plugins
* github-composer/master:
  Make sure directories we are downloading to are empty
  Fix parsing of trunk in SvnDriver, fixes composer/satis#88
  Fix file layout in unit tests
  Fix parse error thrown in PHP5.5+
2013-08-31 15:43:25 +02:00
Nils Adermann 3960edd64e Turn EventDispatcher into generic solution handling plugins as well 2013-08-30 12:51:41 +02:00
Alan Hollis ede2b37ae2 Fix parse error thrown in PHP5.5+
When running composer update the file generated by AutoloadGenerator was
not able to be parsed by php due to a require statement inside the foreach
loop.

The fix is to make the statement work the same as the
autoload_namespaces.php require is done.

Issue occured using the following php versions

PHP 5.5.1-2+debphp.org~precise+2
PHP 5.5.3-1+debphp.org~precise+2
2013-08-30 11:46:39 +01:00
Firehed 046d55e886 Change 'generated' notice to @phpdoc-style annotation
While it isn't an official part of the syntax, it integrates better with other
tools that ignore diffs on generated code.
2013-08-27 16:08:38 -07:00
Benji Schwartz-Gilbert f5048059d8 Fixes the autoload_namespaces generator for packages in the root of the vendor directory 2013-08-18 10:57:48 -07:00
Jordi Boggiano e3a10b31ab Abort quickly if the only match is class= in a file 2013-08-13 17:37:41 +02:00
Jordi Boggiano 3346609c5d Skip best adapter since it can create issues on some platforms, fixes #2168 2013-08-12 15:58:13 +02:00
Jordi Boggiano 7b81d51a38 Merge remote-tracking branch 'digitalkaoz/classmap_generator_finder' 2013-08-12 02:04:15 +02:00
Andreas Hennings ce8a9aae5b Slightly nicer heredoc in AutoloadGenerator::getIncludePathsFile() 2013-08-01 17:03:32 +02:00
Andreas Hennings 5369904dd3 autoload_files.php should return an array of files, instead of directly including them. 2013-08-01 15:53:54 +02:00
Andreas Hennings 8e9bdfb4da Factor the filesCode generation into a separate method. 2013-08-01 15:53:54 +02:00
Andreas Hennings f98a8f472e Generate an autoload_files.php next to autoload_namespaces.php and autoload_classes.php 2013-08-01 15:53:54 +02:00
Robert Schönthal 860483e97e reverted simplification cause of php < 5.3.6 2013-07-09 15:53:27 +02:00
Robert Schönthal f75dda759d simplified extension check in classmap generation 2013-07-09 15:33:04 +02:00
Robert Schönthal 963f189fb2 bumped finder version, reverted warning suppression 2013-07-05 12:27:48 +02:00
Robert Schönthal 1a4a104df0 use best finder adapter 2013-07-05 09:24:54 +02:00
Robert Schönthal 4af410e1b9 using finder for classmap generator 2013-06-29 22:46:04 +02:00
Jordi Boggiano 8d0b7f278e CS fixes 2013-06-13 13:28:24 +02:00
Pavel Savinov 831bd844bd Almost PHPDoc problems fixed 2013-06-13 11:05:44 +11:00
David Simon 2acb02cda9 Fixed bug parsing multiline strings with 'escaped' newlines 2013-05-21 16:29:25 -04:00
Jordi Boggiano 2e25a9298d Document a hack 2013-05-12 23:43:54 +02:00
Taylor Otwell 60cd875cc2 Added "pre-autoload-dump" event.
This event is fired before the autoload file is generated, for either
an install or update command.
2013-05-06 09:37:21 -05:00
Jordi Boggiano 976fe48a72 Optimize grabbing of first char 2013-05-06 10:16:30 +02:00
Jordi Boggiano 94175ce432 Make performance of the class loader more constant across classes 2013-05-05 10:58:52 +02:00
Jordi Boggiano 5ba147663d Use ClassLoader::set to initialize the class loader paths 2013-05-05 10:57:21 +02:00
Jordi Boggiano dc71ba557b Consistently use arrays as paths for a given namespace prefix 2013-05-05 10:56:46 +02:00
John Boehr caad88c047 Update AutoloadGenerator.php
This should fix an issue with this commit:
87a42c2f01

This commit is causing a parse error in autoload_namespaces.php:
return array(
    'zsql' => 'phar://' . '$vendorDir . '/jbboehr/zsql/build/zsql.phar',

A similar problem happens when using autoload.files as well.
2013-05-02 16:04:39 -07:00
Jordi Boggiano 5264d0637b Fix regression added in 33af9eea95, fixes #1841 2013-04-28 22:50:24 +02:00
Jordi Boggiano 566313834a Add workaround for php bug 64634 in copy 2013-04-28 17:03:05 +02:00
Jordi Boggiano 33af9eea95 Always dump packages, even if only an alias is added, fixes #1809 2013-04-28 15:33:01 +02:00
Jordi Boggiano 3ce71466f1 Treat empty paths in autoloader as ".", fixes #1727 2013-04-07 11:34:58 +02:00
Martin Hasoň 07d2f17afe [Autoload] Make all paths relative for file portability 2013-04-05 15:01:51 +02:00
Martin Hasoň 48444a028c Added support for vendor dir excluded from working dir 2013-04-01 09:27:50 +02:00
Jordi Boggiano e1eb35455f Merge pull request #1743 from sandermarechal/abs-path
Fix shortest absolute paths from cwd to classmap path
2013-03-31 05:18:56 -07:00
Sander Marechal 132f2a9d5d Cache getcwd() result 2013-03-31 13:23:51 +02:00
Sander Marechal c10e25a945 Use cross-platform absolute path check 2013-03-31 13:20:01 +02:00
Jordi Boggiano bb95a0a788 Fix docblocks 2013-03-30 19:49:59 +01:00
Sander Marechal d7697574ff Fix shortest absolute paths from cwd to classmap path 2013-03-29 17:09:39 +01:00
Jordi Boggiano 3cc5698e7b Allow PHP 5.2 autoloaders to consume namespace, classmap and include path files, fixes #1730 2013-03-27 18:45:33 +01:00
Jordi Boggiano d929a0813a Prepend the ClassLoader autoloader to avoid calling other previously registered autoloaders, fixes #1699 2013-03-16 16:14:55 +01:00
Jordi Boggiano 87a42c2f01 Fix CS 2013-03-06 23:10:03 +01:00
Jordi Boggiano 95a6be2396 Merge remote-tracking branch 'mnishihan/master' 2013-03-06 23:08:36 +01:00
Jordi Boggiano 8d55b9cced Merge remote-tracking branch 'ronnylt/script-event-post-dump-autoload'
Conflicts:
	tests/Composer/Test/Autoload/AutoloadGeneratorTest.php
2013-02-22 18:42:29 +01:00
Jordi Boggiano 5a484cb3a9 Make sure target-dir plays well with classmap and files autoload, for root and deps, refs #1550 2013-02-19 15:23:43 +01:00
Jordi Boggiano ab1256e135 Merge remote-tracking branch 'cmodijk/master' 2013-02-19 14:21:31 +01:00
Cliff Odijk 5127fe8359 added type check to autoloader fixes #1504 2013-02-14 00:10:18 +01:00
Jordi Boggiano 5165008be7 Merge remote-tracking branch 'pierredup/master' 2013-02-12 10:17:49 +01:00
Jordi Boggiano e33aebc75d Fix cs 2013-01-17 17:15:22 +01:00
Jordi Boggiano 1bd01a8b0b Merge remote-tracking branch 'joeholdcroft/autoload-namespace-prepend' 2013-01-17 17:14:27 +01:00
Joe Holdcroft 7d5e4f76fb Bug fix & changing loop + array_unshift to array_merge 2013-01-17 14:12:03 +00:00
M N Islam Shihan 41e91f3064 Fixed an issue when a phar file is used in "files" option in composer.json 2013-01-16 00:29:02 +06:00
Pierre du Plessis 84b34b70e0 Add config option to set if the PHP include path should automatically be used when generating the autoloader 2013-01-14 11:15:06 +02:00
Ronny López f627c3c603 Make Event devMode argument optional (false by default). 2013-01-10 18:12:46 +01:00
Ronny López e5cbf83185 Added post-autoload-dump script event. 2013-01-10 15:04:20 +01:00
Jordi Boggiano c80cb76b9b Always prepend autoloaders to avoid tools (i.e. phpunit) taking precedence over the project autoloader 2013-01-08 17:34:37 +01:00
Jordi Boggiano 514a3cde77 CS fixes 2013-01-05 20:01:58 +01:00
Jordi Boggiano 1beccf9f0f Fix access of the static loader property 2012-12-25 16:08:36 +01:00
Martin Hasoň 45d7eb5b53 Fixed generating packageMap in AutoloaderGenerater (fixes generating include_paths.php file) 2012-12-17 11:13:07 +01:00
Martin Hasoň 03e355f063 Fixed topological sorting of packages in AutoloadGenerator 2012-12-14 15:21:40 +01:00
Jordi Boggiano 51eca2cdfc Fix matching of classes in trailing non-php text, fixes #1409 2012-12-13 17:39:17 +01:00
Jordi Boggiano aefe3a0b11 Add support for .inc files in classmap, fixes #1396 2012-12-08 21:54:51 +01:00
Jordi Boggiano c5f3a6febd Fix optimized autoloader generation for PSR-0 configs that include non-existent dirs, fixes #1286 2012-11-27 14:23:10 +01:00
Jordi Boggiano cd4d569540 Use old-style named subpattern syntax to avoid problems with antiquated PCRE 2012-11-26 13:21:03 +01:00
Jordi Boggiano 5a01ada383 Restrict unicode chars allowed to what php core allows, refs #1361 2012-11-25 14:07:06 +01:00
Jordi Boggiano 2d7c3c9d27 Tweak #1361 to re-enable support for unicode classnames 2012-11-25 13:52:42 +01:00
Igor Wiedler 530991217b Support classmap generation for classes without space after class name
Class names with multi-byte characters are not supported.

Closes #1360.
2012-11-25 12:08:50 +01:00
Joe Holdcroft 538cdc914b Making prepend work with fallbacks & coding standards 2012-11-14 11:46:49 +00:00
Joe Holdcroft 6510ee5c4c Refactoring ClassLoader::add() to return early 2012-11-14 11:41:08 +00:00
Joe Holdcroft e74223470a - Adding prefix option to ClassLoader::add()
- Adding set method to ClassLoader for overwriting
2012-11-14 10:34:19 +00:00
Jordi Boggiano de3188ca7d Remove target dir for classmap autoloads of the root package, fixes #1308 2012-11-13 17:09:22 +01:00
Jordi Boggiano 75da832cd3 Fix parsing of large files that go over the PCRE limits 2012-11-12 12:33:46 +01:00
Jordi Boggiano bd72e3765b Restore early return to happen as early as possible 2012-11-12 10:46:14 +01:00
Victor Berchet 86bb1be61f [ClassMapGeneratot] Filter out non php code
Otherwise files like https://github.com/propelorm/Propel/blob/master/generator/lib/behavior/i18n/templates/queryUseI18nQuery.php
would fail ("class" keyword would not be filtered out by php_strip_whitespace())
2012-11-12 09:15:35 +01:00
Victor Berchet ab48114531 [ClassMapGenerator] Improve error message when the path does not exist
i.e. the composer.json has a typo
2012-11-12 07:33:15 +01:00
Victor Berchet ff5c428d60 [ClassMapGenerator] Refine the findClasses method
The code could not throw
2012-11-12 07:32:47 +01:00
Jordi Boggiano 5a763cf010 Fix scanning of empty namespace{} blocks 2012-11-11 16:29:49 +01:00
Jordi Boggiano 2368185774 Merge branch 'classmap-optim' 2012-11-11 15:56:13 +01:00
Jordi Boggiano 487e66d0a9 Allow loading of multiple composer autoloaders concurrently, fixes #1248 2012-11-10 21:54:23 +01:00
Jordi Boggiano 4c3e7802a4 Fix traits on 5.3 and handling of empty namespace blocks 2012-11-10 17:58:18 +01:00
Jordi Boggiano 8e9678a5ba Optimize classmap generation by avoiding the use of token_get_all()
First of all this seems way faster than iterating over all tokens, but
especially it reduces memory usage drastically for very large files
2012-11-10 17:50:20 +01:00
Jordi Boggiano 348ec26c91 Always return false or a class name, fixes #1231 2012-10-18 18:55:49 +02:00
Jordi Boggiano e79e7dcd8d Merge remote-tracking branch 'hason/classgenerator' 2012-10-17 17:19:23 +02:00
Martin Hasoň 9582a8abfa Added tests for consistency of data in AutoloadGenerator::sortPackageMap 2012-10-17 12:03:52 +02:00
Martin Hasoň 1ff1b8ac1f Sorted generated classmap 2012-10-17 12:00:45 +02:00
Martin Hasoň c63f0d9642 Preserved original position of package if required packages are before this 2012-10-17 10:50:53 +02:00
Martin Hasoň e75abcbb41 Fixed order of packages in the classmap autoloader 2012-10-17 01:40:15 +02:00
Martin Hasoň b7f96d5dc3 Fixed autoloader generator 2012-10-17 01:18:22 +02:00