Migrating Modules to YII from old Framework/converting

Hi,

need help, now have a framework, with many modules, someone could help me with some idea how to migrate within each module within the yii, someone has done this before know where to start?

The current structure is that I have (briefly):

Quote

/index.php

/config.php

/header.php

/footer.php

/class/dao_user.php

/class/dao_group.php

/lib/PEAR/pear.php

/lib/ajax/ajax.php

/lib/smarty/smarty.php

/themes/default/theme.php

/templates_c/

/modules/user/user.php

/modules/user/view/user.tpl

/modules/group/group.php

/modules/group/view/group.tpl

/modules/search/search.php

each module of the original file is like this:



include "../../config.php";


include_once ONE_PATH.'/classes/dao_user.php';


include_once ONE_MODULO_PATH.'/user/user.php';


$titulo="User config";


$ajaxClasse->printJavascript(ONE_AJAX_URL);


//$p=page/action


//$mod=module called


$p=$_REQUEST['p'];


$mod=$_REQUEST['mod'];





if($p)


{


  switch ($p)


   {


       case "eti"     : 


	   $principal .=eti($_REQUEST'r_cod']);


       break;





  }


}





$oneSmarty->assign("principal","$principal");





include "../../header.php";


$oneSmarty->display(ONE_PATH."/page.tpl");


include "../../footer.php";

the config.php

call another file for defines and includes libs and start ajax, smarty, etc

like this:






    define("CACHE_DIR", ONE_ROOT_PATH."/cache");


    define("UPLOAD_DIR", ONE_ROOT_PATH."/uploads");


more deifnes...


/************************************************************


* carregando ajax                                           *


************************************************************/





$ajaxClasse = new xajax();


$ajaxClasse->setCharEncoding("ISO-8859-1");


$ajaxClasse->errorHandlerOn(); 





/************************************************************


* carregando conexao ao db                                  *


************************************************************/


$one = &ADONewConnection(ONE_DB_TYPE);


$one->PConnect(ONE_DB_HOST, ONE_DB_USER, ONE_DB_PASS,ONE_DB_NAME);


$one->SetFetchMode(ADODB_FETCH_ASSOC);


global $oneDB;





$db=new Database(ONE_DB_HOST,ONE_DB_NAME,ONE_DB_USER,ONE_DB_PASS);


$db->get_error();


global $db;


well, I would like to exchange ideas with has the same problem or who want to help / make a suggestion, any idea to migrate to the yiiframework

greetings

Max

I think most of your code can be placed into controller, view and model in Yii. You don't need to use Yii modules.

First, your index.php should remain to be the entry script.

config.php should be the app config.

header/footer be the main layout.

dao_xyz be model classes.

/modules/xyz be XyzController, and modules/xyz/view be the view files for the controller.

That's pretty much all.

is a good idea;


I forged this:

to acess any module currently we access:

http://localhost/sys…/user/index.php

for any action:

http://localhost/sys…?action=adduser

I tried this:

I have created a module called 'one' using cli and latter I put all complete system with their own modules under this created module:

protected/modules/one/

my modules name 'mods' now is:

protected/modules/one/mods/

and  when I type in  browser this:

http://localhost/pro…?action=adduser

work normal, ferfectly.

in the first stage

the question is, how both system come work together INITIAL

any chances??

:)

the idea is rewrite all modules from scratch and add to the correct path one to one

(protected/modules/user/)

acording we can advance the develop task and deactivate the old modules [now under yii submodules]

at end of task;

all code willbe rewrited to Yii,

(an of course general type module  will share to comunity to download /expand)

any possiblity

:)

Kind regards