<?php
class KriaWebApplication extends CWebApplication
{
  /**
   * (non-PHPdoc)
   * @see CApplication::getRequest()
   * @return HttpRequest
   */
  public function getRequest()
  {
    return parent::getRequest();
  }

  public $publicData = array();

  /**
   * 
   * @return FlashMessage[]
   */
  public function getFlashMessages()
  {
    $flashesFiles = getFiles(pathCombine(app()->runtimePath,'flashes'),'*.flash',true);
    $flashes = array();
    foreach($flashesFiles as $file)
    {
      $flash = FlashMessage::deserializeFile($file);
      $flash->custom_target = basename(dirname($file));
      $flashes[] = $flash;
    }
    return $flashes;
  }
}