Example #1
0
 // in future it would be nice to list the files before install
 if (isset($_GET['show_changes'])) {
     function slash_count($a, $b)
     {
         $ca = substr_count($a, '/');
         $cb = substr_count($b, '/');
         if ($ca == $cb) {
             return strcmp($a, $b);
         }
         return $ca < $cb ? -1 : 1;
     }
     usort($changes, 'slash_count');
     echo join('<br>', $changes);
     die;
 }
 if ($p->install($install_index, $skip_input)) {
     // ...and finally install it.
     if (!empty($p->ui)) {
         // oops, need to gather some data from user
         $ui_request = true;
         break;
     } else {
         // if there's another install instruction after this one we need to reread the list of installed
         // modules because our install might have modified it.
         if (isset($p->install[$install_index + 1])) {
             // read currently installed modules
             $query = "SELECT `module_code`,`version`,`module_type` FROM `{$dbtable_prefix}modules`";
             if (!($res = @mysql_query($query))) {
                 trigger_error(mysql_error(), E_USER_ERROR);
             }
             $mcodes = array();