Exemple #1
0
 public function testFilterOne()
 {
     Filter_Diff::produceVerseLevel("phpunit", $this->temporary_folder);
     $this->assertFileEquals(dirname(__FILE__) . "/diffStandards/verses_old.usfm", $this->temporary_folder . "/verses_old.usfm");
     $this->assertFileEquals(dirname(__FILE__) . "/diffStandards/verses_new.usfm", $this->temporary_folder . "/verses_new.usfm");
     $this->assertFileEquals(dirname(__FILE__) . "/diffStandards/verses_old.txt", $this->temporary_folder . "/verses_old.txt");
     $this->assertFileEquals(dirname(__FILE__) . "/diffStandards/verses_new.txt", $this->temporary_folder . "/verses_new.txt");
     Filter_Diff::runDiffFile($this->temporary_folder . "/verses_old.usfm", $this->temporary_folder . "/verses_new.usfm", $this->temporary_folder . "/changed_verses.html");
     $this->assertFileEquals(dirname(__FILE__) . "/diffStandards/changed_verses.html", $this->temporary_folder . "/changed_verses.html");
 }
Exemple #2
0
             $changeNotificationUsers[] = $user;
         }
     }
 }
 unset($users);
 // The number of changes processed so far for this Bible.
 $processedChangesCount = 0;
 // The files get stored at http://site.org/bibledit-web/changes/<Bible>/<date>
 $basePath = "revisions/" . $bible . "/" . strftime("%Y-%m-%d_%H:%M:%S");
 $directory = realpath("..") . "/{$basePath}";
 mkdir($directory, 0777, true);
 // Produce the USFM and html files.
 Filter_Diff::produceVerseLevel($bible, $directory);
 // Create online page with changed verses.
 $versesoutputfile = "{$directory}/changed_verses.html";
 Filter_Diff::runDiffFile("{$directory}/verses_old.txt", "{$directory}/verses_new.txt", $versesoutputfile);
 // Email users.
 $subject = Locale_Translate::_("Recent changes") . " " . $bible;
 $emailBody = file_get_contents($versesoutputfile);
 $users = $database_users->getUsers();
 foreach ($users as $user) {
     if ($database_config_user->getUserBibleChangesNotification($user)) {
         if (Access_Bible::read($bible, $user)) {
             if (!Filter_Client::enabled()) {
                 $database_mail->send($user, $subject, $emailBody);
             }
         }
     }
 }
 // Generate the online change notifications.
 $books = $database_modifications->getTeamDiffBooks($bible);