Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    •  
      CommentAuthorTalizmelf
     
    I was wondering whether the framework concerns the possibility to load a configuration file separate from the config.php of akelos.
    Somewhere to put application own configuration, like standards or libs with utilities of the app...

    And of course, for these to be loaded..
    •  
      CommentAuthorbermi
     

    We recently added a simple settings manager that works like this.

    $appname_settings = Ak::getSettings('appname');
    

    This will look for a yaml file at

    config/appname.yml
    

    The setting fetching mechanism will change once we merge Arno's caching branch. Then you'll be able to have settings tied to environments.

    Hope it helps

    •  
      CommentAuthorTalizmelf
     
    Oh. thanks..

    It came to my mind a file for the application to boot, like akelos boot, but one from the application itself, or something like this to do any operation needed to start the application.
    Also a dir to place any lib developed for the app which are loaded automatically...

    Thanks again.... later...
    •  
      CommentAuthorbermi
     

    It came to my mind a file for the application to boot, like akelos boot, but one from the application itself, or something like this to do any operation needed to start the application.

    Well, you can use the environment at config/environments/*.php files for that.

    Also a dir to place any lib developed for the app which are loaded automatically...

    If you linked to an external akelos library, it should be no problem to add your very own lib on your application base path.

    Saludos paissano :)!

    •  
      CommentAuthorTalizmelf
     

    well.. I was seeing that. I found that they're load before akelos libs.. so I can use them..
    I meant something like this thing I did, I made two others dirs in app:
    app/config
    app/lib
    I put there some stuff like (app/config):

    class Defaults{
        public static $buttons = array(
            'ok' => "Ok",
            'cancel' => "Cancel",
            'save' => "Save"
            'login' => "Log in",
            'logout' => "Log out"
        );
    
        public static $messages = array(
            'registered' => "It was succesfuly registered",
            'cancel' => "Sure you want to discard changes?"
        );
    }
    

    whatever...
    and for lib I got:

    class Util {
        some usefull functions for my application
    }
    

    whatever too... (Actually I coded all this in spanish)
    And so on with as much files as one want.
    Then I found the better place for load them is in app/application_controller.php, before everything here, I do this:

    require_once (AK_APP_DIR.DS.'load.php');  
    

    app/load.php:

    defined('APP_CONF_DIR') ? null : define('APP_CONF_DIR',AK_APP_DIR.DS.'config');
    defined('APP_LIB_DIR') ? null : define('APP_LIB_DIR',AK_APP_DIR.DS.'lib');
    
    function include_libraries($path){
        $libs = Ak::dir($path, array('dirs'=>false));
    
        foreach ($libs as $lib){
            include_once ($path.DS.$lib);
        }
    }
    
    include_libraries (APP_CONF_DIR);
    include_libraries (APP_LIB_DIR);
    

    And this is what I did :)
    Thanks... y saludos a ti, paisano de lengua