public function getFormatters()
    {
        if (null === static::$formatters) {
            static::$formatters = array();
            $dirs = array();
            // if we'are using Composer, include these formatters
            if ($composer = $this->getComposer()) {
                $vendorDir = realpath(__DIR__.'/../../../..');
                if (is_readable($installed = $vendorDir.'/composer/installed.json')) {
                    $packages = json_decode(file_get_contents($installed), true);
                    foreach ($packages as $package) {
                        if (isset($package['name']) && is_dir($dir = $vendorDir.DIRECTORY_SEPARATOR.$package['name'])) {
                            /**
                             * Check for extended package extra attribute to customize
                             * formatter inclusion.
                             *
                             * An example to include formatter using class:
                             * {
                             *     "extra" : {
                             *         "mysql-workbench-schema-exporter" : {
                             *             "formatters" : {
                             *                 "my-simple" : "\\My\\Simple\\Formatter",
                             *                 "my-simple2" : "\\My\\Simple2\\Formatter"
                             *             }
                             *         }
                             *     }
                             * }
                             *
                             * An example include formatter using namespace:
                             * {
                             *     "extra" : {
                             *         "mysql-workbench-schema-exporter" : {
                             *             "namespaces" : {
                             *                 "lib/My/Exporter" : "\\Acme\\My\\Exporter",
                             *             }
                             *         }
                             *     }
                             * }
                             */
                            if (isset($package['extra']) && isset($package['extra']['mysql-workbench-schema-exporter'])) {
                                if (is_array($options = $package['extra']['mysql-workbench-schema-exporter'])) {
                                    if (isset($options['formatters']) && is_array($options['formatters'])) {
                                        foreach ($options['formatters'] as $name => $class) {
                                            $this->registerFormatter($name, $class);
                                        }
                                    }
                                    if (isset($options['namespaces']) && is_array($options['namespaces'])) {
                                        foreach ($options['namespaces'] as $lib => $namespace) {
                                            $dirs[$dir.DIRECTORY_SEPARATOR.$lib] = $namespace;
                                        }
                                    }
                                    continue;
                                }
                            }
                            $dirs[] = $dir;
                        }
                    }
                }
            } else {
                $dirs[] = realpath(__DIR__.'/../..');
            }
            $this->scanFormatters($dirs);
        }

        return static::$formatters;
    }