Add GData to Zend Framework2 - 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.

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!

HYbridauth for facebook login doesn't work

I was trying to configure the hybridauth library so that I can use the the google + and the facebook sign in. But it keeps me giving a fatal error:
Fatal error: require(): Failed opening required 'Facebook\Facebook.php' (include_path='.:/var/www/magilla/lib:/var/www/magilla/models') in /var/www/magilla/lib/RPC/Util.php on line 168
I followed each and every step of their documentation. I have used the
composer to install the library. The library version is 2.9 and the
facebook graph sdk, the most recent version of github
READ EDIT*2 for a proper solution instead
I am encountering the same issue and I suppose you install hybridauth the same way as I did, which is running composer require hybridauth/hybridauth on your project root folder.
I solved this by running composer install within the hybridauth
directory where its composer.json exist, that will install facebook
sdk within the hybridauth directory where the autoload.php is being
load by the script (I personally feel like it is more like a hack than
a proper solution... but I have a feeling that the hybridauth
developer expect you to clone then run the composer install instead of
composer requiring it...I maybe wrong as I just start using composer
as well)
*EDIT check out the issue on their github, there is a bug where the vendor path is being replaced by one in their code, it also mention it is being fixed in later commit. I am new to composer as well so I don't know how to specific the commit for it to update to... if you know how to do it let me know as well
*EDIT*2 alright, I updated to 2.9.3-dev and it seems to solve the issue without generating any new one, I also use that for google and twitter and those are fine too. To update, edit your composer.json to this
"require": {
"hybridauth/hybridauth": "^2.9-dev"
}
then run composer update on your command prompt, things should work as long as you require the composer autoload.php for your script

How to install ZfcBase (Zend Framework 2) without Git?

I apologize if this is a trivial question.
The installation guide for ZfcBase only provides this much info;
"Simply clone this project into your ./vendor/ directory and enable it
in your ./config/application.config.php file."
I don't have git on my shared hosting solution, but I am using composer.
Could anyone give me a generic way in which I can install Zfc modules without git? (I'm new to Zend)
Edit: I'm guessing I can wget the zip to my /vendor folder and unzip it there? But this wouldn't be good, as I don't want to manually update it if a new version comes in.
If you're using composer, then add "zf-commons/zfc-base": "dev-master" to the require section of your composer.json. so that it looks something like:
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.*",
"zf-commons/zfc-base": "dev-master"
}
Now you run:
php composer.phar self-update
php composer.phar update
On the command line.
If you're doing shared hosting you should first consider developing on your own local computer.
Then, once you're satisfied, zip it all up and transfer it all to your server.
Developing ON the shared server is not a good idea because, as you can see, you won't have all the tools necessary to develop.
If 'zipping' it up all the time is difficult or tedious you can use a build tool for that. Phing or Ant will do.
If you're making small changes I don't see TOO much of a problem doing it on the shared server; but even then, it's still better to do it on your local machine so you can take advantage of an IDE, version control, quicker network, better tool set and probably some other things.

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