wondersloth/assets — pull request #1 by fleep (2012-02-27 23:08:04+00:00)
Title: Added is_writable() check to build directory in Assets::__construct()

One common silent failures of this subsystem (either during installation or
deployment) based on other Kohana modules is likely to be the build-directory
not being writeable. Prior to this, this could only cause a failure at the
point of calling Assets::generate_package_file(), and even then the
failure is easily missed in a typical web application since CSS/JS 404s
aren't considered fatal exceptions.

Permissions-management is a frequent source of frustration for many
administrators. During deployment it's not uncommon for permissions to be
lost, or to be inconsistent between environments.

I've updated the class to be similar to the DB, Cache, and Logging classes,
which throw fatal exceptions if they are loaded in environments that
are hostile to their operation (e.g., writable directories not writable,
databases that can't be connected to, cache engines that are unavailable, etc.).

Because this happens in __construct() (which is only called once per
execution thanks to the static factory method Assets::instance()), and
the fact that once a file is built Kohana's .htaccess will preclude
the need to call the build action again, this extra check will be
acceptably cheap.