The custom/ directory is the place for developers to make upgrade-safe customizations to the Sugar application. And as such, both internally here at Sugar and for you as module developers, the need for checking the custom directory for things is crucial. And to do this, you probably have code that looks something like this ( borrowed from the JJW Design’s Google Map plugin project )
But there’s one problem here, and that is that file_exists() is not allowed on modules to be used in our On-Demand environment. But there’s a solution for this, and it makes doing this sort of thing less painful than before. In Sugar 6.4, we’ve added a new function named get_custom_file_if_exists(), which will do this check for you. This reduces the above code example above down to this one-liner…
Hopefully this reduces the need to do these sorts of calls.
Are you seeing other reasons to do file_exists() calls in your modules? If so, sound off in the comments or on Twitter with your use cases and we’ll see what we can do to help you out.