ayesh / composer-preload Goto Github PK
View Code? Open in Web Editor NEWPreload your sweet sweet code to opcache with a composer command, making your code faster to run.
License: MIT License
Preload your sweet sweet code to opcache with a composer command, making your code faster to run.
License: MIT License
If you have symfony/console 5.x installed globally/for composer, then you get the following error:
Fatal error: Uncaught TypeError: Return value of "Ayesh\ComposerPreload\Composer\Command\PreloadCommand::execute()" must be of the type int, "null" returned. vendor/symfony/console/Command/Command.php:259
Needs to add a return 0;
Deprecated: Return type of Ayesh\ComposerPreload\PreloadList::getIterator(): iterable should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Preload file uses absolute paths. Unless both of your servers have same directory hierarchy, you cannot do this. It is recommend not to include the vendor/preload.php file in your version control system.
But there is another case - you use build server, prepare package and upload code to server. Build server has different path. In my example I use Heroku
Hi,
I wanted to try your plugin out, but I got the following issues:
Can't preload unlinked class AbcChild: Unknown parent
Can't preload unlinked class BcdImplementation: Unknown interface
It means that in order for preloading to work, dependencies should be resolved first, and classes should be preloaded in the right order.
due to this line : https://github.com/Ayesh/Composer-Preload/blob/v0.1.1/src/PreloadWriter.php#L74
should be
if (!\function_exists('opcache_compile_file') || !\ini_get('opcache.enable')) {
I was excited to try this out with Drupal 8, but it seems to require symfony 4, and Drupal 8 is symfony 3. That should probably go into the README.
Thanks for the excellent thinking and work on this!
Using version ^0.0.4 for ayesh/composer-preload
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for ayesh/composer-preload ^0.0.4 -> satisfiable by ayesh/composer-preload[v0.0.4].
- Conclusion: remove symfony/finder v3.4.18
- Conclusion: don't install symfony/finder v3.4.18
- ayesh/composer-preload v0.0.4 requires symfony/finder ^4.1 -> satisfiable by symfony/finder[4.1.x-dev, 4.2.x-dev, v4.1.0, v4.1.0-BETA1, v4.1.0-BETA2, v4.1.0-BETA3, v4.1.1, v4.1.2, v4.1.3, v4.1.4, v4.1.5, v4.1.6, v4.1.7, v4.2.0-BETA1, v4.2.0-BETA2].
- Can only install one of: symfony/finder[4.1.x-dev, v3.4.18].
- Can only install one of: symfony/finder[4.2.x-dev, v3.4.18].
- Can only install one of: symfony/finder[v4.1.0, v3.4.18].
- Can only install one of: symfony/finder[v4.1.0-BETA1, v3.4.18].
- Can only install one of: symfony/finder[v4.1.0-BETA2, v3.4.18].
- Can only install one of: symfony/finder[v4.1.0-BETA3, v3.4.18].
- Can only install one of: symfony/finder[v4.1.1, v3.4.18].
- Can only install one of: symfony/finder[v4.1.2, v3.4.18].
- Can only install one of: symfony/finder[v4.1.3, v3.4.18].
- Can only install one of: symfony/finder[v4.1.4, v3.4.18].
- Can only install one of: symfony/finder[v4.1.5, v3.4.18].
- Can only install one of: symfony/finder[v4.1.6, v3.4.18].
- Can only install one of: symfony/finder[v4.1.7, v3.4.18].
- Can only install one of: symfony/finder[v4.2.0-BETA1, v3.4.18].
- Can only install one of: symfony/finder[v4.2.0-BETA2, v3.4.18].
- Installation request for symfony/finder (locked at v3.4.18) -> satisfiable by symfony/finder[v3.4.18].
Drupal 8 really needs this :)
I'm successful with it (at the composer require level) on TYPO3 v9.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.