Skip to content

Commit

Permalink
Fixed reloading of apache.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Andrews committed Jul 29, 2014
1 parent f9a75e8 commit 7e7d9e1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions modules/apache_admin/hooks/OnDaemonRun.hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ function WriteVhostConfigFile()

// write the vhost config file
$vhconfigfile = ctrl_options::GetSystemOption( 'apache_vhost' );
if ( fs_filehandler::UpdateFile( $vhconfigfile, 0777, $line ) ) {
if ( fs_filehandler::UpdateFile( $vhconfigfile, 0777, $line )) {
// Reset Apache settings to reflect that config file has been written, until the next change.
$time = time();
$vsql = $zdbh->prepare( "UPDATE x_settings
Expand All @@ -434,10 +434,11 @@ function WriteVhostConfigFile()
$vsql->bindParam( ':time', $time );
$vsql->execute();
echo "Finished writting Apache Config... Now reloading Apache..." . fs_filehandler::NewLine();


$returnValue = 0;

if (sys_versions::ShowOSPlatformVersion() == "Windows") {
$returnValue = system(ctrl_options::GetSystemOption('httpd_exe') . " " . ctrl_options::GetSystemOption('apache_restart'));
system("" . ctrl_options::GetSystemOption('httpd_exe') . " " . ctrl_options::GetSystemOption('apache_restart') . "", $returnValue);
} else {
$command = ctrl_options::GetSystemOption( 'zsudo' );
$args = array(
Expand All @@ -447,14 +448,12 @@ function WriteVhostConfigFile()
);
$returnValue = ctrl_system::systemCommand( $command, $args );
}

if($returnValue){
echo "Apache reloaded successfully! " .fs_filehandler::NewLine();
}

echo "Apache reload " . ((0 === $returnValue ) ? "suceeded" : "failed") . "." . fs_filehandler::NewLine();

} else {
return false;
}
}
}

function CheckErrorDocument( $error )
Expand Down

0 comments on commit 7e7d9e1

Please sign in to comment.