Skip to content

Commit

Permalink
Fixed redeclaring functions in autoload (Codeception#3575)
Browse files Browse the repository at this point in the history
Fixed redeclaring functions in autoload
  • Loading branch information
Mattin authored and Naktibalda committed Oct 6, 2016
1 parent a9ba9d8 commit b06c756
Showing 1 changed file with 34 additions and 18 deletions.
52 changes: 34 additions & 18 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,32 +62,48 @@ function json_last_error_msg()
}

// function not autoloaded in PHP, thus its a good place for them
function codecept_debug($data)
{
\Codeception\Util\Debug::debug($data);
if (!function_exists('codecept_debug')) {
function codecept_debug($data)
{
\Codeception\Util\Debug::debug($data);
}
}

function codecept_root_dir($appendPath = '')
{
return \Codeception\Configuration::projectDir() . $appendPath;
if (!function_exists('codecept_root_dir')) {
function codecept_root_dir($appendPath = '')
{
return \Codeception\Configuration::projectDir() . $appendPath;
}
}

function codecept_output_dir($appendPath = '')
{
return \Codeception\Configuration::outputDir() . $appendPath;
if (!function_exists('codecept_output_dir')) {
function codecept_output_dir($appendPath = '')
{
return \Codeception\Configuration::outputDir() . $appendPath;
}
}

function codecept_log_dir($appendPath = '')
{
return \Codeception\Configuration::outputDir() . $appendPath;
if (!function_exists('codecept_log_dir')) {
function codecept_log_dir($appendPath = '')
{
return \Codeception\Configuration::outputDir() . $appendPath;
}
}

function codecept_data_dir($appendPath = '')
{
return \Codeception\Configuration::dataDir() . $appendPath;
if (!function_exists('codecept_data_dir')) {
function codecept_data_dir($appendPath = '')
{
return \Codeception\Configuration::dataDir() . $appendPath;
}
}

function codecept_relative_path($path)
{
return \Codeception\Util\PathResolver::getRelativeDir($path, \Codeception\Configuration::projectDir(), DIRECTORY_SEPARATOR);
if (!function_exists('codecept_relative_path')) {
function codecept_relative_path($path)
{
return \Codeception\Util\PathResolver::getRelativeDir(
$path,
\Codeception\Configuration::projectDir(),
DIRECTORY_SEPARATOR
);
}
}

0 comments on commit b06c756

Please sign in to comment.