abstract class IPF_Application
{
- protected $name = null;
+ /** @var IPF_Project */
+ private $project;
- public function __construct($data=array())
+ /** @var string */
+ private $name, $path;
+
+ public function __construct(IPF_Project $project)
{
+ $this->project = $project;
+
$this->name = preg_replace('/_App$/', '', get_class($this));
$rc = new ReflectionClass($this);
- $this->path = dirname($rc->getFileName()).DIRECTORY_SEPARATOR;
+ $this->path = dirname($rc->getFileName()) . DIRECTORY_SEPARATOR;
+ }
+
+ public function getProject()
+ {
+ return $this->project;
}
public function getName()
/**
* Configures application
+ *
+ * @param IPF_Settings $settings
*/
- public function configure($settings)
+ public function configure(IPF_Settings $settings)
{
}
return array();
}
}
-
{
foreach (IPF::get('applications') as $name) {
$className = $name.'_App';
- $app = new $className;
+ /** @var IPF_Application $app */
+ $app = new $className($this);
$app->configure(IPF::$settings);
$this->apps[$name] = $app;