src/FelixOnline/Base/ResourceManager.php
private function build($data, $type)
    {
        if ($type != 'css' && $type != 'js') {
            throw new InternalException('Trying to build invalid type');
        }

        if ($type == 'css') {
            $fileName = $this->getFilename('built.css', 'css', 'dir');
            $fileName2 = $this->getFilename('built.css', 'css');

            $filter = new CssMinFilter();
        } else {
            $fileName = $this->getFilename('built.css', 'js', 'dir');
            $fileName2 = $this->getFilename('built.css', 'js');

            $filter = new JSqueezeFilter();
        }

        if (PRODUCTION_FLAG == true) { // if in production
            $data = new AssetCollection($data, array($filter));
        } else {
            $data = new AssetCollection($data);
        }

        // Abstract out
        if (
            (
                PRODUCTION_FLAG == true &&
                !file_exists($fileName) &&
                // Age
                true
            ) || PRODUCTION_FLAG == false
        ) {
            $css = $css->dump();

            if (!is_writable($fileName)) {
                throw new InternalException('The file '.$fileName.', or the folder it is in, is not writable.');
            }

            file_put_contents($fileName, $content);
        }

        return $fileName2;
    }
private function build($data, $type)
    {
        if ($type != 'css' && $type != 'js') {
            throw new InternalException('Trying to build invalid type');
        }

        if ($type == 'css') {
            $fileName = $this->getFilename('built.css', 'css', 'dir');
            $fileName2 = $this->getFilename('built.css', 'css');

            $filter = new CssMinFilter();
        } else {
            $fileName = $this->getFilename('built.css', 'js', 'dir');
            $fileName2 = $this->getFilename('built.css', 'js');

            $filter = new JSqueezeFilter();
        }

        if (PRODUCTION_FLAG == true) { // if in production
            $data = new AssetCollection($data, array($filter));
        } else {
            $data = new AssetCollection($data);
        }

        // Abstract out
        if (
            (
                PRODUCTION_FLAG == true &&
                !file_exists($fileName) &&
                // Age
                true
            ) || PRODUCTION_FLAG == false
        ) {
            $css = $css->dump();

            if (!is_writable($fileName)) {
                throw new InternalException('The file '.$fileName.', or the folder it is in, is not writable.');
            }

            file_put_contents($fileName, $content);
        }

        return $fileName2;
    }
/*
Build data