protected function writable($path) {
        $fullPath = "{$this->basePath}/$path";
        while (!file_exists($fullPath) && $fullPath != basename($fullPath)) {
            $fullPath = dirname($fullPath);
        }
        return is_writable($fullPath);
    }