TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Kohana installer
  • Hello everyone!

    I propose to make changes in Basic Application that in my opinion could be very useful.

    Bootstrap config

    First of all, in every application developers in 90% of cases make the same changes in APPATH/bootstap.php:

    1. Set the default timezone
    2. Set the default locale
    3. Set the default language
    4. Set the default environment (or tie it with the host name)
    5. Change Kohana::init attributes: index_file, caching, profile, errors. As to me, I tie last three to Kohana::$environment.
    6. Choose modules to include

    So, in my opinion it would be very convinient to refactor default bootstrap and store all this stuff in more structured way.

    (It it is kind a sacred thing, please let me know :) )

    For example special config file APPPATH/config/bootstrap.php could be something like this:

    return array(
        'default' => array(
            'timezone' => 'America/Chicago',
            ...
            'modules' => array(
                'auth' => array(':MODPATH', 'auth'),
            ),
        ),
    );
    

    So we achieve several advantages:

    1. Now we can easily switch from one predifined configuration to another
    2. Particular settings can be changed not only by developer with IDE.

    logs / cache

    Every time I manually create logs and cache. Why not to create it in installer? As for now Kohana_Core creates logs/cache folders only if they are defined in $settings variable.

    Modules configuration

    1. Database always needs connection settings
    2. Auth always needs salt key
    3. ...

    Some settings in configuration files should be somehow marked as "changeable at installation" (maybe in some module-install file).

    How we can change config files?

    With Kohana_Config_File_Writer

    Just a simple class that performs var_export($config) function and stores the result in APPATH/config/some_config.php

    Installer

    As for now install.php only performs Environment Tests. I think one can agree, that it hardly goes well with the term "installation".

    So install.php could be supplemented with next abilities:

    1. Change bootstrap configuration
    2. Change modules configuration (using module installers)

    This can be useful in blank installation and in future deployments of working application.

    After this installation process will be complete.

    Now please tell me before I started working at it: is this feature interesting to anyone?

  • You should post this on the Redmine project management page http://dev.kohanaframework.org/projects/kohana3/issues

    If it's accepted why not...

  • Of course it is interesting, do as @feketegy told.

  • Moved feature request and future discussion to #4475

  • This will make it better and no one will need to prepare "step by step installation" page like I did here: http://kohana.gen.tr/adim-adim-kohana-kurulumu/#comment-4

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion