for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Runs a capistrano job that will check the connection and that all folders with
* permission are setup correctly
*/
class PingJob {
* @var array
public $args;
* @global array $databaseConfig
public function setUp() {
global $databaseConfig;
global
Instead of relying on global state, we recommend one of these alternatives:
function myFunction($a, $b) { // Do something }
class MyClass { private $a; private $b; public function __construct($a, $b) { $this->a = $a; $this->b = $b; } public function myFunction() { // Do something } }
DB::connect($databaseConfig);
chdir(BASE_PATH);
}
* @return DNData
public function DNData() {
return DNData::inst();
* Do the actual job by calling the appropiate backend
public function perform() {
echo "[-] PingJob starting" . PHP_EOL;
$log = new DeploynautLogFile($this->args['logfile']);
$ping = DNPing::get()->byID($this->args['pingID']);
$environment = $ping->Environment();
$project = $environment->Project();
$environment->Backend()->ping($environment, $log, $project);
Instead of relying on
globalstate, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state