Skip to content

Instantly share code, notes, and snippets.

@smgladkovskiy
Last active October 4, 2015 13:27

Revisions

  1. smgladkovskiy revised this gist Aug 11, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions ko3.3_structure.sh
    Original file line number Diff line number Diff line change
    @@ -35,6 +35,7 @@ curl -o application/bootstrap.php https://raw.github.com/kohana/kohana/3.3/maste
    # And some bonuses
    curl -o application/Classes/Controller/Template.php https://raw.github.com/gist/832462/Controller_Template.php
    curl -o application/Classes/Controller/Ajax/Template.php https://raw.github.com/gist/832411/Controller_Ajax_Template.php
    curl -o application/config/site.php https://gist.github.com/smgladkovskiy/6205175/raw/site.php
    curl -o .gitignore https://raw.github.com/gist/1064361/.gitignore

    # Adding and initiating submodules
  2. smgladkovskiy revised this gist Feb 27, 2013. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions ko3.3_structure.sh
    Original file line number Diff line number Diff line change
    @@ -27,10 +27,10 @@ mkdir -p application/{config,views}
    mkdir -m 0777 -p application/{cache,logs}

    # Getting all main project files from github (bootstrap, index, install, template)
    curl -o $FILEPATH/index.php https://raw.github.com/kohana/kohana/3.3/develop/index.php
    curl -o $FILEPATH/install.php https://raw.github.com/kohana/kohana/3.3/develop/install.php
    curl -o $FILEPATH/.htaccess https://raw.github.com/kohana/kohana/3.3/develop/example.htaccess
    curl -o application/bootstrap.php https://raw.github.com/kohana/kohana/3.3/develop/application/bootstrap.php
    curl -o $FILEPATH/index.php https://raw.github.com/kohana/kohana/3.3/master/index.php
    curl -o $FILEPATH/install.php https://raw.github.com/kohana/kohana/3.3/master/install.php
    #curl -o $FILEPATH/.htaccess https://raw.github.com/kohana/kohana/3.3/master/example.htaccess
    curl -o application/bootstrap.php https://raw.github.com/kohana/kohana/3.3/master/application/bootstrap.php

    # And some bonuses
    curl -o application/Classes/Controller/Template.php https://raw.github.com/gist/832462/Controller_Template.php
  3. smgladkovskiy revised this gist May 9, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,3 @@
    Run this in your command line to make the process begin:

    $ curl -o ko3.3_structure.sh https://raw.github.com/gist/1702555/ko3.3_structure.sh && ./ko3.3_structure.sh
    $ curl -o ko3.3_structure.sh https://raw.github.com/gist/2643818/ko3.3_structure.sh && ./ko3.3_structure.sh
  4. smgladkovskiy revised this gist May 9, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,3 @@
    Run this in your command line to make the process begin:

    $ curl -o ko3.3_structure.sh https://raw.github.com/gist/1702555/ko3.3_structure.sh && ./ko3.3_structure.sh
  5. smgladkovskiy created this gist May 9, 2012.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    Run this in your command line to make the process begin:
    $ curl -o ko3.3_structure.sh https://raw.github.com/gist/1702555/ko3.3_structure.sh && ./ko3.3_structure.sh
    58 changes: 58 additions & 0 deletions ko3.3_structure.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,58 @@
    #!/bin/bash
    # Kohana v3.3 project structure creation script

    # Initiating git repo if it not exist yet
    if [ ! -d "./.git" ]; then
    git init
    fi

    # Structure creation
    FILEPATH='htdocs'
    read -p "Enter path to your webserver homedir [Enter to default./htdocs]: " USER_FILEPATH

    if [ -n "${USER_FILEPATH}" ]; then
    FILEPATH=$USER_FILEPATH
    fi

    echo ' '
    echo "Webserver homedir is $FILEPATH"
    echo ' '
    echo 'ok, lets get it on...'
    echo ' '

    mkdir -p $FILEPATH/{css,i,js,media}
    mkdir -p application/classes/{Controller,Model,Kohana}
    mkdir -p application/classes/Controller/Ajax
    mkdir -p application/{config,views}
    mkdir -m 0777 -p application/{cache,logs}

    # Getting all main project files from github (bootstrap, index, install, template)
    curl -o $FILEPATH/index.php https://raw.github.com/kohana/kohana/3.3/develop/index.php
    curl -o $FILEPATH/install.php https://raw.github.com/kohana/kohana/3.3/develop/install.php
    curl -o $FILEPATH/.htaccess https://raw.github.com/kohana/kohana/3.3/develop/example.htaccess
    curl -o application/bootstrap.php https://raw.github.com/kohana/kohana/3.3/develop/application/bootstrap.php

    # And some bonuses
    curl -o application/Classes/Controller/Template.php https://raw.github.com/gist/832462/Controller_Template.php
    curl -o application/Classes/Controller/Ajax/Template.php https://raw.github.com/gist/832411/Controller_Ajax_Template.php
    curl -o .gitignore https://raw.github.com/gist/1064361/.gitignore

    # Adding and initiating submodules
    git submodule add git://github.com/kohana/core.git system
    git submodule add git://github.com/kohana/database.git modules/database
    git submodule add git://github.com/creatoro/jelly.git modules/jelly
    git submodule init

    # Preserve empty folders
    touch $FILEPATH/{css,i,js,media}/.stub
    touch application/{cache,logs,config,views}/.stub
    touch application/Classes/Model/.stub

    # Adding all stuff to git and deleting not nessesary files
    git add .
    git rm --cache ./ko3.3_structure.sh

    # That's it - we done!
    echo "------------"
    echo "project structure created successfully!"
    echo "git commit required"