RatChet PHP File structure and Installation issue - ratchet

I am a beginner in programming trying to implement Ratchet.
This is my current file structure
D:\Xampp
composer.phar
htdocs
Ratchet
composer.json
bin
Chat.php
src
Chat-Server.php
And I ran the command
php composer.phar install --dev
The following error message appears
Composer could not find a composer.json file in D:\xampp
To initialize a project, please create a composer.json file as described in the
http://getcomposer.org/ "Getting Started" section
I tried using
php composer.phar --working-dir=htdocs/Ratchet update
But it still doesn't work.
The tutorial on Ratchet is not very clear either, can someone guide me on what I should do next?

This kind of duplicates this question:
Updating the composer.phar on Symfony2
Though to answer it:
You need to run composer.phar in the directory in which your composer.json lies, so the correct execution path would be the Ratchet directory with this command:
../../composer.phar install --dev

Related

How to get the ZF classmap_generator.php via Composer without to install the whole Zend Framework?

Due to some issues with the dependencies (zend-test was prohibiting installation of PHPUnit 6), I removed the zendframework/zendframework dependency from the composer.json and installed only the Zend packages I really need. But now, the file classmap_generator.php is missing.
Now I want to get the classmap generator back but without to load the whole framework with all its deoendencies.
Which package do I have to install to get the classmap_generator.php?
You do not need the classmap generator at all, and it is removed from V3 anyway.
What you should do is remove any Zend Autoload configuration (if you have any in your Module.php files, and replace it with a PSR-0 or PSR-4 config in the autoload section of your composer.json.
This way, composer handles all the autoloading, and you can use composer install --no-dev --optimize-autoloader --classmap-authoritative for your production deployment, which will generate a very optimised classmap for you!

yeoman generator creating files in home directory

I am using the yeoman angular generator https://github.com/yeoman/generator-angular#readme. I am following the instructions to install using the command npm install -g grunt-cli bower yo generator-karma generator-angular and then created a directory inside which I run the command yo angular myApp but the files are generated inside the home directory i.e ~/ The only directory I see inside angular-app is only the node_modules. Please help me understand where I am going wrong and how to fix this.
Found the answer after hours of searching on internet. The Gruntfile.js was in the home directory and it was referring to it. I deleted the file inside my home directory and all of it started working again. Here is the link, which might be useful if someone face the same issue - Link

Where is composer.phar in zend framework 2.5

I have clone zf2.5 via git, and I create project via composer, but both comes without composer.phar. Only composer.json and composer.lock.
Where is it?
If you look at zf2 github, you will see there is no composer.phar in git.
If you want to install zf2 via composer, you have to install composer locally or globally.
And then run in your directory php composer.phar require zendframework/zendframework or composer require zendframework/zendframework.

Add GData to Zend Framework2

Okay, so this has proven to be more difficult than I expected and think it should be.
All I want to do is utilize the GData library for some youtube functionality in my site. However, I can't seem to figure out how to add everything in so Zend recognizes the classes.
I've downloaded the latest ZendGdata archive, and added the contents of \library into \vendor\Zend. Next step is to autoload all that into my application right? I've tried searching for how to do it, but nothing has helped. Now I look to you, stackoverflow. Please help me figure this madness out.
How about ditching manually installing vendors and using composer which will manage all the autoloading stuff for you?
Download composer.phar into your project's root directory and run init to create a basic configuration:
curl -s https://getcomposer.org/installer | php
php composer.phar init
Follow the prompts, when it comes to searching for required packages, select zendframework/zendgdata and use the version dev-master. (If you decided to use composer for all your dependencies which I recommend, you could also at this point add zendframework/zendframework: 2.*).
Once you've done that a composer.json file will have been created. Next install your dependencies:
php composer.phar install
Once that's all done, there should be a vendor/autoload.php file that you require from your entrypoint to have autoloading of your composer dependencies working.

Getting Started with Zend Framework2

I m reading the tutorial of getting started with zend framework2, when I came to this :
I don't know how to excecute this :
here is the link of the page : http://framework.zend.com/manual/2.0/en/user-guide/skeleton-application.html
How can I achieve this?
i have written a throughout article on how to install Zend Framework 2 on a windows environment. It is directed at Win7, but works very similar (if not identical) for XP, too.
Please read my Blog "Zend Framework 2 Installation on Xampp for Windows"
Well, the best way to get started with Zend Skeleton Application is:
$cd my/project/dir
$git clone git://github.com/zendframework/ZendSkeletonApplication.git --recursive
$cd ZendSkeletonApplication
In your project root you will find two files: composer.json and composer.phar. You can get more information about composer from the official Getting Started.
The composer.json file describes the project's dependencies:
{
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "~2.4"
}
}
In order to get the dependencies you need to execute from you project root:
$composer.phar self-update
$composer.phar update
Finally, you can start the internal PHP cli-server in the root directory:
$php -S 0.0.0.0:8080 -t public/ public/index.php
I hope this will help you to install and configure your app.
If you're using Windows, please check your php.exe directory. And execute it. Example:
C:\php\php.exe composer.phar self-update
If you're linux user, you already know the answer.
Zend Framework 2 has just been release and it is not a framework for newbies. There are a few different ways to install which you can find on http://framework.zend.com/downloads
or with XAMPP at Xampp In Windows
But I have the feeling that if you are having trouble at this point then ZF2 is not for you.
Per chance if you were on a Mac or Linux box, you would open the Terminal application. Navigate to the zend framework application (cd /path/to/app), and then run the commands.

Resources