Skip to content

Cache with handler file woking incorrect on windown os #978

Description

@phambinh217

In Config\Cache, i see

//...
public $path = WRITEPATH.'cache/';
//...

In Config\BaseConfig, i see

/**
 * Retrieve an environment-specific configuration setting
 *
 * @param string $property
 * @param string $prefix
 * @param string $shortPrefix
 *
 * @return mixed
 */
protected function getEnvValue(string $property, string $prefix, string $shortPrefix) {
    //...
    $value = getenv( $property );
    //...
}

When $property == 'path', getenv() return path property of os, so it override $path property of Cofig\Cache class

Now, I fixed it by override getEnvValue method in Config\Cache

protected function getEnvValue(string $property, string $prefix, string $shortPrefix) {
    //...
    if ($property == 'path' && $shortPrefix == 'cache' && $prefix == 'Config\Cache') {
        return null;
    }
    $value = getenv( $property );
    //...
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions