Pchp.Library.Output.ob_start C# (CSharp) Метод

ob_start() публичный статический Метод

Increases the level of buffering, enables output buffering if disabled and assignes the filtering callback to the new level of buffering.
public static ob_start ( Context ctx, Delegate filter = null, int chunkSize, bool erase = true ) : bool
ctx Pchp.Core.Context Current runtime context.
filter System.Delegate The filtering callback. Ignores invalid callbacks.
chunkSize int Not supported.
erase bool Not supported.
Результат bool
        public static bool ob_start(Context ctx, Delegate filter = null, int chunkSize = 0, bool erase = true)
        {
            if (chunkSize != 0)
                //PhpException.ArgumentValueNotSupported("chunkSize", "!= 0");
                throw new NotSupportedException("chunkSize != 0");
            if (!erase)
                //PhpException.ArgumentValueNotSupported("erase", erase);
                throw new NotSupportedException("erase == false");

            ctx.BufferedOutput.IncreaseLevel();

            bool result = true;

            // skips filter setting if filter is not specified or valid:
            if (filter != null) //  && (result = filter.Bind())) // TODO: PhpCallback.Bind -> Delegate, done by caller
                ctx.BufferedOutput.SetFilter(filter);

            ctx.IsOutputBuffered = true;

            return result;
        }