Skip to content

Commit

Permalink
Formatting changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Andrews committed Jul 29, 2014
1 parent eb8cfb8 commit f9a75e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/apache_admin/hooks/OnDaemonRun.hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,14 @@ function WriteVhostConfigFile()
// Reset Apache settings to reflect that config file has been written, until the next change.
$time = time();
$vsql = $zdbh->prepare( "UPDATE x_settings
SET so_value_tx=:time
WHERE so_name_vc='apache_changed'" );
SET so_value_tx=:time
WHERE so_name_vc='apache_changed'" );
$vsql->bindParam( ':time', $time );
$vsql->execute();
echo "Finished writting Apache Config... Now reloading Apache..." . fs_filehandler::NewLine();


if ( sys_versions::ShowOSPlatformVersion() == "Windows" ) {
if (sys_versions::ShowOSPlatformVersion() == "Windows") {
$returnValue = system(ctrl_options::GetSystemOption('httpd_exe') . " " . ctrl_options::GetSystemOption('apache_restart'));
} else {
$command = ctrl_options::GetSystemOption( 'zsudo' );
Expand All @@ -454,7 +454,7 @@ function WriteVhostConfigFile()

} else {
return false;
}
}
}

function CheckErrorDocument( $error )
Expand Down

2 comments on commit f9a75e8

@TGates71
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code:

    // write the vhost config file
    $vhconfigfile = ctrl_options::GetSystemOption( 'apache_vhost' );
    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
SET so_value_tx=:time
WHERE so_name_vc='apache_changed'" );
        $vsql->bindParam( ':time', $time );
        $vsql->execute();
        echo "Finished writting Apache Config... Now reloading Apache..." . fs_filehandler::NewLine();


        if (sys_versions::ShowOSPlatformVersion() == "Windows") {
            $returnValue = system(ctrl_options::GetSystemOption('httpd_exe') . " " . ctrl_options::GetSystemOption('apache_restart'));
        } else {
            $command = ctrl_options::GetSystemOption( 'zsudo' );
            $args = array(
                "service",
                ctrl_options::GetSystemOption( 'apache_sn' ),
                ctrl_options::GetSystemOption( 'apache_restart' )
            );
            $returnValue = ctrl_system::systemCommand( $command, $args );
        }

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

    } else {
        return false;
    }
}

Needs to be:

    // write the vhost config file
    $vhconfigfile = ctrl_options::GetSystemOption( 'apache_vhost' );
    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
                                    SET so_value_tx=:time
                                    WHERE so_name_vc='apache_changed'" );
        $vsql->bindParam( ':time', $time );
        $vsql->execute();
        echo "Finished writting Apache Config... Now reloading Apache..." . fs_filehandler::NewLine();

        if (sys_versions::ShowOSPlatformVersion() == "Windows") {
            system("" . ctrl_options::GetSystemOption('httpd_exe') . " " . ctrl_options::GetSystemOption('apache_restart') . "", $returnValue);
            echo "Apache reload " . ((0 === $returnValue ) ? "suceeded" : "failed") . "." . fs_filehandler::NewLine();
        } else {
            $command = ctrl_options::GetSystemOption( 'zsudo' );
            $args = array(
                "service",
                ctrl_options::GetSystemOption( 'apache_sn' ),
                ctrl_options::GetSystemOption( 'apache_restart' )
            );
            $returnValue = ctrl_system::systemCommand( $command, $args );
            echo "Apache reload " . ((0 === $returnValue ) ? "suceeded" : "failed") . "." . fs_filehandler::NewLine();
        }

    } else {
        return false;
    }
}

This code did not work in my testing with the updated windows apache restart:

         echo "Apache reloaded successfully! " .fs_filehandler::NewLine();
        }```

@Caffe1neAdd1ct
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed by 7e7d9e1

Please sign in to comment.