src/Common/Service/Asset.php
protected function determineType($sAsset, $sForceType = null)
    {
        //  Override if nessecary
        if (!empty($sForceType)) {

            return $sForceType;
        }

        // --------------------------------------------------------------------------

        //  Look for <style></style>
        if (preg_match('/^<style.*?>.*?<\/style>$/si', $sAsset)) {

            return 'CSS-INLINE';
        }

        // --------------------------------------------------------------------------

        //  Look for <script></script>
        if (preg_match('/^<script.*?>.*?<\/script>$/si', $sAsset)) {

            return 'JS-INLINE';
        }

        // --------------------------------------------------------------------------

        //  Look for .css
        if (substr($sAsset, strrpos($sAsset, '.')) == '.css') {

            return 'CSS';
        }

        // --------------------------------------------------------------------------

        //  Look for .js
        if (substr($sAsset, strrpos($sAsset, '.')) == '.js') {

            return 'JS';
        }
    }
protected function determineType($sAsset, $sForceType = null)
    {
        //  Override if nessecary
        if (!empty($sForceType)) {

            return $sForceType;
        }

        // --------------------------------------------------------------------------

        //  Look for <style></style>
        if (preg_match('/^<style.*?>.*?<\/style>$/si', $sAsset)) {

            return 'CSS-INLINE';
        }

        // --------------------------------------------------------------------------

        //  Look for <script></script>
        if (preg_match('/^<script.*?>.*?<\/script>$/si', $sAsset)) {

            return 'JS-INLINE';
        }

        // --------------------------------------------------------------------------

        //  Look for .css
        if (substr($sAsset, strrpos($sAsset, '.')) == '.css') {

            return 'CSS';
        }

        // --------------------------------------------------------------------------

        //  Look for .js
        if (substr($sAsset, strrpos($sAsset, '.')) == '.js') {

            return 'JS';
        }
    }
protected function determineType ( $ sAsset , $ sForceType = null ) { //  Override if nessecary if ( ! empty ( $ sForceType ) ) { return $ sForceType ; } // -------------------------------------------------------------------------- //  Look for <style></style> if ( preg_match ( '/^<style.*?>.*?<\/style>$/si' , $ sAsset ) ) { return 'CSS-INLINE' ; } // -------------------------------------------------------------------------- //  Look for <script></script> if ( preg_match ( '/^<script.*?>.*?<\/script>$/si' , $ sAsset ) ) { return 'JS-INLINE' ; } // -------------------------------------------------------------------------- //  Look for .css if ( substr ( $ sAsset , strrpos ( $ sAsset , '.' ) ) == '.css' ) { return 'CSS' ; } // -------------------------------------------------------------------------- //  Look for .js if ( substr ( $ sAsset , strrpos ( $ sAsset , '.' ) ) == '.js' ) { return 'JS' ; } }
Determines the type of asset being loaded

@param  string $sAsset     The asset being loaded
@param  string $sForceType Forces a particular type (accepts values CSS, JS, CSS-INLINE or JS-INLINE)

@return string
Determines the type of asset being loaded