Joe Holdcroft
7d5e4f76fb
Bug fix & changing loop + array_unshift to array_merge
12 years ago
M N Islam Shihan
41e91f3064
Fixed an issue when a phar file is used in "files" option in composer.json
12 years ago
Pierre du Plessis
84b34b70e0
Add config option to set if the PHP include path should automatically be used when generating the autoloader
12 years ago
Ronny López
f627c3c603
Make Event devMode argument optional (false by default).
12 years ago
Ronny López
e5cbf83185
Added post-autoload-dump script event.
12 years ago
Jordi Boggiano
c80cb76b9b
Always prepend autoloaders to avoid tools (i.e. phpunit) taking precedence over the project autoloader
12 years ago
Jordi Boggiano
514a3cde77
CS fixes
12 years ago
Jordi Boggiano
1beccf9f0f
Fix access of the static loader property
12 years ago
Martin Hasoň
45d7eb5b53
Fixed generating packageMap in AutoloaderGenerater (fixes generating include_paths.php file)
12 years ago
Martin Hasoň
03e355f063
Fixed topological sorting of packages in AutoloadGenerator
12 years ago
Jordi Boggiano
51eca2cdfc
Fix matching of classes in trailing non-php text, fixes #1409
12 years ago
Jordi Boggiano
aefe3a0b11
Add support for .inc files in classmap, fixes #1396
12 years ago
Jordi Boggiano
c5f3a6febd
Fix optimized autoloader generation for PSR-0 configs that include non-existent dirs, fixes #1286
12 years ago
Jordi Boggiano
cd4d569540
Use old-style named subpattern syntax to avoid problems with antiquated PCRE
12 years ago
Jordi Boggiano
5a01ada383
Restrict unicode chars allowed to what php core allows, refs #1361
12 years ago
Jordi Boggiano
2d7c3c9d27
Tweak #1361 to re-enable support for unicode classnames
12 years ago
Igor Wiedler
530991217b
Support classmap generation for classes without space after class name
...
Class names with multi-byte characters are not supported.
Closes #1360 .
12 years ago
Joe Holdcroft
538cdc914b
Making prepend work with fallbacks & coding standards
12 years ago
Joe Holdcroft
6510ee5c4c
Refactoring ClassLoader::add() to return early
12 years ago
Joe Holdcroft
e74223470a
- Adding prefix option to ClassLoader::add()
...
- Adding set method to ClassLoader for overwriting
12 years ago
Jordi Boggiano
de3188ca7d
Remove target dir for classmap autoloads of the root package, fixes #1308
12 years ago
Jordi Boggiano
75da832cd3
Fix parsing of large files that go over the PCRE limits
12 years ago
Jordi Boggiano
bd72e3765b
Restore early return to happen as early as possible
12 years ago
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())
12 years ago
Victor Berchet
ab48114531
[ClassMapGenerator] Improve error message when the path does not exist
...
i.e. the composer.json has a typo
12 years ago
Victor Berchet
ff5c428d60
[ClassMapGenerator] Refine the findClasses method
...
The code could not throw
12 years ago
Jordi Boggiano
5a763cf010
Fix scanning of empty namespace{} blocks
12 years ago
Jordi Boggiano
2368185774
Merge branch 'classmap-optim'
12 years ago
Jordi Boggiano
487e66d0a9
Allow loading of multiple composer autoloaders concurrently, fixes #1248
12 years ago
Jordi Boggiano
4c3e7802a4
Fix traits on 5.3 and handling of empty namespace blocks
12 years ago
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
12 years ago
Jordi Boggiano
348ec26c91
Always return false or a class name, fixes #1231
12 years ago
Jordi Boggiano
e79e7dcd8d
Merge remote-tracking branch 'hason/classgenerator'
12 years ago
Martin Hasoň
9582a8abfa
Added tests for consistency of data in AutoloadGenerator::sortPackageMap
12 years ago
Martin Hasoň
1ff1b8ac1f
Sorted generated classmap
12 years ago
Martin Hasoň
c63f0d9642
Preserved original position of package if required packages are before this
12 years ago
Martin Hasoň
e75abcbb41
Fixed order of packages in the classmap autoloader
12 years ago
Martin Hasoň
b7f96d5dc3
Fixed autoloader generator
12 years ago
hinikato
1989479634
Fixed class normalization for class map case.
12 years ago
Adrien Brault
fd58c24a9f
ComposerAutoloaderInitXXX::getLoader behaves like a ClassLoader singleton
...
Calling ComposerAutoloaderInit::getLoader twice when a package requires a .php file containing functions, lead to the functions to be declared twice, and cause an error.
In my case, using behat + symfony2extension + assetic, the error that occured:
PHP Fatal error: Cannot redeclare assetic_init() (previously declared in vendor/kriswallsmith/assetic/src/functions.php:20) in /vendor/kriswallsmith/assetic/src/functions.php on line 26
Fatal error: Cannot redeclare assetic_init() (previously declared in /vendor/kriswallsmith/assetic/src/functions.php:20) in /vendor/kriswallsmith/assetic/src/functions.php on line 26
12 years ago
Filip Procházka
80e9999d1c
typo
12 years ago
Filip Procházka
9d8db4e148
AutoloadGenerator: respect dependencies, when requiring files
12 years ago
Christophe Coevoet
66b83a39d2
Removed a PHP notice when dumping the autoloader
...
This occured when the root package has a target-dir but does not have
configure a PSR-0 autoloader.
Fixes #1028
12 years ago
Jordi Boggiano
521bbe6556
CS fixes
12 years ago
Jordi Boggiano
ef637c8f1a
CS fixes
12 years ago
Jordi Boggiano
dbd44d6bcf
Handle empty namespaces
12 years ago
Jordi Boggiano
44d7d4a38e
Make PSR0 scanning optional
12 years ago
Jordi Boggiano
ee14950972
Add whitelist to the classmap generator to allow skipping of Test files
12 years ago
Jordi Boggiano
48c46ce3b6
Automatically generate classmaps for all PSR-0 packages to speed things up, fixes #541 , fixes #127
12 years ago
Jordi Boggiano
289d23b5cc
Optimization for autoload misses, refs #964
12 years ago
Jordi Boggiano
4f0ad98905
Always include the ClassLoader since autoload_real is included only once, refs #963
12 years ago
Jordi Boggiano
30fdf379aa
Minor consistency tweaks
12 years ago
Victor Berchet
d2dc73e361
[Autoload] Set $vendorDir et $baseDir in ComposerAutoloaderInitTargetDir::getLoader()
12 years ago
Victor Berchet
4c82c35dbc
[Autoload] Generate the autoloader_real file in the target directory
12 years ago
Victor Berchet
2c065416eb
[Autoload] generate an autoload_real.php file
12 years ago
Victor Berchet
963fedc9a5
[Autoload] remove closures because of a bug in APC
...
https://bugs.php.net/bug.php?id=52144
https://bugs.php.net/bug.php?id=61576
12 years ago
Taylor Otwell
a834efe7c9
Fix directory handling when auto-loading files.
12 years ago
Nils Adermann
4e9e66a957
Make sure custom vendor paths don't break file autoloading
12 years ago
Johannes M. Schmitt
9f150b1c1e
fixes a bug when root package has a 'files' autoload entry
12 years ago
Jordi Boggiano
defe5766a4
Revert "Merge remote-tracking branch 'till/bugfix-broken-classmap'"
...
This reverts commit d837b8a657
, reversing
changes made to 520d915860
.
12 years ago
Jordi Boggiano
6fb5d26474
Revert "Add test and some fixes to allow absolute paths, refs #869"
...
This reverts commit a2a2f4af59
.
12 years ago
Jordi Boggiano
a2a2f4af59
Add test and some fixes to allow absolute paths, refs #869
12 years ago
Jordi Boggiano
d837b8a657
Merge remote-tracking branch 'till/bugfix-broken-classmap'
12 years ago
Sylvain Filteau
51404659ef
Change the order of the include paths
...
Composer installed libraries should have precedence over other libraries in the
system (like PEAR installed libraries).
Made composer prepend it's include_path configuration instead of appending it.
12 years ago
till
2823c78856
Allow absolute paths in composer.json and don't prepend them with a funny $baseDir variable.
12 years ago
Nils Adermann
d84273ee34
Merge pull request #833 from Seldaek/installmgr_cleanup
...
Use the config object to define the vendor dir and not the installation manager
12 years ago
Jordi Boggiano
adaa788955
Require file autoloads after the autoloader is registered
12 years ago
Jordi Boggiano
b876dcbafb
Use the config object to define the vendor dir and not the installation manager
12 years ago
Jordi Boggiano
66e9dcddf4
CS fixes
12 years ago
Jordi Boggiano
383c3f0153
Avoid tokenizing files for nothing
12 years ago
Jordi Boggiano
4bbb168d44
Remove BC code
12 years ago
Jordi Boggiano
67cf46546d
Merge pull request #791 from liuggio/patch-1
...
just added a \ before RuntimeException
12 years ago
Giulio De Donato
5c08b5b215
fixed #790
12 years ago
Giulio De Donato
3a53b06f00
just added a \ before RuntimeException (sorry I didn't run the test)
12 years ago
Jordi Boggiano
1df9c62583
Cosmetic fixes to autoload generation
12 years ago
Benjamin Eberlei
5c5e962b5a
Add Files Autoloading key. This is a necessary feature to allow purely or partly functional libraries to be "autoloadable" by composer by calling require_once on every file in the "autoload"."files" list.
12 years ago
Jordi Boggiano
c440b4594a
More PSR-2 goodness
12 years ago
Jordi Boggiano
1bd4ccbd54
php-cs-fixer magic
12 years ago
Jordi Boggiano
5c0c101327
Wrap token_get_all for better debuggability
12 years ago
Adán Lobato
61eb0119f1
Fixed some mistakes at PHPDoc
12 years ago
Jordi Boggiano
1a255420b0
Ignore aliases in autoload generator
12 years ago
Jordi Boggiano
11edea8aee
Add deprecation warning to old .composer files
12 years ago
Jordi Boggiano
aff7745231
Fix target-dir autoloader
12 years ago
Jordi Boggiano
15ab5868a3
Move composer metafiles back in a composer dir, except autoload.php
12 years ago
Nils Adermann
e74e218bdb
Merge pull request #602 from Seldaek/target_dir_autoload
...
Target dir autoloading for root packages, fixes #139
12 years ago
Jordi Boggiano
ab0ced493c
Make sure BC dir exists
12 years ago
Jordi Boggiano
51711c2f73
Fix multi-prefix handling
12 years ago
Jordi Boggiano
66135538c1
Allow root packages packages with target-dir to be autoloaded, fixes #139
12 years ago
Jordi Boggiano
22fe296ad0
Move .composer files out into the vendor dir, fixes #497
12 years ago
Jordi Boggiano
b999d18365
Improve include_paths generation, fixes #596
12 years ago
Jordi Boggiano
83b52b5b7f
Avoid blowing up on misconfigured autoload entries
12 years ago
Jordi Boggiano
8f24a04a1d
Make sure vendor dir exists before dumping autoloader
12 years ago
Jordi Boggiano
3c07b4338a
Rename include-paths to include-path, add deprecated warnings, only generate file if it is needed
12 years ago
Christoph Hochstrasser
68c12c3516
Do set_include_path only if any package define include paths.
12 years ago
Christoph Hochstrasser
f369104bb1
Packages can define include paths.
12 years ago
Jordi Boggiano
2d9739bd05
Add support for files in classmap autoload config, fixes #463
12 years ago
Jordi Boggiano
30cfb69739
Add support for mapping a namespace prefix onto many dirs in the autoload config
12 years ago
Jordi Boggiano
5f30206c69
Merge remote-tracking branch 'hason/classloader'
12 years ago
Baptiste "Talus" Clavie
15b70e2096
[ClassLoader] Removing trailing whitespaces
12 years ago
Baptiste "Talus" Clavie
6957743aee
[ClassLoader] Corrected indentation
12 years ago
Baptiste "Talus" Clavie
6782287091
[ClassLoader] Got an if-condition out of a unnecessary loop
12 years ago
Martin Hasoň
1f8c9eeb6c
Added parameter $inDirectory to method Filesystem::findShortestPath
12 years ago
Martin Hasoň
afc04c9e53
Fixed creating shortest paths in AutoloadGenerator
12 years ago
Jordi Boggiano
744f4b7c9a
Backport trait support in ClassMapGenerator from symfony
12 years ago
Jordi Boggiano
f8a09eaa3f
Make classmaps relative instead of absolute for file portability
12 years ago
Benjamin Eberlei
671cd5ee08
Add tests for ClassMapGenerator
13 years ago
Benjamin Eberlei
1af3604303
Add support for class-map generation.
13 years ago
Andrew Cobby
2451336284
Fixed syntax error in example code in header comment
13 years ago
Jordi Boggiano
5d414436ba
Avoid phpunit process-isolation errors with the autoload closure
13 years ago
Jordi Boggiano
5da021ffa7
Moved Filesystem to base Util namespace
13 years ago
Jordi Boggiano
ec352b1e84
Add support for adding more than one fallback dir
13 years ago
Jordi Boggiano
0e7c0d918f
Add useIncludePath support to ClassLoader
13 years ago
Jordi Boggiano
5daaba9e62
Extract some code in a AutoloadGenerator::buildPackageMap method
13 years ago
Jordi Boggiano
8c535b1961
Allow the Composer ClassLoader to be unregistered easily
13 years ago
Jordi Boggiano
15d78e6ad1
Fix autoload generator with vendor-dir = working-dir
13 years ago
Martin Hasoň
d27989c808
Fixed obscure code
13 years ago
Jordi Boggiano
e90a8dc4c9
Fix feedback from 7222c1
13 years ago
Jordi Boggiano
7222c111ed
Make sure multiple autoload files can be used together, fixes #207
13 years ago
Beau Simensen
2d721f5792
Standards fixes per @stof
13 years ago
Beau Simensen
e8fcf281fa
Autoload Generator handles multiple PSR-0 paths
...
The Autoload Generator was not behaving exactly as expected.
This PR is an alternate version of #203 based on some of
@stof's input on that PR.
The main differences are:
* The main package is added first instead of last
* parseAutoloads returns a different structure:
array('psr-0' => array('Ns\\Foo' => array('installDir')))
* dump and createLoader updated to account for new structure
13 years ago
Jordi Boggiano
2c367e7f39
Allow multiple fallback dirs
13 years ago
Pierre Minnieur
3b1843827a
removed the `return false` as we only need a positive return information
13 years ago
Pierre Minnieur
4242a05a0e
added Boolean return values for loadClass() method
13 years ago
Jordi Boggiano
d22b80d13b
Allow "" as autoload prefix for fallback dir
13 years ago
Jordi Boggiano
304ce3b375
Fix relative target dirs
13 years ago
Jordi Boggiano
bc88d86983
Make use of Filesystem class in AutoloadGenerator
13 years ago
Jordi Boggiano
cb44ba8325
Fix autoload handling of main project
13 years ago
Jordi Boggiano
f5b7e968b2
Minor adjustments to merged PR
13 years ago
Ant Cunningham
e0400773f7
Adding support for configurable vendor path in composer.json.
13 years ago
Henrik Bjørnskov
8180117584
AutoloadGenerator.php miscalculates the path
...
Add tenary check to make sure relative specified paths arent seen as
absolute.
Fixises #94
13 years ago
Jordi Boggiano
1a7bf8a7f8
Bugfixes
13 years ago
Jordi Boggiano
b7f6cf69ab
Add tests and fixes some issues
13 years ago
Jordi Boggiano
c8859240d2
Add InstallerInstaller, refactored AutoloadGenerator, fixes #59
13 years ago
Jordi Boggiano
5e3c55f171
Add support for multiple packages defining the same namespace prefix
13 years ago
Jordi Boggiano
bd712db727
Reverse-orders namespaces by specificity
13 years ago
Jordi Boggiano
1ca3e5e5e2
Generate a map separated from the autoloader, fixes #74
...
Also the loader is now returned by the autoload.php
13 years ago
Fabien Potencier
03b06ebbca
Fix path for autoloaded libs as the .composer/ dir is now under the vendor/ one.
13 years ago
Fabien Potencier
9e7ebd9280
Fix autoload.php generator
13 years ago
Jordi Boggiano
89caa9b117
Rewrite autoloader to use only PSR-0, remove splitting of PEAR path
13 years ago
Jordi Boggiano
c03a739548
Use psr-0 instead of psr0
13 years ago
Jordi Boggiano
be47991b36
Build a standalone autoload file
13 years ago
Jordi Boggiano
8a571c05db
Fix issues in new autoloader code
13 years ago
Igor Wiedler
808a2c9448
[composer] wrap UniversalClassLoader require in if class_exists
13 years ago
Igor Wiedler
aa7c4b8ef7
[autoload] refactor getFullPackage into populateAutoloadInformation
13 years ago
Igor Wiedler
9d238330b3
[autoload] refactor autoload generation code into a AutoloadGenerator
13 years ago