0

Trying to run webtrees (https://github.com/fisharebest/webtrees) on GAE. Can't get GAE to recognise .mo compiled language files. The app works OK locall via GAE SDK. I declared them as:

- url: /language/(.*.mo)
  mime_type: text/plain
  static_files: language/\1
  upload: language/(.*.mo)
  application_readable: true

I can download all .mo files OK via URL, but function in I18N.php to test which .mo files are available returns null. I'm wondering why GAE doesn't see the files even though I selected "application_readable"? Is there an issue with declaring .mo files in GAE? I noticed a mime type error on first attempt, so added the mime_type declaration.

Marcel Korpel
  • 21,536
  • 6
  • 60
  • 80
  • My script files are mostly in the root folder. Is there by some chance a GAE restriction that means any script files found at the root (index.php for example) make all sub-folders inaccessible to GAE? – user2873523 Nov 04 '13 at 09:11
  • Reading further, perhaps this explanation of use of PHP's glob could be the issue? http://stackoverflow.com/questions/6997887/glob-not-giving-me-any-results Now just have to find out what GAE's real server path is to my files. – user2873523 Nov 04 '13 at 09:46

1 Answers1

3

You don't need to add an entry in the app.yaml file for application data files, they will still be uploaded but not accessible externally.

Check the path that the application is trying to read the files from. You can use

syslog(LOG_DEBUG, "....");

to put some logging statements into your code that can help you debug what might be going wrong.

Stuart Langley
  • 7,044
  • 1
  • 20
  • 20
  • Thanks. Have removed the declaration of .mo files in app.yaml now. Same problem. So, I put some debug "echo" lines in (am not familiar with using syslog yet). The path echoes looks correct. But, I get nothing echoed when I echo the variable that holds the list of files found. Hence, it appears the files in the location are not visible to GAE internally. Am guessing I have to reference differently. – user2873523 Nov 04 '13 at 08:55
  • So I think I see the problem - there is a bug where glob() is not working correctly and can return false. I see the file library/WT/I18N.php uses glob() to read the mo files which is most likely your issue. You can probably work around it with opendir()/readdir() instead of glob() for now. – Stuart Langley Nov 04 '13 at 09:57
  • Thanks Stuart. If you have the tracker ID on the bug I'd appreciate it. – user2873523 Nov 04 '13 at 10:08
  • Just searched open issues and didn't find it, so I guess it's Google internal? Is there any means by which I can track it? – user2873523 Nov 04 '13 at 10:23