cakephp websocket ratchet install error - cakephp

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.

Related

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

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"
}
},

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.

Composer packages update but don't install

After doing
sudo php composer.phar update
I get the following:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Installing SOME_PACKAGE (dev-master 6fb0f62)
Cloning SOME_TOKEN
Writing lock file Generating autoload filesUpdating
But when I do sudo php composer.phar install I get
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Does someone have any idea on what might be happening? I have a composer.json, composer.phar and composer.lock all in the same folder.
What is wrong in your opinion? With composer update, composer tries to find new versions of the packages within the specified version range. When found, it updates the package. At the end, it creates a composer.lock file with all packages and details about the installed versions.
composer install only reads this composer.lock file and installs exactly the versions specified in this. Since you already have the versions specified in that lock file, nothing will happen.
composer install is very usefull on production servers and in teams, as you'll be sure you all are using exact the same version of the dependencies.
Check if composer.look is using a package that uses an extension not released in php.ini . After releasing the extensions use comoser install

How to intall drush on hostgator servers

I would like to have Drush on Hostgator shared hosting. I just spent 1 hour trying various outdated tutorials (Drush now requires composer). Does somebody have proved, tested and working solution how to install Drush there? I'm using PHP 5.4.
My last achieved step is drush st error:
Unable to load autoload.php. Drush now requires Composer in order to install its dependencies and autoload classes. Please see README.md
Content-type: text/html
When I run php composer.phar diagnose I see:
Content-type: text/html
Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity: OK
Checking disk free space: OK
Checking composer version: OK
Incase it helps others, I had been using a variety of google inspired resources to install Drush, which just complicated the situation for me. I would highly recommend following the official documentation which is the main source of information. I even read on there that they only maintain the documentation here, not even on drupal.org.
I was missing this step based on other instructions,
Now add Drush to your system path by placing export
PATH="$HOME/.composer/vendor/bin:$PATH"
into your ~/.bash_profile (Mac OS users) or into your ~/.bashrc (Linux users).
These instructions helped me resolve the error:
curl -sS https://getcomposer.org/installer | php mv composer.phar
/usr/local/bin/composer ln -s /usr/local/bin/composer
/usr/bin/composer
git clone https://github.com/drush-ops/drush.git /usr/local/src/drush
cd /usr/local/src/drush git checkout 7.0.0-alpha5 #or whatever
version you want. ln -s /usr/local/src/drush/drush /usr/bin/drush
composer install drush --version
I think you are trying to use Drush version 7.x.
Try using Drush 6.x, I don't think it requires composer. Drush releases. I have had drush 6.4 installed on shared hosting environment successfully without any problems.

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