Skip to content

Commit

Permalink
pts-core: Fix some PHP deprecation warnings
Browse files Browse the repository at this point in the history
Closes: #720
  • Loading branch information
michaellarabel committed May 27, 2023
1 parent a5235fb commit d9bcf66
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 7 additions & 7 deletions pts-core/objects/pts_result_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ public function get_file_location()
}
public function get_result_dir()
{
$composite_xml_dir = dirname($this->get_file_location());
$composite_xml_dir = $this->get_file_location() != null ? dirname($this->get_file_location()) : '';
return empty($composite_xml_dir) || !is_dir($composite_xml_dir) ? false : $composite_xml_dir . '/';
}
public function get_system_log_dir($result_identifier = null, $dir_check = true)
{
$log_dir = dirname($this->get_file_location());
if(empty($log_dir) || !is_dir($log_dir))
$log_dir = $this->get_result_dir();
if($log_dir == false)
{
return false;
}
Expand All @@ -183,8 +183,8 @@ public function get_system_log_dir($result_identifier = null, $dir_check = true)
}
public function get_test_log_dir(&$result_object = null)
{
$log_dir = $this->get_file_location() != null ? dirname($this->get_file_location()) : '';
if(empty($log_dir) || !is_dir($log_dir))
$log_dir = $this->get_result_dir();
if($log_dir == false)
{
return false;
}
Expand All @@ -193,8 +193,8 @@ public function get_test_log_dir(&$result_object = null)
}
public function get_test_installation_log_dir()
{
$log_dir = dirname($this->get_file_location());
if(empty($log_dir) || !is_dir($log_dir))
$log_dir = $this->get_result_dir();
if($log_dir == false)
{
return false;
}
Expand Down
12 changes: 8 additions & 4 deletions pts-core/phoromatic/pages/phoromatic_result.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,16 @@ public static function render_page_process($PATH)
{
$system_name = str_replace('.GROUP', $replacement, $system_name);
}
foreach(explode(';', phoromatic_server::system_id_variables($row['SystemID'], $row['AccountID'])) as $var)
$system_vars = phoromatic_server::system_id_variables($row['SystemID'], $row['AccountID']);
if(!empty($system_vars))
{
$var = explode('=', $var);
if(count($var) == 2)
foreach(explode(';', $system_vars) as $var)
{
$system_name = str_replace('.' . $var[0], $var[1], $system_name);
$var = explode('=', $var);
if(count($var) == 2)
{
$system_name = str_replace('.' . $var[0], $var[1], $system_name);
}
}
}

Expand Down

0 comments on commit d9bcf66

Please sign in to comment.