Framework 0.1.0

Well, for all three of you out there that use Framework you’re in for either a nice surprise or something that will make you want to kill me. I was recently contacted by a company who wanted to use Framework for an upcoming project and was gracious enough to allow me to release some of the upgrades and changes publicly.

The possibly bad news for people who might actually be using Framework is that I totally rewrote some of the core internals. The highlight is that Framework will now load multiple sites without needing multiple installations. Another big upgrade are plugins which will allow you to drop hooks into your modules. All of these new features, of course, are totally beta, but appear to be working pretty well. Read on for the entire list of changes.

  • Cleaned up Framework_Session
  • Changed Framework::run() to Framework::start()
  • Fixed case sensitive bug in Framework_Module::$presenter
  • Added multi-site functionality (see Framework_Site class)
  • Added a plugin framework (see Framework_Plugin class)
  • Added Framework_Module::factory()
  • Added Framework_Module::start()
  • Added Framework_Module::stop()
  • Added Framework_Module::__shutdown()
  • Added Framework::stop()
  • Added Framework::$module for storing running module instance
  • Added Framework::$site for storing running site instance
  • Added Framework_User
  • Added Framework_User::singleton()
  • Added Framework_Object_Web
  • Added Framework_Site_Common::getUriPath()
  • Added check in Framework_Presenter_Smarty::__construct() to check for writeable cache/compile dirs
  • Added support for custom Framework_User classes
  • Assign Framework::$site to Smarty templates in Framework_Presenter_Smarty
  • Deprecated FRAMEWORK_LOG_FILE in Framework_Config.php
  • Deprecated FRAMEWORK_LOG_DSN in Framework_Config.php
  • Deprecated FRAMEWORK_USER_TABLE in Framework_User
  • Deprecated FRAMEWORK_USER_PRIMARY_KEY in Framework_User
  • Deprecated FRAMEWORK_USER_DEFAULT_USER in Framework_User

Download Framework 0.1.0

4 thoughts on “Framework 0.1.0

  1. it took me a while to transform the previous version found on onlamp to the version you posted here 😛 but it’s almost up and running.

    one of the fixes in Presenter/Smarty.php:

        public function display()
        {
    -       $path = $this->template->template_dir.'/'.$this->module->name;
    +       $path = $this->template->template_dir.'/'.$this->module->moduleName;
            $tplFile = $this->module->tplFile;
    
  2. The variable moduleName has been changed to just name in the pearified Framework. Also, there’s a bug in Framework_User in this version. A new version should be released soon.

  3. >Well, for all three of you … that use Framework…
    Ok, I’ll bite!

    I have some quick Qs for you regarding your change list:

    >Added multi-site functionality
    What should you expect to find in Framework/Site/?
    – templates?
    – modules?
    – site specific config (formerly in Framework_Config.php)?

    Is there an example site package somewhere that shows this stuff off? Perhaps similar to the ‘Onlamp’ example (Welcome, with Login/Logout etc)

    >Added Framework_User

    Sorry? I thought that was there since Framework 0.0.7 (at least). Did I miss something?

  4. In the documentation of your framework you’re saying that it’s possible to get data from another module parsed in your actual module. But could you briefly explain how you manage to do so?

    In my module welcome for example I would like to retrieve the latest new headlines and parse them in a template file in a column on the right.

    So in the module ‘welcome’ I call the Plugin

    [code]
    $plugin = Framework_Plugin::factory(‘Normal’);
    if (PEAR::isError($plugin)) {
    echo $plugin->getMessage();
    } else {
    Framework_Plugin::register($plugin);
    }
    Framework_Plugin::run(‘getAll’,$instance);
    [/code]

    In the constructor of the class Framework_Plugin_Normal I put
    [code]
    $this->register(‘getAll’ , ‘getAll’);
    [/code]

    And in the function getAll I have the following code:
    [code]
    $head = new headlines();
    $module->setData(‘news_headlines’ , $head->getHeadlines() );
    [/code]

    This works ok, but isn’t there another way to do this? Now I have to put Site specific code in the Framework code…

    Thx in advance!

Leave a Reply

Your email address will not be published. Required fields are marked *