openshift symfony install third party libraries - php

I'm trying to add FosUserBundle and HWIOAuthBundle to my symfony project in openshift. In localhost, to add those libraries, I'd to edit composer.json and update the composer.phar. Now I don't know how to update the composer.phar on openshift.
My way(step-by-step):
Create a symfony app from openshift
clone the project to my localhost
edit the composer.json and push it again to openshift
after that, what should I do to update the composer? Or is there another way to add those libraries to the symfony project?

You probably need to setup an action_hook to run the composer command on the openshift server after you do a git push, maybe in the deploy action_hook. Another idea would be to install the libraries locally using composer and then add them into git and push all of it up to the server with a git push and let it all be deployed together. As far as I know composer is not installed on the server, so you may need to install it into your app-root/data directory and call it from there with your deploy hook.
Here is a blog article about using composer with OpenShift: http://stanlemon.net/2013/03/22/composer-on-openshift/ that might help answer your question

Related

error installing laravel via composer on new pc

I have a new laptop and I'm trying to install Laravel via composer.
I usually use PhpStorm wizard to create new projects.
For some reason it keeps failing to install Laravel on my new device, I've installed PHP via wamp and git and composer.
I've no idea what is wrong.
Here is my PHP & git
What you should do is remove your composer directory and run composer install again.
I saw that your autoload failed to load which can cause this issue.
This is probably because you changed the directories.

Deploy a Symfony2 app on cPanel

I'm new to cPanel and I want to deploy my Symfony2 app on it.
I need some guidance on how to do it,
I downloaded the Symfony2 framework with the Softaculous Apps Installer.
PS : My app is also on BitBucket.
First off all: CPanel is just a web-shell arround your linux os that makes it easy to maintain your server from distance through a web interface.
Actualy you do not need softaculous because it just installs an empty new symfony project.
There are globally two ways to install your symfony project.
Install git and Composer on your server, use git to pull the project from bitbucket and install the the vendors with 'composer install' or 'composer update'.
Upload your complete project from your local computer to the server with FTP.
In both ways you still have to install your database and set your configuration.
If you have a shared online server then just copy the entire symfony project through FTP, set up your database credentials in parameters.yml, and manually delete the prod directory inside var (symfony ≥ 2.8) or app (symfony ≤ 2.7).

Create a customized laravel base Project and install it for future projects

I install a new Laravel project and I have been applied Many changes on it for my own purposes. for Example my custom admin panel design and related css and javascript files.
In addition to, I added some packages that are required on whole project.
Now , if I want to Start a new Project , I must to install a fresh laravel Project and add those files and packages manually again that It takes a lot of time.
Is there a way that I could store this base laravel project on it (for example Github) and install it via composer?
Yes, you can use Github to create a private/public repository then when you start e new project you clone that repository and then use composer install command to get the dependencies.
Yes, it's possible.
Here are all the steps :
git clone xxx.git
composer install (make sure you have included .env.example in your git for the app key)
npm install
bower install
php artisan migrate (if, I hope, you use migrations)
gulp
And you are ready to work on your project.

Getting started with laravel

I just started my laravel course with laracast. I dont quite understand yet all the enviornment-related things.
I know that Composer is a kind of a program that downloads pre-written scripts to use in your project. But where does it work? On my local machine or on my vagrant homestead box VM? On which of these is it supposed to be installed?
I installed myself vagrant homestead box already but does it contain composer? When I go ssh into my guest machine and go to vagrant#homestead:/vagrant$ path I can see composer.json and composer.lock files, but does it mean that I have composer installed?
Composer is a PHP package manager, like npm for javascript or pip for python. There are many examples of package managers. It's useful, because adding dependencies to your php projects can be a pain, but composer makes it really easy. You just add the dependency to composer.json and you can use it right off the bat.
Composer isn't laravel specific, you can use it in any php project, laravel uses it to manage it's dependencies, laravels dependencies use it to manage their dependencies and so forth.
If nothing else, the composer autoloader is great, so you can use it even if you don't plan on using external packages.
Homestead should come with composer installed. A composer.lock file is generated when you run a composer install or composer update. If you plan on creating or using other php projects on your machine, it's probably a good idea to have composer installed on your machine as well.

What files to put on Bitbucket so that my teams could use?

I have a setup a Laravel 5 project locally and want to put it on bitbucket account so that my remote team mates can install it. Locally from command line I ran following command:
composer create-project laravel/laravel myproject --prefer-dist
which did everything. Now it sounds stupid to put all. I already uploaded my composer.json file. What instructions should I send out to team so that they just clone directory and install it? Do I dump each thing and they just clone it? Will they have to run composer create-project command anyway?
Here, no need to run composer create-project, they just clone the project and run composer install to deploy the project in their local.
As composer install will install all of the framework's dependencies, don't upload vendor folder to source (Bitbucket).
You can send following instructions
Project requirments
List of tools and technologies to run the project
Ex: PHP and mysql version, Frameworks (js, css) used and tools required NodeJs, Gulp, Bower or any other
Installation process
create folder project_name and clone project into it
open composer.phar and run composer install
setting up environment to run project with required tools

Categories