Jump to content

Install modules via php cli


Recommended Posts

I'm writing a bash script to install prestashop and apache configuration via command line .

php install-dev/index_cli.php --domain=$domain --db_server=localhost --db_name=$project \
--db_user=$user --db_password=$pass --email=$email --password=... --name=$project 

as said in the docs:

http://doc.prestashop.com/display/PS15/Installing+PrestaShop+using+the+command+line

 

It works fine, except for the modules and fixtures, that are not loaded. I think this is the best default behavior but: Is there a way to automate fixtures and modules configuration ?

 

 

Many Thanks in advance¡

Link to comment
Share on other sites

Sure. Tell something about your environment, workflow and needs.

 

I'm thinking about deploying PrestaShop into local or remote server, Docker including. Windows, OSX, Linux on any side. PrestaShop will be loaded with huge amount of test records and ready to test a module or the shop as a whole. Unit, integration, functional and acceptance tests with one united interface.

Link to comment
Share on other sites

I'm currently writing a simple bash to install new prestashop project on a centos 6 dedicated server. The main idea behind is to automate the creation of new sites in an easy proccess.

 

This way, the developer, simply type the project name and sql connection credentials and the script install all the neccesary scripts including host configuration:

#!/bin/sh
read -p "Nombre del proyecto (será el mismo que la carpeta y el nombre de la bbdd): " project
read -p "Dominio (es recomedable un subdominio tipo xxx.desarrollotrevenque.com): " domain
read -p "Usuario de la bbdd: " user
read -p "Contraseña de la bbdd: " pass
read -p "email del proyecto: " email


echo "Iniciando proyecto $project ..."

# creamos la carpeta de nuestro proyecto
mkdir /web_path/$project

cp -Rf web_template/*  /web_path/$project
cp web_template/.gitignore /web_path/$project

cd /web_path/$project
sudo chown -Rf code:apache web log
sudo chmod -Rf 775 web log


echo "<VirtualHost *:80>
... $project configuration---
</VirtualHost>" >> vhost/dev.vhost

sudo ln -s /web_path/$project/vhost/dev.vhost "/etc/httpd/sites-available/$project.vhost.conf"


# Instalamos Prestashop
wget https://github.com/PrestaShop/PrestaShop/archive/1.6.zip
unzip 1.6.zip
mv PrestaShop-1.6 /web_path/$project/web
mysql -u$user -p$pass  -e " CREATE DATABASE $project"

php /web_path/$project/web/install-dev/index_cli.php --domain=$domain --db_server=localhost --db_name=$project --db_user=$user --db_password=$pass --email=$email --password=password --first-name=test--second-name=test--name=$project --language=es 



It works like a charm. But the default prestashop installed doesn't have:

  • Modules
  • Any sample data

Ideally, for me, the script must include two options:

  • Modules option:
    --modules=module1,module2,  or maybe something lik --default-modules=true
  • Data:
    --fixtures=/path/

 

Hope it helps

Link to comment
Share on other sites

  • 1 year later...

Sure. Tell something about your environment, workflow and needs.

 

I'm thinking about deploying PrestaShop into local or remote server, Docker including. Windows, OSX, Linux on any side. PrestaShop will be loaded with huge amount of test records and ready to test a module or the shop as a whole. Unit, integration, functional and acceptance tests with one united interface.

 

Dear,

 

Actually on our environment we use vagrant (jenkins, svn, virtualbox)

- virtualbox: ubuntu 14.04 server

- vagrant: install everything from the last commit (jenkins/svn)

 

I am looking for a way to automate the process of installing the modules/themes via scripting vagrant engine ?

 

Any news ?

 

Regards

 

Yves

Link to comment
Share on other sites

  • 10 months later...
  • 2 years later...
  • 2 years later...
On 6/22/2017 at 1:06 PM, arnaud.sylvestre said:

HI,

 

If you wish to install a module through command line, you can do it with :

php app\console prestashop:module install <module_name>

where <module_name> is the name of your module

 

execute this command inside the prestashop main folder.

 

Hope it helps !

HI,

It won execute and it just throws: Could not open input file: appconsole

Any newer solutions?

Thx.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...