src/Service/Cdn.php
public function urlServeRaw($iObjectId)
    {
        $bIsTrashed = false;

        if (empty($iObjectId)) {
            $oObj = $this->emptyObject();
        } elseif (is_numeric($iObjectId)) {

            $oObj = $this->getObject($iObjectId);

            if (!$oObj) {

                /**
                 * If the user is a logged in admin with can_browse_trash permission then have a look in the trash
                 */

                if (userHasPermission('admin:cdn:trash:browse')) {
                    $oObj = $this->getObjectFromTrash($iObjectId);
                    if (!$oObj) {
                        //  Cool, guess it really doesn't exist. Let the renderer show a bad_src graphic
                        $oObj = $this->emptyObject();
                    } else {
                        $bIsTrashed = true;
                    }
                } else {
                    //  Let the renderer show a bad_src graphic
                    $oObj = $this->emptyObject();
                }
            }
        } elseif (is_object($iObjectId)) {
            $oObj = $iObjectId;
        } else {
            throw new UrlException('Supplied $iObjectId must be numeric or an object', 1);
        }

        $sUrl = $this->callDriver('urlServeRaw', [$oObj->file->name->disk, $oObj->bucket->slug], $oObj->driver);
        $sUrl .= $bIsTrashed ? '?trashed=1' : '';

        return $sUrl;
    }
public function urlServeRaw($iObjectId)
    {
        $bIsTrashed = false;

        if (empty($iObjectId)) {
            $oObj = $this->emptyObject();
        } elseif (is_numeric($iObjectId)) {

            $oObj = $this->getObject($iObjectId);

            if (!$oObj) {

                /**
                 * If the user is a logged in admin with can_browse_trash permission then have a look in the trash
                 */

                if (userHasPermission('admin:cdn:trash:browse')) {
                    $oObj = $this->getObjectFromTrash($iObjectId);
                    if (!$oObj) {
                        //  Cool, guess it really doesn't exist. Let the renderer show a bad_src graphic
                        $oObj = $this->emptyObject();
                    } else {
                        $bIsTrashed = true;
                    }
                } else {
                    //  Let the renderer show a bad_src graphic
                    $oObj = $this->emptyObject();
                }
            }
        } elseif (is_object($iObjectId)) {
            $oObj = $iObjectId;
        } else {
            throw new UrlException('Supplied $iObjectId must be numeric or an object', 1);
        }

        $sUrl = $this->callDriver('urlServeRaw', [$oObj->file->name->disk, $oObj->bucket->slug], $oObj->driver);
        $sUrl .= $bIsTrashed ? '?trashed=1' : '';

        return $sUrl;
    }
public function urlServeRaw ( $ iObjectId ) { $ bIsTrashed = false ; if ( empty ( $ iObjectId ) ) { $ oObj = $ this -> emptyObject ( ) ; } elseif ( is_numeric ( $ iObjectId ) ) { $ oObj = $ this -> getObject ( $ iObjectId ) ; if ( ! $ oObj ) { /**
                 * If the user is a logged in admin with can_browse_trash permission then have a look in the trash
                 */ if ( userHasPermission ( 'admin:cdn:trash:browse' ) ) { $ oObj = $ this -> getObjectFromTrash ( $ iObjectId ) ; if ( ! $ oObj ) { //  Cool, guess it really doesn't exist. Let the renderer show a bad_src graphic $ oObj = $ this -> emptyObject ( ) ; } else { $ bIsTrashed = true ; } } else { //  Let the renderer show a bad_src graphic $ oObj = $ this -> emptyObject ( ) ; } } } elseif ( is_object ( $ iObjectId ) ) { $ oObj = $ iObjectId ; } else { throw new UrlException ( 'Supplied $iObjectId must be numeric or an object' , 1 ) ; } $ sUrl = $ this -> callDriver ( 'urlServeRaw' , [ $ oObj -> file -> name -> disk , $ oObj -> bucket -> slug ] , $ oObj -> driver ) ; $ sUrl .= $ bIsTrashed ? '?trashed=1' : '' ; return $ sUrl ; }
Returns the URL for serving raw content from the CDN driver's source and not running it through the main CDN

@param integer $iObjectId The ID of the object to serve

@return string
@throws UrlException
Returns the URL for serving raw content from the CDN driver s source and not running it through the main CDN