ZF-11845: Wrong file permission in Zend_Search_Lucene


protected static $_defaultFilePermissions = '0777';

is a string, should be integer or you should use octdec() to convert when using file permissions in fopen

see: (comments)


What version of Zend Framework are you using?

Could you please specify the file you found this in. When searching against trunk, the only file I could find {{$_defaultFilePermissions}} in was {{Zend_Search_Lucene_Storage_Directory_Filesystem}}, and it has it's value (0666) initialized properly (ie: not a string).

I'm using version 1.11.11 and the revision of the file Filesystem.php is: 23964. The class is Zend_Search_Lucene_Storage_Directory_Filesystem and in the version I have, the variable is defined as

protected static $_defaultFilePermissions = '0777';

BTW, the function getDefaultFilePermissions() is considered to return integer, but returns a string

 * Get default file permissions
 * @return integer
public static function getDefaultFilePermissions()
    return self::$_defaultFilePermissions;

Are you sure something hasn't changed locally in your ZF copy? Looking into the release-1.11.11 svn tag, that file at r23964 looks like this:…

An interesting thing I came across while researching this is that the release-1.11.11 file is at r23964, but the same file in trunk is at r23906 (see here)

Yes, I'm sure. We are working with symlinks and a centralized copy of ZF. The Version is 1.11.11 (FULL) which was downloaded on 29th of September 2011 (day of the release). I'm downloading the latest version and going to doublecheck the file.

Looks like the file I downloaded on 29th of October is different from the current version I downloaded a few minutes ago. But the file Version.php contains 1.11.11 with r24483 WTF??? ;-)

That is unusual. I can't recall exactly when I downloaded my local copy of 1.11.11 full release, but it has the correct file (library/Zend/Search/Lucene/Storage/Directory/Filesystem.php @ r23964). Do you still have the archive file you downloaded on Sept 29th?

-In the meantime, I'll look into the trunk vs. release-1.11.11 issue to find out why trunk has an older revision of library/Zend/Search/Lucene/Storage/Directory/Filesystem.php- This is just due to the fact that there was a length of time between commit to trunk (r23906) and merging to release (r23964).