filestack/mixins/TransformationMixin.php
public function getTransformStr($taskname, $process_attrs)
    {
        $tranform_str = $taskname;
        if (count($process_attrs) > 0) {
            $tranform_str .= '=';
        }

        // append attributes if exists
        foreach ($process_attrs as $key => $value) {
            $encoded_value = gettype($value) === 'string' ?
                urlencode($value) : urlencode(json_encode($value));

            $tranform_str .= sprintf('%s:%s,',
                urlencode($key),
                $encoded_value);
        }

        // remove last comma
        if (count($process_attrs) > 0) {
            $tranform_str = substr($tranform_str, 0, strlen($tranform_str) - 1);
        }

        return $tranform_str;
    }
public function getTransformStr($taskname, $process_attrs)
    {
        $tranform_str = $taskname;
        if (count($process_attrs) > 0) {
            $tranform_str .= '=';
        }

        // append attributes if exists
        foreach ($process_attrs as $key => $value) {
            $encoded_value = gettype($value) === 'string' ?
                urlencode($value) : urlencode(json_encode($value));

            $tranform_str .= sprintf('%s:%s,',
                urlencode($key),
                $encoded_value);
        }

        // remove last comma
        if (count($process_attrs) > 0) {
            $tranform_str = substr($tranform_str, 0, strlen($tranform_str) - 1);
        }

        return $tranform_str;
    }
public function getTransformStr ( $ taskname , $ process_attrs ) { $ tranform_str = $ taskname ; if ( count ( $ process_attrs ) > 0 ) { $ tranform_str .= '=' ; } // append attributes if exists foreach ( $ process_attrs as $ key => $ value ) { $ encoded_value = gettype ( $ value ) === 'string' ? urlencode ( $ value ) : urlencode ( json_encode ( $ value ) ) ; $ tranform_str .= sprintf ( '%s:%s,' , urlencode ( $ key ) , $ encoded_value ) ; } // remove last comma if ( count ( $ process_attrs ) > 0 ) { $ tranform_str = substr ( $ tranform_str , 0 , strlen ( $ tranform_str ) - 1 ) ; } return $ tranform_str ; }
Return the URL portion of a transformation task

@param string    $taskname       name of task, e.g. 'crop', 'resize', etc.
@param array     $process_attrs  attributes replated to this task

@throws Filestack\FilestackException

@return Transformation object
Return the URL portion of a transformation task