From 9ab146c5126b39d5b55677bc03947835631d5e05 Mon Sep 17 00:00:00 2001 From: avl Date: Sun, 7 Sep 2008 01:34:05 +0300 Subject: [PATCH] Ticket #2 close --- ipf/cli.php | 8 +++++++- ipf/middleware/common.php | 1 - ipf/project.php | 11 +++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ipf/cli.php b/ipf/cli.php index a2c38fa..2abaacd 100644 --- a/ipf/cli.php +++ b/ipf/cli.php @@ -5,7 +5,7 @@ class IPF_Cli{ protected $commands; public function __construct(){ - $this->commands = array('help','sql','buildmodels','syncdb', 'createsuperuser'); + $this->commands = array('help','sql','buildmodels','buildcontribmodels','syncdb', 'createsuperuser'); } protected function usage(&$args){ @@ -39,6 +39,12 @@ class IPF_Cli{ IPF_Project::getInstance()->generateModels(); } + protected function buildcontribmodels(&$args){ + print "Build All Contrib Model Classses\n"; + IPF_Project::getInstance()->generateContribModels(); + } + + protected function createSuperUser(&$args){ print "Create SuperUser\n"; diff --git a/ipf/middleware/common.php b/ipf/middleware/common.php index dba0824..8826459 100644 --- a/ipf/middleware/common.php +++ b/ipf/middleware/common.php @@ -4,7 +4,6 @@ class IPF_Middleware_Common { function processRequest(&$request) { - //print_r($request); if (IPF::get('append_slash')){ $url = $request->http_host.IPF_HTTP_URL::getAction(); if (substr($url,-1)!='/'){ diff --git a/ipf/project.php b/ipf/project.php index 2d0a9e0..31e99d9 100644 --- a/ipf/project.php +++ b/ipf/project.php @@ -55,15 +55,18 @@ final class IPF_Project{ } public function generateModels(){ - foreach( $this->apps as $appname=>&$app){ - if (substr($appname,0,4)=='IPF_') - $this->getApp($appname)->generateModels(); - } IPF_ORM::generateModelsFromYaml( IPF::get('project_path').DIRECTORY_SEPARATOR.'models.yml', IPF::get('project_path').DIRECTORY_SEPARATOR.'models' ); } + + public function generateContribModels(){ + foreach( $this->apps as $appname=>&$app){ + if (substr($appname,0,4)=='IPF_') + $this->getApp($appname)->generateModels(); + } + } public function createTablesFromModels(){ foreach( $this->apps as $appname=>&$app){ -- 2.49.0