How do i install fos-user-bundle "#2.0" alongside with Sonata-user-bundle? - fosuserbundle

I'm new to symfony framework
I installed FOSUserBundle "#2.0" and SonataAdminBundle
they are both working fine
now i wanted to install SonataUserBundle to manage my users
but in the downloading process [via composer] he said that SonataUserBundle is only compatible with FOSUserBundle "*1.3"
what SonataUserBundle accomplish ?
How can i install it with fos-user-bundle "#2.0"

For now SonataUserBundle doesn't support FOSUserBundle "2.0".
But there is alternative brunch - add_support_for_fos_user2.
You can plug it by this line:
composer require sonata-project/user-bundle dev-add_support_for_fos_user2
NOTE:
This bundle requires PHP >= 7.0 version.
Point it out in composer.json file (for example v. 7.1.0):
"config": {
"platform": {
"php": "7.1.0"
}
},

Related

How to Fix Cakephp 4 Composer Install Error

Having issues installing all packages for cakephp 4.0 via Composer. Running a fresh wamp server install on Windows with PHP 7.4.0
Here is composer output. Using the command found in the cakephp docs.
www/> composer create-project --prefer-dist cakephp/app:^4.0 myapp
Installing cakephp/app (4.0.0)
- Installing cakephp/app (4.0.0): Loading from cache
Created project in kollectit
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
- The requested package cakephp/bake ^4.0 exists as cakephp/bake[0.1.0, 0.1.10, 1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.12, 1.0.13, 1.0.14, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.10.0, 1.10.1, 1.11.0, 1.11.1, 1.11.2, 1.12.0, 1.2.0, 1.2.1, 1.2.10, 1.2.11, 1.2.12, 1.2.13, 1.2.14, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.2.9, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.x-dev, 2.0.0, 2.0.1, 2.0.2, 2.0.3, dev-3.next, dev-dereuromark-patch-1, dev-fix-old-alias, dev-master, dev-twigview-5] but these are rejected by your constraint.
Problem 2
- Installation request for cakephp/migrations 3.0.0-beta1 -> satisfiable by cakephp/migrations[3.0.0-beta1].
- cakephp/migrations 3.0.0-beta1 requires robmorgan/phinx 0.11.x-dev -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
The base cakephp installation is there in the /myapp folder, but wondering on the errors and if they are needed (if so how to resolve? )
Here is the composer.json that is created:
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "https://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=7.2",
"cakephp/cakephp": "^4.0",
"cakephp/migrations": "3.0.0-beta1",
"cakephp/plugin-installer": "^1.0",
"mobiledetect/mobiledetectlib": "2.*"
},
"require-dev": {
"cakephp/bake": "^4.0",
"cakephp/cakephp-codesniffer": "dev-next",
"cakephp/debug_kit": "^4.0",
"josegonzalez/dotenv": "3.*",
"phpunit/phpunit": "^8.0",
"psy/psysh": "#stable"
},
"suggest": {
"markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
"dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan/Psalm compatibility."
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests/",
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump",
"check": [
"#test",
"#cs-check"
],
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"stan": "phpstan analyse src/",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json",
"test": "phpunit --colors=always"
},
"prefer-stable": true,
"config": {
"sort-packages": true
},
"minimum-stability": "dev"
}
Thanks!
You need to install the latest app template (4.0.2 currently), there have been some fixes around this.
The problem is that you are using ^ on the Windows command line, where the caret character is an escape character, ie it's not being passed to composer, which will only receive cakephp/app:4.0, which means that it will install 4.0.0.
Simple fix, enclose the package argument in double quotes:
composer create-project --prefer-dist "cakephp/app:^4.0" myapp
or do not specify a version constraint at all, which will automatically give you the latest stable version:
composer create-project --prefer-dist cakephp/app myapp

Sonata User Bundle + Symfony 3.x

I use Symfony 3.0.6, Sontata Admin Bundle 3.0.0 and the Doctrine ORM Admin Bundle on dev-master. The user bundle doesnt work even with dev-master. Is there a solution for Symfony 3.x yet?
Your requirements could not be resolved to an installable set of
packages.
Problem 1
- Conclusion: remove symfony/symfony v3.0.6
- Conclusion: don't install symfony/symfony v3.0.6
- Conclusion: don't install symfony/symfony v3.0.5
- Conclusion: don't install symfony/symfony v3.0.4
- Conclusion: don't install symfony/symfony v3.0.3
- Installation request for sonata-project/user-bundle dev-master ->
satisfiable by sonata-project/user-bundle[dev-master].
- Conclusion: don't install symfony/symfony v3.0.2
- Conclusion: don't install symfony/symfony v3.0.1
- sonata-project/user-bundle dev-master requires symfony/form ^2.3 ->
satisfiable by symfony/form[.....
The SonataUserBundle just released a 3.0.0 version 3 days ago, but does not seem to be compatible with SF3 yet, given the composer.json file:
{
"name": "sonata-project/user-bundle",
"require": {
"php": "^5.3 || ^7.0",
"symfony/http-foundation": "^2.3",
"symfony/form": "^2.3",
"symfony/security": "^2.3",
"symfony/console": "^2.3",
},
[...]
}
I am afraid we will have to wait a little bit longer.
Some issues were posted about it on the official repository:
https://github.com/sonata-project/SonataUserBundle/issues/724
The author's answer:
SF 3.0 is not supported because FOSUser 1.x does not support it.
FOSUser 2.x is not stable and is not supported by our bundle right now.
For the complete story, there were plans to release a SF3 compatible version of the FOSUserBundle on december 2015, but no news about that one has came since...
https://github.com/FriendsOfSymfony/FOSUserBundle/pull/1990
Let's wait & see!

Installing cakedc/users on CakePHP 3.1 version conflict

I'm trying to install Cake dc users on a Cakephp 3.1
That's a part of my composer.json that I'm almost sure that is properly setup mantain the cake version to 3.1:
"require": {
"php": ">=5.4.16",
"cakephp/cakephp": "~3.1",
I used the following command to setup cake:
composer create-project cakephp/app ar2016-2 3.1.*
and that's the result I get when I try to install DCUsers with the composer:
composer require cakedc/users:~3.1.0
./composer.json has been updated
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
- Conclusion: remove cakephp/cakephp 3.2.1
- Conclusion: don't install cakephp/cakephp 3.2.1
- cakedc/users 3.1.0 requires cakephp/cakephp ~3.1.0 -> satisfiable by cakephp/cakephp[3.1.0, 3.1.0-RC1, 3.1.0-beta, 3.1.0-beta2, 3.1.1, 3.1.10, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9].
...
It looks that it detects CakePHP 3.2.1 but everywhere I check show me that I'm using the proper 3.1. version. Any Idea?
Thanks in advance,
David
I'd doubt that it shows that you've installed 3.1 anywhere at all, because the latest release is 3.2.1 and, ~3.1 means >= 3.1 and < 4.0.0, and therefore I'm pretty sure that you have the latest version installed, ie 3.2.1, a quick bin/cake will probably confirm that.
https://getcomposer.org/doc/articles/versions.md#tilde
The cakedc/users version that you have requested, requires cakephp/cakephp:3.1.*, which means >= 3.1 and < 3.2, hence the error.
https://getcomposer.org/doc/articles/versions.md#wildcard
So either use the master branch of the plugin (it requires cakephp/cakephp:~3.1) until a proper release is issued, or use a more specific version constraint for the CakePHP framework, like 3.1.*
Thanks for the answer but it's just fixed, it was a problem of the plugin itself and cakedc fixed.

cakephp websocket ratchet install error

I am trying to install Cakephp Ratchet Plugin in existing project.
My CakePHP version is 2.4.3.
It says to follow this link which has following steps:
$ cd myproject/app/
$ curl -s https://getcomposer.org/installer | php
$ php composer.phar require --no-update opauth/opauth:dev-wip/1.0 opauth/twitter:dev- wip/1.0
$ php composer.phar config vendor-dir Vendor
$ php composer.phar install
I am not very familiar with composer and when i do the last step,it shows following error....
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package opauth/opauth could not be found in any version, there may be a typo in the package name.
Problem 2
- The requested package opauth/twitter could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
EDIT:
Composer.json is like this
{
"require": {
"opauth/opauth": "dev-wip/1.0",
"opauth/twitter": "dev-wip/1.0"
},
"config": {
"vendor-dir": "Vendor"
}
}
As already mentioned in my comment, the Ratchet Plugin has nothing to do with Opauth, the linked article over at ceeram.github.io should only serve as an example on how to configure Composer and the CakePHP bootstrap.
However, for Composer autoloading in CakePHP I'd recommend to refer to the CakePHP cookbook, even if you're not including CakePHP itself via Composer:
http://book.cakephp.org/2.0/en/installation/advanced-installation.html
Long story short, what the "Getting Started / 2. Composer" section of the plugin docs want you to do, is to require the ratchet plugin, to make sure the vendor dir points to /app/Vendor/, and to include the Composer autoloader in your bootstrap.php.
composer.json (assuming it's placed in /app)
{
"require": {
"wyrihaximus/ratchet": "dev-master"
},
"config": {
"vendor-dir": "Vendor"
}
}
bootstrap.php (as per Cookbook)
// Load Composer autoload.
require APP . '/Vendor/autoload.php';
// Remove and re-prepend CakePHP's autoloader as Composer thinks it is the
// most important.
// See: http://goo.gl/kKVJO7
spl_autoload_unregister(array('App', 'load'));
spl_autoload_register(array('App', 'load'), true, true);
Run composer install or composer update and you should be good.

Is it normal that zendframework/zend-http package requires 49 components?

Here's the composer.json:
{
"repositories": [
{
"type": "composer",
"url": "https://packages.zendframework.com/"
}
],
"require": {
"zendframework/zend-http": "2.*"
}
}
... and the exhaustive list:
Authentication Code Db Escaper Filter InputFilter Log Mime Paginator Server Stdlib Uri XmlRpc
Barcode Config Debug EventManager Form Json Mail ModuleManager Permissions ServiceManager Tag Validator
Cache Console Di Feed Http Ldap Math Mvc ProgressBar Session Test Version
Captcha Crypt Dom File I18n Loader Memory Navigation Serializer Soap Text View
Some of them actually make sense. But what about Barcode,Captcha,Navigation or even Dbfor instance?
Edit
$ rm -rf vendor
$ rm -rf ~/.composer/
$ rm composer.lock
$ more composer.json
{
"require": {
"zendframework/zend-http": "2.*"
}
}
$ composer self-update
You are using the latest composer version.
$ composer install
Loading composer repositories with package information
Installing dependencies
- Installing zendframework/zendframework (2.1.3)
Downloading: 100%
zendframework/zendframework suggests installing doctrine/common (Doctrine\Common >=2.1 for annotation features)
zendframework/zendframework suggests installing ext-intl (ext/intl for i18n features)
zendframework/zendframework suggests installing pecl-weakref (Implementation of weak references for Zend\Stdlib\CallbackHandler)
zendframework/zendframework suggests installing zendframework/zendpdf (ZendPdf for creating PDF representations of barcodes)
zendframework/zendframework suggests installing zendframework/zendservice-recaptcha (ZendService\ReCaptcha for rendering ReCaptchas in Zend\Captcha and/or Zend\Form)
Writing lock file
Generating autoload files
PS: pleased that some consider my question as simply good to be closed ... I really thank the others for having tryed to answer.
It doesn't.
Using that composer.json file, I get this:
$ composer.phar install
Loading composer repositories with package information
Installing dependencies
- Installing zendframework/zend-stdlib (2.1.3)
Downloading: 100%
- Installing zendframework/zend-servicemanager (2.1.3)
Downloading: 100%
- Installing zendframework/zend-filter (2.1.3)
Downloading: 100%
- Installing zendframework/zend-i18n (2.1.3)
Downloading: 100%
- Installing zendframework/zend-validator (2.1.3)
Downloading: 100%
- Installing zendframework/zend-escaper (2.1.3)
Downloading: 100%
- Installing zendframework/zend-uri (2.1.3)
Downloading: 100%
- Installing zendframework/zend-loader (2.1.3)
Downloading: 100%
- Installing zendframework/zend-http (2.1.3)
Downloading: 100%
zendframework/zend-stdlib suggests installing pecl-weakref (Implementation of weak references for Stdlib\CallbackHandler)
zendframework/zend-servicemanager suggests installing zendframework/zend-di (Zend\Di component)
zendframework/zend-filter suggests installing zendframework/zend-crypt (Zend\Crypt component)
zendframework/zend-validator suggests installing zendframework/zend-db (Zend\Db component)
zendframework/zend-validator suggests installing zendframework/zend-math (Zend\Math component)
Writing lock file
Generating autoload files
The full list of dependencies that zend-http has are:
Escaper
Filter
i18n
Loader
ServiceManager
StdLib
Uri
Validator

Resources