예제 #1
0
 public function showdiff($file)
 {
     $this->render('diff_showdiff.php');
     # Paths
     $base = Config::Get('BASE_TEMPLATE_PATH') . DS . $file;
     $custom = SKINS_PATH . DS . $file;
     if (!file_exists($custom)) {
         echo '<strong>Error: </strong>The file "' . $file . '" has not been modified';
         return;
     }
     # Load the diffs
     include CORE_LIB_PATH . DS . 'diff' . DS . 'diff.php';
     $diff = new filediff();
     $text = $diff->inline($base, $custom, 2);
     echo count($diff->changes) . ' changes';
     echo $text;
 }
예제 #2
0
파일: admin.php 프로젝트: goXXip/mihalismmh
     if ($mmhclass->funcs->is_null($file2compare) == true) {
         $mmhclass->templ->error($mmhclass->lang['009'], true);
     } else {
         //
         // This file comparison system should really have file2compare
         // checks, but hopefully a site ADMIN does not try to exploit.
         //
         // They are the site administrators so why exploit own site?
         //
         $diff = new filediff();
         $svn_content = $mmhclass->funcs->get_http_content("http://mihalismmh.googlecode.com/svn/trunk/multihost/{$file2compare}", 1);
         $svn_filename = $mmhclass->funcs->create_tempfile($svn_content);
         $svn_fcontent = file("{$mmhclass->info->root_path}source/tempfiles/{$svn_filename}");
         $mmhclass->funcs->destroy_tempfile($svn_filename);
         $local_fcontent = file("{$mmhclass->info->root_path}{$file2compare}");
         $output_html = $diff->inline($local_fcontent, $svn_fcontent, 2);
         if (count($diff->changes) >= 1) {
             exit($output_html);
         } else {
             $mmhclass->templ->error($mmhclass->lang['486'], true);
         }
     }
     break;
 case "upgrade":
     $changedfiles = $upgrade_packs = array();
     $upgradeinfo = explode(";", $mmhclass->funcs->get_http_content("http://mihalismmh.googlecode.com/svn/trunk/information/upgrades/upgradeinfo.txt", 1));
     foreach ($upgradeinfo as $id => $versioninfo) {
         $version = explode(":", $versioninfo);
         if (version_compare($mmhclass->info->version, $version['0'], "<") == true) {
             $upgrade_packs[] = $version;
         }