Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/Console/Commands/AutoRemoveBuilds.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
use CDash\Database;
use Illuminate\Console\Command;

require_once 'include/common.php';
require_once 'include/pdo.php';
require_once 'include/autoremove.php';

class AutoRemoveBuilds extends Command
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

include_once 'include/common.php';
require_once 'include/common.php';
require_once 'include/pdo.php';
require_once 'include/defines.php';

abstract class AbstractController extends BaseController
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/BuildController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
use Illuminate\View\View;
use PDO;

require_once('include/repository.php');
require_once 'include/repository.php';

final class BuildController extends AbstractBuildController
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/FilterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use Illuminate\Http\JsonResponse;

include_once 'include/filterdataFunctions.php';
require_once 'include/filterdataFunctions.php';

class FilterController extends AbstractController
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/TestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Illuminate\View\View;
use Symfony\Component\HttpFoundation\StreamedResponse;

include_once 'include/repository.php';
require_once 'include/repository.php';

final class TestController extends AbstractProjectController
{
Expand Down
1 change: 0 additions & 1 deletion app/Jobs/ProcessSubmission.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

use UpdateHandler;

include_once 'include/common.php';
require_once 'include/ctestparser.php';
require_once 'include/sendemail.php';

Expand Down
1 change: 0 additions & 1 deletion app/Models/BuildTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public static function marshalStatus($status): array
// Only used in api/v1/viewTest.php
public static function marshal($data, $buildid, $projectid, $projectshowtesttime, $testtimemaxstatus, $testdate): array
{
require_once 'include/common.php';
$marshaledStatus = self::marshalStatus($data['status']);
if ($data['details'] === 'Disabled') {
$marshaledStatus = array('Not Run', 'disabled-test');
Expand Down
2 changes: 0 additions & 2 deletions app/Services/UnparsedSubmissionProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
use Illuminate\Support\Str;
use Symfony\Component\HttpFoundation\Response;

require_once 'include/common.php';

/**
* This class handles submissions that should be parsed on the server-side
* by CDash. This is in contrast to the XML files that are typically generated
Expand Down
2 changes: 0 additions & 2 deletions app/cdash/app/Lib/Repository/GitHub.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
use CDash\Model\PendingSubmissions;
use CDash\Model\Project;

require_once 'include/log.php';

/**
* Class GitHub
* @package CDash\Lib\Repository
Expand Down
5 changes: 2 additions & 3 deletions app/cdash/app/Model/Build.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@

namespace CDash\Model;

include_once 'include/common.php';
include_once 'include/ctestparserutils.php';
include_once 'include/repository.php';
require_once 'include/ctestparserutils.php';
require_once 'include/repository.php';

use App\Models\Test;
use App\Services\TestingDay;
Expand Down
1 change: 0 additions & 1 deletion app/cdash/app/Model/BuildFailure.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
=========================================================================*/
namespace CDash\Model;

require_once 'include/common.php';
require_once 'include/repository.php';

use CDash\Config;
Expand Down
4 changes: 1 addition & 3 deletions app/cdash/app/Model/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
=========================================================================*/
namespace CDash\Model;

require_once 'include/common.php';
require_once 'include/cdashmail.php';

use CDash\Collection\SubscriberCollection;
Expand Down Expand Up @@ -639,7 +638,6 @@ public function Fill(): void
$this->WebApiKey = $project_array['webapikey'];
if ($this->WebApiKey == '') {
// If no web API key exists, we add one
include_once 'include/common.php';
$newKey = generate_password(40);
$this->PDO->executePrepared('
UPDATE project SET webapikey=? WHERE id=?
Expand Down Expand Up @@ -1644,7 +1642,7 @@ public function CullUploadedFiles(): bool
$totalUploadSize = $this->GetUploadsTotalSize();

if ($totalUploadSize > $this->UploadQuota) {
require_once 'include/common.php';

add_log('Upload quota exceeded, removing old files', 'Project::CullUploadedFiles',
LOG_INFO, $this->Id);

Expand Down
2 changes: 0 additions & 2 deletions app/cdash/app/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

use CDash\Database;

require_once 'include/common.php';

class User
{
public $Id;
Expand Down
2 changes: 2 additions & 0 deletions app/cdash/include/Test/CDashTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

use Tests\TestCase;

require_once 'include/common.php';

class CDashTestCase extends TestCase
{
protected $mockPDO;
Expand Down
2 changes: 1 addition & 1 deletion app/cdash/include/api_common.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/

require_once 'include/common.php';



use CDash\Model\Build;
Expand Down
8 changes: 4 additions & 4 deletions app/cdash/include/autoremove.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
/** Remove builds by their group-specific auto-remove timeframe setting */
function removeBuildsGroupwise($projectid, $maxbuilds, $force = false)
{
require_once 'include/pdo.php';
require_once 'include/common.php';



if (!$force && !config('cdash.autoremove_builds')) {
return;
Expand Down Expand Up @@ -70,8 +70,8 @@ function removeBuildsGroupwise($projectid, $maxbuilds, $force = false)
/** Remove the first builds that are at the beginning of the queue */
function removeFirstBuilds($projectid, $days, $maxbuilds, $force = false, $echo = true)
{
require_once 'include/pdo.php';
require_once 'include/common.php';



@set_time_limit(0);
$remove_builds = config('cdash.autoremove_builds');
Expand Down
2 changes: 1 addition & 1 deletion app/cdash/include/ctestparser.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function parse_put_submission($filehandler, $projectid, $expected_md5)
/** Main function to parse the incoming xml from ctest */
function ctest_parse($filehandle, $projectid, $expected_md5 = '')
{
require_once 'include/common.php';

include 'include/version.php';

// Check if this is a new style PUT submission.
Expand Down
11 changes: 3 additions & 8 deletions app/cdash/include/dailyupdates.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
// the input, the project's nightly start time, now
//

require_once 'include/pdo.php';
include_once 'include/common.php';

require_once 'include/cdashmail.php';

use CDash\Config;
Expand Down Expand Up @@ -889,7 +888,6 @@ function sendEmailExpectedBuilds($projectid, $currentstarttime): void
/** Remove the buildemail that have been there from more than 48h */
function cleanBuildEmail(): void
{
include_once 'include/common.php';
$now = date(FMT_DATETIME, time() - 3600 * 48);

$db = Database::getInstance();
Expand All @@ -899,7 +897,6 @@ function cleanBuildEmail(): void
/** Clean the usertemp table if more than 24hrs */
function cleanUserTemp(): void
{
include_once 'include/common.php';
$now = date(FMT_DATETIME, time() - 3600 * 24);

$db = Database::getInstance();
Expand All @@ -909,7 +906,6 @@ function cleanUserTemp(): void
/** Send an email to administrator of the project for users who are not registered */
function sendEmailUnregisteredUsers(int $projectid, $cvsauthors): void
{
include_once 'include/common.php';
$config = Config::getInstance();
$unregisteredusers = array();
foreach ($cvsauthors as $author) {
Expand Down Expand Up @@ -974,8 +970,7 @@ function sendEmailUnregisteredUsers(int $projectid, $cvsauthors): void
/** Add daily changes if necessary */
function addDailyChanges(int $projectid): void
{
include_once 'include/common.php';
include_once 'include/sendemail.php';
require_once 'include/sendemail.php';

$project = new Project();
$project->Id = $projectid;
Expand Down Expand Up @@ -1199,7 +1194,7 @@ function addDailyChanges(int $projectid): void
}

// Remove the first builds of the project
include_once 'include/autoremove.php';
require_once 'include/autoremove.php';
removeFirstBuilds($projectid, $project->AutoremoveTimeframe, $project->AutoremoveMaxBuilds);
removeBuildsGroupwise($projectid, $project->AutoremoveMaxBuilds);
}
Expand Down
2 changes: 1 addition & 1 deletion app/cdash/include/log.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
=========================================================================*/

require_once 'include/defines.php';
require_once 'include/pdo.php';



use Illuminate\Support\Facades\Log;
Expand Down
2 changes: 0 additions & 2 deletions app/cdash/include/pdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/

require_once 'include/log.php';

use CDash\Database;

/**
Expand Down
5 changes: 1 addition & 4 deletions app/cdash/include/repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/

require_once 'include/log.php';

use CDash\Model\Build;
use CDash\Model\Project;
use CDash\ServiceContainer;
use CDash\Database;
Expand Down Expand Up @@ -858,7 +855,7 @@ function generate_bugtracker_new_issue_link($build, $project)
}

// Use our email functions to generate a message body and title for this build.
require_once('include/sendemail.php');
require_once 'include/sendemail.php';
$errors = check_email_errors(intval($build->Id), false, 0, true);
$emailtext = [];
foreach ($errors as $errorkey => $nerrors) {
Expand Down
5 changes: 1 addition & 4 deletions app/cdash/include/sendemail.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ function get_email_summary(int $buildid, array $errors, $errorkey, int $maxitems
/** Generate the title and body for a broken build. */
function generate_broken_build_message(array $emailtext, $Build, $Project): array|false
{
include_once 'include/common.php';

$config = Config::getInstance();
$serverURI = $config->getBaseUrl();

Expand Down Expand Up @@ -502,8 +500,7 @@ function generate_broken_build_message(array $emailtext, $Build, $Project): arra
/** function to send email to site maintainers when the update step fails */
function send_update_email(UpdateHandler $handler, int $projectid): void
{
include_once 'include/common.php';
require_once 'include/pdo.php';


$Project = new Project();
$Project->Id = $projectid;
Expand Down
1 change: 0 additions & 1 deletion app/cdash/public/api/v1/build.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

namespace CDash\Api\v1\Build;

require_once 'include/pdo.php';
require_once 'include/api_common.php';

use CDash\Database;
Expand Down
1 change: 0 additions & 1 deletion app/cdash/public/api/v1/buildgroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

namespace CDash\Api\v1\BuildGroup;

require_once 'include/pdo.php';
require_once 'include/api_common.php';
require_once 'include/version.php';

Expand Down
2 changes: 0 additions & 2 deletions app/cdash/public/api/v1/computeClassifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

namespace CDash\Api\v1\ComputeClassifier;

require_once 'include/log.php';
require_once 'include/pdo.php';
require_once 'include/api_common.php';

$builds = $_GET['builds'];
Expand Down
4 changes: 1 addition & 3 deletions app/cdash/public/api/v1/deleteSubmissionFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

namespace CDash\Api\v1\DeleteSubmissionFile;

require_once 'include/pdo.php';
include_once 'include/common.php';
include_once 'include/ctestparser.php';
require_once 'include/ctestparser.php';

use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\Response;
Expand Down
1 change: 0 additions & 1 deletion app/cdash/public/api/v1/expectedbuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

namespace CDash\Api\v1\ExpectedBuild;

require_once 'include/pdo.php';
require_once 'include/api_common.php';

use App\Models\User;
Expand Down
3 changes: 0 additions & 3 deletions app/cdash/public/api/v1/getSubmissionFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

namespace CDash\Api\v1\GetSubmissionFile;

require_once 'include/pdo.php';
include_once 'include/common.php';

use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\Response;

Expand Down
3 changes: 1 addition & 2 deletions app/cdash/public/api/v1/getbuildid.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@

namespace CDash\Api\v1\GetBuildID;

require_once 'include/common.php';
require_once 'include/api_common.php';
require_once 'include/pdo.php';


use CDash\Database;

Expand Down
3 changes: 1 addition & 2 deletions app/cdash/public/api/v1/getuserid.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@

namespace CDash\Api\v1\GetUserID;

require_once 'include/common.php';
require_once 'include/api_common.php';
require_once 'include/pdo.php';


use App\Models\User;
use CDash\Model\Project;
Expand Down
3 changes: 0 additions & 3 deletions app/cdash/public/api/v1/hasfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

namespace CDash\Api\v1\HasFile;

require_once 'include/common.php';
require_once 'include/pdo.php';

use CDash\Database;

$md5sums_get = isset($_GET['md5sums']) ? htmlspecialchars($_GET['md5sums']) : '';
Expand Down
1 change: 0 additions & 1 deletion app/cdash/public/api/v1/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

namespace CDash\Api\v1\Index;

require_once 'include/pdo.php';
require_once 'include/api_common.php';
require_once 'include/filterdataFunctions.php';

Expand Down
3 changes: 0 additions & 3 deletions app/cdash/public/api/v1/manageBuildGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

namespace CDash\Api\v1\ManageBuildGroup;

require_once 'include/pdo.php';
require_once 'include/common.php';

use App\Services\PageTimer;
use CDash\Database;
use CDash\Model\BuildGroup;
Expand Down
Loading