App\Lib\Codeception::checkWriteable PHP Method

checkWriteable() public method

Check if the Codeception Log Path is writeable.
public checkWriteable ( $path = null, $config ) : array
return array Array of flags used in the JSON respone.
    public function checkWriteable($path = null, $config)
    {
        $response = array();
        $response['resource'] = $path;
        // Set this to ensure the developer knows there $path was set.
        $response['config'] = $config;
        if (is_null($path)) {
            $response['error'] = 'The Codeception Log is not set. Is the Codeception configuration set up?';
        } elseif (!file_exists($path)) {
            $response['error'] = 'The Codeception Log directory does not exist. Please check the following path exists:';
        } elseif (!is_writeable($path)) {
            $response['error'] = 'The Codeception Log directory can not be written to yet. Please check the following path has \'chmod 777\' set:';
        }
        $response['ready'] = !isset($response['error']);
        return $response;
    }