composer create-project - command donot work - composer-php

I have my project on github containing composer.json in the root directory.
This is how my composer.json code looks like:
{
"name": "vendor/projectname",
"description": "My first Composer project",
"authors": [
{
"name": "John Deo",
"email": "johndeo#demo.com"
}
],
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"php": "~5.3"
}
}
I had defined/submited my package on packagist.org.
Now when I try to get the project in my localhost using composer create-project - commands one of its work and another do not work.
1. composer create-project -s dev vendor/projectname >> WORKS
2. composer create-project vendor/projectname >> DO NOT WORK
Can someone please tell why the second command does not work.
What am I missing or doing wrong?
Please Help!

You're missing a stable version of vendor/projectname. In git, a tag (without flag) is a stable version and branches are dev versions. So you have to tag a release (e.g. git tag 1.0.0).

Related

I cant install ffmpeg binary driver on my laravel project

I am trying to install ffmpeg binary on my laravel application but I am getting this error. Could not find a matching version of package php-ffmpeg/binary-driver. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (dev). I am using laravel 6.4.1
My composer.json
{
"require": {
"pawlox/video-thumbnail": "^1.0",
"lakshmaji/thumbnail": "^1.4",
"pion/laravel-chunk-upload": "^1.3",
"pbmedia/laravel-ffmpeg": "^5.0"
},
"repositories": [{
"type": "vcs",
"url": "https://github.com/PHP-FFMpeg/BinaryDriver.git"
}]
}
composer require php-ffmpeg/binary-driver=dev-master
Any Solutions. Thanks
php-ffmpeg is not a front-end package, so you have to install it by your composer and it is on composer.json not package.json. you can find windows version of php-ffmpeg here:
For Windows users: Please find the binaries at

How to write an odd case version constraint for composer?

The constraint that I am interested in is
"require":{ "php": "..."
Is there a way to target php 7.1 for the project packages in composer.json even though I'm running 7.2 when I call composer update/install on the command line?
You can use platform configuration from Composer: https://getcomposer.org/doc/06-config.md#platform
Basically, your composer.json would look like this:
{
"require": {
...
},
"config": {
"platform": {
"php": "7.1"
}
}
}
This will make sure that you install only packages compatible with PHP 7.1, no matter which PHP version you use to actually install the packages.

Problems installing Laravel 4 on Windows 7 using XAMP

After installing Composer, I then went to c:\xampp\htdocs and executed the following command:
composer create-project laravel/laravel khandakhulu --prefer-dist
I then get the following error:
[Composer\Repository\RepositorySecurityException] The contents of http://packagist.org/p/laravel/laravel$a996426ffd2d6fcd0d9a 2dfdd97171b28b3d196d34061f15d79ce67004b9c19d.json do not match its signatur e. This should indicate a man-in-the-middle attack. Try running composer ag ain and report this if you think it is a mistake.
Basically we need to force the composer use https repository at composer.json as we know from Laravel.io Forum
But we don't have any skeleton of laravel project. So, use Laravel Installer instead. This global installation generate composer.json at ~/.composer/composer.json and modify to this
{
"require": {
"laravel/installer": "~1.1"
},
"repositories": {
"packagist": { "url": "https://packagist.org", "type": "composer" }
}
}
First time installation of Laravel Installer maybe will get same error, after you force the respository URL. Finally, create your new Laravel application.
~/.composer/vendor/bin/laravel -v new justapp

composer not downloading latest composer.json from github?

Here's my projects composer.json:
{
"require": {
"phpseclib/phpseclib": "0.3.x"
}
}
Here's phpseclib's composer.json:
https://github.com/phpseclib/phpseclib/blob/master/composer.json
Note how that file has in it this line:
"System": "phpseclib/"
When I do cat vendor/phpseclib/phpseclib/composer.json I don't see that line. Why not?
You have told Composer to download the latest tagged version of "phpseclib/phpseclib" that matches "0.3.x".
First - there is no version tagged since they added "System": "phpseclib/" so Composer isn't downloading it. You should set the required version to be dev-master if you want to get the absolutely latest version.
Second - I don't think 0.3.x isn't a valid semver version. Did you mean 0.3.* or the equivalent ~0.3 ?

Composer test branch install

I have made a test branch to test some composer installations:
https://github.com/Sangoku/laravel4-idehelper-generator/tree/compabilityTest
Now I want to install via Composer this changed branch on my Laravel project, but I don't know how I could tell composer to pull my version of the code.
I don't know Composer enough to tell it which branch he should pull.
Edit your composer.json and:
require the package
"require": {
...
"jonphipps/idehelper": "dev-master"
},
And set the repository for it to be downloaded from
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Sangoku/laravel4-idehelper-generator.git"
}
],

Resources