Titulo sc_apl_status

I am using this code for active the applications (code below). The weird is some application doesn’t activate. but if I put the code individually, it does work.
I have checked that all apllication is being used with the command sc_apl_status($aplicacion, ‘on’); I don’t see any wrong.

I don’t understand this .perhaps this code is not correct.
could anybody to say something about it. I would please
thanks

$arr_apps = array_diff(scandir($this->Ini->path_aplicacao . “…/_lib/friendly_url/”), array(’.’,’…’, ‘_lib’));
foreach($arr_apps as $k => $v)
{
$aplicacion = substr($v, 0, -8);
sc_apl_status($aplicacion, ‘on’);
}

$dir = opendir($this->Ini->path_aplicacao . "..");
while($file = readdir($dir)){
    if($file !='.' && $file !='..' && $file !='_lib'  && $file != 'login')
    {
        sc_apl_status($file,'on');
    }
} 
closedir($dir);

It worked. thanks. I have one question. it should mix with url friendly.
thanks

The application folder becomes the friendly URL when it is enabled

I think I don’t understand well how work url friendly in scriptcase. Then it the same that name of application,isn’t it?

other question.
I missed an webcast of camila to show as a webservice providing json data. I have look for all places , but I don’t find. By casuality you know something about it.