Where is composer.phar in zend framework 2.5 - zend-framework2

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.

Related

How to install Zendframework-2 in wampserver?

i already install git, and composer.exe now i try to install zendframework-2 but it not work please provide rightway for installing zend framework-2.
please provide me right tutorial or video for install proper.
It is possible to install ZF2 as a library but that's not what I recommend. I think it's best to install ZF2 in every project from composer.phar. This makes it easier to master the updates of applications in production.
For ZF2, install the skeleton application that allows you to set up your project. This installation sets up ZF2 complete.
Make sure your Windows path contains php.exe and composer.bat
paths ;
Run in console : php "path\to\composer.phar" create-project -sdev --repository-url="https://packages.zendframework.com" zendframework/skeleton-application "directory/of/your/project"
For ZF3, follow : https://framework.zend.com/downloads

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!

How to move PHPunit 4.8 to the path?

Hi I try to install PHPunit on my 14.04 ubuntu, but newest version require PHP 5.6 and I got only 5.5 so I installed PHPUnit
via composer composer global require "phpunit/phpunit = 4.8.*"
But when I try to access it phpunit -c app/
I get bash: usr/local/bin/PHPUnit: No such file or directory
How to move it to the path?
This link explains how to add all composer installed tools to the path.

RatChet PHP File structure and Installation issue

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

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.

Resources