Browse Source

Better Windows detection

tags/2.0.0-rc
Alexander Makarov 10 years ago
parent
commit
81d5dd0163
  1. 2
      build/controllers/AppController.php
  2. 2
      framework/mutex/FileMutex.php

2
build/controllers/AppController.php

@ -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);

2
framework/mutex/FileMutex.php

@ -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);

Loading…
Cancel
Save