case 'update':
                 $libelMod = 'Modified';
                 break;
             case 'new':
                 $libelMod = 'New file';
                 break;
             case 'delete':
                 $libelMod = 'Deleted';
                 break;
         }
         $msg .= $libelMod . ": " . $data['PatchesForReview']['data'][$i]['fileFullPath'] . "\n";
         $msg .= "By: " . $data['PatchesForReview']['data'][$i]['user'] . " on " . $data['PatchesForReview']['data'][$i]['date'] . "\n";
         $msg .= "===================================================================\n";
         // We get the diff
         $file = new File($data['PatchesForReview']['data'][$i]['fileLang'], $data['PatchesForReview']['data'][$i]['filePath'] . $data['PatchesForReview']['data'][$i]['fileName']);
         $r = $file->diff();
         $msg .= implode("\n", $r);
         $msg .= "\n\n            => Put this change into your patches : https://edit.php.net/?project=php&action=putIntoMyPatches&idDB=" . $data['PatchesForReview']['data'][$i]['idDB'] . "\n            => Delete this change: https://edit.php.net/?project=php&action=deleteThisChange&idDB=" . $data['PatchesForReview']['data'][$i]['idDB'] . "\n            ";
         $msg .= "\n";
         $msg .= "                                          ------------------------------------------------------------------\n\n";
     }
     $msg .= "\n\n";
 }
 $msg .= "\n-- \nhttps://edit.php.net/\nThis email is send automatically by the Php Docbook Online Editor.\n    ";
 //Usefull for language like pt_BR for example, because doc-pt_br don't exist, it's doc-pt-br
 $emailLang = str_replace("_", "-", strtolower($lang));
 $to = $lang === 'en' ? "*****@*****.**" : "doc-{$emailLang}@lists.php.net";
 $subject = "Contributions are ready for review";
 // We send an email for this failed build
 AccountManager::getInstance()->email($to, $subject, $msg, $to, 'list');
 echo "email send !\n";
Example #2
0
 public static function patchDiff($patchId)
 {
     $output = array();
     $patchFiles = RepositoryManager::getInstance()->getPatchFilesByID($patchId);
     foreach ($patchFiles as $patchFile) {
         $patchFile = new File($patchFile->lang, $patchFile->path . $patchFile->name);
         // file delimeter
         $output[] = 'Index: ' . $patchFile->lang . $patchFile->path . $patchFile->name;
         $output = array_merge($output, $patchFile->diff());
     }
     return $output;
 }
 /**
  * 
  */
 public function getDirectActionData()
 {
     $am = AccountManager::getInstance();
     if (!$am->isLogged()) {
         return JsonResponseBuilder::failure();
     }
     $rf = RepositoryFetcher::getInstance();
     $action = $this->getRequestVariable('action');
     $idDB = $this->getRequestVariable('idDB');
     $fileInfo = $rf->getModifiesById($idDB);
     $fileInfo = $fileInfo[0];
     // We get the diff
     $file = new File($fileInfo['lang'], $fileInfo['path'] . $fileInfo['name']);
     return JsonResponseBuilder::success(array('fileInfo' => $fileInfo, 'userInfo' => $am->getUserDetailsByID($fileInfo['userID']), 'vcsDiff' => DiffGenHTMLOutput($file->diff())));
 }