Comments (7)
That's an interesting idea. What sort of projects need that ability?
from morse.
I can't really think of a proper use for this feature. Dependencies should be handled by Composer, and if a dependency is missing, it'll be obvious via the error message/s
Now an interesting take on this would be checking if framework specific helpers exist (non-namespaced functions). For example, Laravel Helpers or Wordpress functions. In saying that though, I still believe this should be handled by Composer as it deals with dependencies instead of cross-platform environments.
from morse.
One of the big benefits of Morse is dealing with situations where you aren't in control of the dependancies. e.g. if you know that your code will often be used with WordPress, and if so, you can call out to some WP function to make life easier.
So I'm interested in this - I'm just not sure if this is a theoretical problem or a real problem to solve.
from morse.
Here's a potential real-world usage example:
https://github.com/michelf/php-markdown/blob/master-stable/markdown.php#L70
from morse.
@drewm How would you handle version comparison (new functions in v4 versus v5)? Or would you just have a broad check, and leave version comparison to the user?
For frameworks that are decoupled like Laravel, how would you check if one package is installed (such as 'illuminate/database') versus the whole framework?
(Laravel isn't the best example of a decoupled framework 😏).
from morse.
Valid question.
from morse.
I can't really think of a proper use for this feature. Dependencies should be handled by Composer, and if a dependency is missing, it'll be obvious via the error message/s"
Good point.
Regarding individual packages: as far as I know PHP doesn't provide any means for validating namespace existance. Checking a known class inside a package could work, but there's no knowing when the package author decides to remove the class.
Or perhaps validate that the composer.json
file exists in the vendor/author/package
directory (this would be safest with using the Composer style author/package
naming convention for checks)? Can the vendor
directory name be defined by Composer users themselves?
from morse.
Related Issues (6)
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 morse.