Comments (2)
Thanks for the astonishing fast reply Brian!
I searched for the requirement that had composer/composer
in their requirements and funnily enough it was the strauss package itself! After switching to the .phar file the problem was resolved. I needed some extra changes too (also based on your reply). So for anybody coming accross this, these are my changes:
- Removed
brianhenryie/strauss
from my requirements. - Now using the .phar from the latest release.
- Changed the command in my
prefixer.sh
fromvendor/bin/strauss
to:php strauss.phar
- Changed
target_directory
to:vendor
- Renamed
exclude_from_copy
toexclude_from_prefix
in my config to acommodate for thetarget_directory
change. - Added the below to my
autoload
config as per issue 34 and this reply. (#34)
"classmap": [
"vendor"
]
- Also removed the autoload from the prefixed folder as this doesnt exist anymore. Only this line is now sufficient to autoload everything:
require_once __DIR__ . '/vendor/autoload.php';
The issue mentioned here is resolved. Still running into another issue where a specific directory (/lazy) of nesbot/carbon
doesnt get prefixed. But I will create a new issue for it as it is not related.
from strauss.
I suspect what's happening is that composer/composer
is an explicit require
dependency of one of your dependencies (a full composer.json
would be helpful here) and so it is being copied and then deleted. An exclusion rule should be written for the Composer autoload files.
You could try setting the target_directory
to vendor
, and use the exclude_from_prefix
setting for your two exclusions. Then it will prefix in-place and won't delete anything at all.
require_once __DIR__ . '/vendor/prefixed/autoload.php';
I think maybe that line won't be necessary after composer dump-autoload
is run because you're using a sub-directory of vendor
to copy the files to, and dump-autoload
should scan the entire vendor
directory
find vendor -type d -empty -delete
I've been meaning to add this to Strauss itself.
from strauss.
Related Issues (20)
- Warnings / broken autoloading with Strauss 0.18.0 vs 0.17.0 HOT 5
- Symlink handling on Windows
- Is there a way to control the permission of the vendor-prefixed folder? HOT 3
- return namespaced function use HOT 1
- Having trouble to prefix classes using last stable version HOT 5
- PHP Fatal error: Trait "Psr\Log\LoggerAwareTrait" not found in C:\********\vendor\brianhenryie\strauss\src\Console\Commands\Compose.php on line 28 HOT 1
- `use Prefixed_GlobalClass as ClassAlias`
- Update prefixes in function document HOT 4
- Recommended way to handle non-php assets / paths? HOT 2
- Not Namespacing instanceof Statements HOT 2
- Remove wrong information about zero configuration HOT 1
- Still stuck at "Performing replacements..." HOT 2
- Strauss does not remove namespaced classes from the composer classmap files when optimize-autoloader is enabled HOT 2
- It does not prefix everything HOT 1
- Strauss 0.16.0 output wrong version number HOT 3
- Add ability to retrieve plain version from PHAR HOT 2
- Symfony polyfill-php80 stubs causing error HOT 3
- Invalid relative path used on Windows HOT 3
- Class whose function returns an instance of itself calling the unprefixed class name in its return statement HOT 4
- strauss duplicates the file path causing error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strauss.