Best practices composer and Symfony bundle - symfony

I starting a bundle with symfony 3.2. It works find in the src directory not in vendor directory. before to go forward. I decided to publish it in packagist/ Github. So i did composer.json and apprently i did something wrong because when i install it the namespace generate an error and if i check in composer autoload nothing about my package. I you have an idea thank for your help.
The pakacge is https://github.com/fabgg/jukeboxBundle

First Download Composer. https://getcomposer.org/download/
Then Open Command Prompt. go to htdocs directory and Run the Command
composer require symfony/finder
Refer : http://symfony.com/doc/current/components/using_components.html

Related

Command composer require symfony/apache-pack doesn't create .htaccess file

When I execute the command:
composer require symfony/apache-pack
It doesn't create an .htaccess file as it is cited in the documentation here.
How can I fix this problem ?
If apache-pack is installed in your project and you later remove the .htaccess file from the /public directory, running composer require apache-pack will not re-install the .htaccess file.
You must first remove apache pack.
So, first run composer remove symfony/apache-pack
And then run composer require symfony/apache-pack
As explained here : https://github.com/symfony/recipes-contrib/issues/676#issuecomment-519959252
The solution is :
1-removing symfony/apach-pack from required in compoer.json
2- run command
composer update
which delete apach-pack from project.
3-run again the command for installing apach-pack as cited in the documentation here:
composer require symfony/apache-pack
4- when asked this question :
Do you want to execute this recipe?
type :
Yes
5- That's it now the file .htaccess exists
I was having the same issue as Dan where composer was not asking me to execute any recipes. it turns out I needed to install Symfony Flex which wasn't present in my microkernel application. I used "composer req symfony/flex" to install it and then afterwards a remove/require of symfony/apache-pack asked me to run the recipe. You can also type "composer recipes" to see your recipes and their status, once flex is installed.
I tried to remove the package and reinstall it but didn't work so I tried to execute the same commands on another console and it works for me
git bash terminal : didn't work
windows terminal: it works (https://learn.microsoft.com/en-us/windows/terminal/)

Composer "chmod(): No such file or directory" with bin directory

I am trying to install my Symfony2 app on koding.com
Trying to install my vendors via php composer.phar update, I run into the following issue, installing doctrine/orm:
Installing doctrine/orm (2.3.x-dev 4d9f24b)
Cloning 4d9f24b2eef3af3a3e76c773994c19bbb0706f88
[ErrorException]
chmod(): No such file or directory
I tried to debug with -v and found out that the following line is causing this issue:
composer.phar/src/Composer/Installer/LibraryInstaller.php:217
In there I see that this issue is related to the bin directory. I have set (S2 default) the bin-dir to "bin". The bin directory is also in place within my project, but somehow composer does not find it, when trying to change the chmod. I have used this setup on several windows machines and also on c9.io.
Issue resolved due to fix on github: https://github.com/composer/composer/issues/1270

Upgrade my Symfony2 app to use composer

I want to upgrade my app that I've developed with Symfony2 for users who want to use it do so with composer.
I don't know how to create composer.json file based on deps file.
This's my deps file: https://github.com/biruwon/Vecinos2.0/blob/master/deps
For example, what about with the bundles without composer.json? Or libraries how TCPDF upload on sourceforge?
If you help me here or with a pull request I'll be very thankful to you.
PD: I do this first and then update Symfony2 to Symfony2.1
For TCPDF it's quite easy it is on packagist already.
For bundles or libs that are not on packagist, the best way is to first get it to work in your project using a custom package repository in your composer.json, and once that's done sending a pull request to the original author with a composer.json and asking them to submit it to Packagist is the way to go.
Download the composer in symfony2 root folder:
curl -s https://getcomposer.org/installer | php
and execute
php composer.phar self-update
php composer.phar update
use this if you can update to the last version.

Symfony2 Composer Not Downloading Packages

I was recently trying to re-install the fos:userbundle and noticed the docs have changed. They are no longer using the deps file are now referencing the new package manager composer.
I found some info about integrating composer with sf2.0.* here:
http://knplabs.com/blog/symfony2-with-composer
After downloading the src: https://github.com/KnpLabs/symfony-with-composer
I tried adding the following to my composer.json: "friendsofsymfony/user-bundle": "*"
as per the instructions: https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/index.md
When I run bin/vendors update I get the following:
Updating dependencies
Nothing to install or update
Writing lock file
Generating autoload files
It does not appear to be installing the fos package. Am I missing something?
Thanks
Composer is a PHAR archive that takes care of installing dependencies, update them, create projects, etc. It has nothing to do with the old bin/vendors.
What you need to do is to download Composer:
curl -s http://getcomposer.org/installer | php
And install your dependencies:
php composer.phar install
By the way, the symfony-with-composer thing you downloaded is an old version of Symfony2 Standard Distribution that isn't maintained anymore, as mentioned on the repository itself.

Symfony 2.0 bundle installation

So I am a new to doctrine, but I am not able to install a bundle at all. I am following the guide, but the "error" which I am getting is very unusual.
Anyhow, I add this lines into deps file:
[FOSRestBundle]
git=http://github.com/FriendsOfSymfony/FOSRestBundle.git
target=bundles/FOS/RestBundle
Then I do:
./bin/vendors install
And I get:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/sqlite.so' - /usr/lib/php5/20090626+lfs/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
Your project seems to be based on a Standard Edition that includes vendors.
Try to run ./bin/vendors install --reinstall
So on this standard way I am not able to install it at all. Can somebody explain me what is the problem, because to me it looks like, the symfony vendors script doesnt recognize changes in deps file at all.
This happens when you've downloaded the Symfony2 Standard Edition from the website. The vendor install script checks to see if the vendor directories are git repositories, and if not, will throw this error. You can fix the situation in one of two ways:
you can either run the command that it suggests: php bin/vendors install --reinstall
or, you can remove the vendors directory, then run php bin/vendors install, which amounts to about the same thing
No need to install that. Just follow the steps in the url : http://mmoreramerino.github.com/GearmanBundle/installation.html

Resources