Commit 81d5dd01 by Alexander Makarov

Better Windows detection

parent 67bd4972
......@@ -29,7 +29,7 @@ class AppController extends Controller
*/
protected function unlink($file)
{
if (is_dir($file) && strncasecmp(PHP_OS, 'WIN', 3) === 0) {
if (is_dir($file) && DIRECTORY_SEPARATOR === '\\') {
rmdir($file);
} else {
unlink($file);
......
......@@ -70,7 +70,7 @@ class FileMutex extends Mutex
*/
public function init()
{
if (stripos(php_uname('s'), 'win') === 0) {
if (DIRECTORY_SEPARATOR === '\\') {
throw new InvalidConfigException('FileMutex does not have MS Windows operating system support.');
}
$this->mutexPath = Yii::getAlias($this->mutexPath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment