Skip to content

Instantly share code, notes, and snippets.

@iegik
Last active January 27, 2021 09:33
Show Gist options
  • Save iegik/1268271 to your computer and use it in GitHub Desktop.
Save iegik/1268271 to your computer and use it in GitHub Desktop.
Creates default Simfony`s file structure and new database
## Symfony2
## Clear Cache
rm -rf app/cache/*
rm -rf app/logs/*
#!/bin/bash
# Extends Simfony`s method (doctrine)
SMALL=`echo $2 | tr '[A-Z]' '[a-z]'`
mkdir -p apps/$SMALL/lib/form/
cat lib/form/doctrine/$1.class.php | sed 's/\ '$1'/\ '$1'For'$2'/g' | sed 's/Base'$1'/'$1'/g' > apps/$SMALL/lib/form/`ls apps/$SMALL/lib/form/$1For$2.php`$1For$2.php
sudo setfacl -R -m u:www-data:rwx -m u:www-data:rwx app/cache app/logs
sudo setfacl -dR -m u:www-data:rwx -m u:www-data:rwx app/cache app/logs
#!/bin/sh
IMAGESDIR="./web/images"
CSSDIR="./web/css"
JSDIR="./web/js"
SASSDIR="./src/sass"
mkdir -p $SASSDIR
if [ $1 ]; then
IMAGESDIR="$IMAGESDIR/$1"
CSSDIR="$CSSDIR/$1"
JSDIR="$JSDIR/$1"
SASSDIR="$SASSDIR/$1"
mkdir -p $SASSDIR
fi
compass init --css-dir $CSSDIR --images-dir $IMAGESDIR --javascripts-dir $JSDIR --sass-dir $SASSDIR
echo "Now You may run 'compass watch'"
#!/bin/bash
USER=root
PASS=
PROJECT=$1
#Create new
mkdir $PROJECT && cd $PROJECT
symfony generate:project $PROJECT
symfony generate:app frontend
#symfony generate:app backend
#chmod 777 cache/ log/
cp /usr/share/php/symfony/1.4/data/web/sf/ web/sf -r
#ln -s web/frontend.php index.php
mysqladmin -u$USER --password=$PASS create $PROJECT
symfony configure:database "mysql:host=localhost;dbname=$PROJECT" $USER $PASS
echo "1. Cunstruct the database: config/doctrine/schema.yml"
echo "2. Fill with test data: data/fixtures/categories.yml"
echo "3. Then run:\n symfony doctrine:build --all --and-load --no-confirmation"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment