error 500 mkdir() file exists GII 1.1.17

Hi All,

GII kept failing on me while attempting to create models.

I checked the folder permissions, but all seemed fine. After some trial and error, I had a look at the source code and finally changed yii/framework/gii/CCodeModel.php:387

from


@mkdir(dirname($path),0755,true);

to


		if( ! is_dir(dirname($path))){

			@mkdir(dirname($path),0755,true);

		}

And it works again

(by the way, deleting the created folder manually didn’t make the problem go away. It was re-creating it and then re-attempting to create it again)

update: this bug can also be avoided by disabling php_warnings in error_reporting.