2017 © Pedro Peláez
 

project kohana

Kohana project template

image

despark/kohana

Kohana project template

  • Wednesday, September 17, 2014
  • by hkdobrev
  • Repository
  • 13 Watchers
  • 1 Stars
  • 76 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

Kohana project template for Composer

This is how we bootstrap a Kohana project., (*1)

Creating a new project

To create a project foobar run: ``` bash composer create-project despark/kohana foobar, (*2)


That's it! You now have a Kohana project with some important modules installed, CLI tools, permissions set up and more! #### What is installed - [Kohana core][kohana core] - Official Kohana modules: * [Database][kohana database] * [Auth][kohana auth] * [Cache][kohana cache] * [Image][kohana image] - Other Kohana modules: * [Jam][jam] * [Jam Auth][jam auth] - [Phinx migrations][phinx] (see [Migrations](#migrations)) - [Password compatbility][password compat] (see [Password hashing](#password-hashing)) #### Installing additional libraries You could run: ``` bash composer require <vendor>/<library>:<version_constraint>

This would update the require section in composer.json, install the library and update the composer.lock file., (*3)

See the suggest section in composer.json for a useful list of Kohana modules and other libraries., (*4)

Bootstrap

The bootstrap file for Kohana is filled with a lot of goodies. You should check it out here: bootstrap.php., (*5)

Password hashing

The password hashing in the Auth module defaults to PHP 5.5 password_hash. Compatibility for PHP <5.5.0 is achieved using Anthony Ferrara's password_compat., (*6)

Database configuration

Kohana Database module is configured based on environments. The database name defaults to the project name., (*7)

Migrations

Migrations are done via phinx. Configuration is in phinx.yml. The database name defaults to the project name., (*8)

Under the hood

If you are curious how your project is actually built you should check out: - Composer create-project command - composer.json, (*9)

Here is a summary:, (*10)

  • First it clones this repo in a folder with the name you've provided.
  • Then it finds all dependencies listed in the require and require-dev sections in composer.json and their dependencies as well.
  • Downloads them and put them in either vendor/ or modules/.
  • Then it runs the scripts from the post-create-project-cmd section in composer.json:
    • Creates application/classes/Model, application/migrations and application/views.
    • chmod with 755 application/migrations
    • Generates a random string and sets Cookie::$salt with it.
    • Replace {{DATABASE_NAME}} in phinx.yml and application/config/database.php with the name of the project.

The Versions