blob: 430313e9072ea3aea129fc3276202c6371646339 [file] [log] [blame]
<?php
/*
* Dates File Rule
*
* This rule validates if the project still uses the "dates.txt" file.
*
* It checks on the project's url: eclipse.org/<project-name>/dates.txt
*
* @author: mparra@openmex.com
*
*/
require_once ("common/search_dir.php");
class dates_file_rule {
function dates_file_rule() {
}
/*
* Standar function that runs the rule.
*
* @old_object: The project-info-object to retrieve information from
* @new_object: Not used
*/
function process($old_object, $new_object){
$project_name = $old_object->getName();
$result = "";
$path = "temporary/".$project_name."/";
$files = searchdir($path,0,"FILES");
if($files){
for($x = 0;$x < count($files);$x++){
//Check if using dates.txt
if(strcmp($files[$x],$path."dates.txt") == 0){ //If true, add a reminder to the email
$result = "\n - Please dont use dates.txt anymore. Add your releases information to the project-info.xml file.";
}
}
}
return $result;
}
}
?>