-
Notifications
You must be signed in to change notification settings - Fork 6
Install Kyélà native
Purpose: Install Kyélà native in userspace (without the need of root or Docker) on a Linux based machine.
Requirements: PHP x.x, MySQL x.x, Apache x.x
First get into home directory, install composer and symfony
cd ~
curl -LsS https://getcomposer.org/installer | php -- --install-dir=$HOME/bin --filename=composer
curl -LsS https://symfony.com/installer -o $HOME/bin/symfony && chmod a+x $HOME/bin/symfony
Create a new symphony project for Kyélà, change Dir and add web components to the config.
symfony new kyela 2.8
cd kyela
sed -i -e "s#\"config\": {#\"config\": {\n\t\"component-dir\"\: \"web\/components\",#" $HOME/kylea/composer.json
Download and install the Kyélà bundle
composer require "abienvenu/kyela dev-master"
Add the bundle and its depedencies in your AppKernel.php
sed -i -e "s#new AppBundle\\\AppBundle(),#new Symfony\\\Bundle\\\AsseticBundle\\\AsseticBundle(),\n\ \ \ \ \ \ \ \ \ \ \ \ new Abienvenu\\\KyelaBundle\\\KyelaBundle(),\n\ \ \ \ \ \ \ \ \ \ \ \ new AppBundle\\\AppBundle(),#" app/AppKernel.php
Include the route from your app/config/routing.yml
cat <<__EOF__ >> app/config/routing.yml
kyela:
resource: "@KyelaBundle/Resources/config/routing.yml"
prefix: /kyela
__EOF__
Include the config from your app/config/config.yml
sed -i -e "s#imports:#imports:\n\ \ \ \ - { resource: "@KyelaBundle/Resources/config/config.yml" }#" app/config/config.yml
Add Kyela to the bundles handled by assetic in app/config/config.yml
cat <<__EOF__ >> app/config/config.yml
## Kyela Bundles
assetic:
bundles: [ 'KyelaBundle' ]
filters:
cssrewrite: ~
__EOF__
Dump the assets :
app/console assetic:dump
Set up database connection parameters for MySQL in app/config/parameters.yml
nano app/config/parameters.yml
database_host: 127.0.0.1
database_port: YOUR_PORT
database_name: symfony_kyela
database_user: YOUR_USER
database_password: YOUR_PASSWORD
Create database
app/console doctrine:database:create
Fixtures are available to automatically load examples (concert and picnic).
Install DoctrineFixturesBundle
composer require "doctrine/doctrine-fixtures-bundle ^2.2"
Register the bundle
sed -i -e "s#new AppBundle\\\AppBundle(),#new Doctrine\\\Bundle\\\FixturesBundle\\\DoctrineFixturesBundle(),\n\ \ \ \ \ \ \ \ \ \ \ \ new AppBundle\\\AppBundle(),#" app/AppKernel.php
Load the fixtures
php app/console doctrine:schema:create
php app/console doctrine:fixtures:load --append
Start the app server
php app/console server:start
Stop the app server
php app/console server:stop
Start the app server listening on a different port
php app/console server:start 127.0.0.1:61234
Stop the app server listening on a different port
php app/console server:stop 127.0.0.1:61234
Stop App Server, then drop database. Delete App dir. Remove symphony and composer.
cd ~/kyela/ && app/console doctrine:database:drop --force
cd ~ && rm -rf kyela/
rm ~/bin/symfony
rm ~/bin/composer
To be continued...