Refactored $_SERVER usage for console usage.