Re: ACD PHP scripting - mode t available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On further checking the PHP manual for fopen() I did find the string mode
't' for the Windows port as text-mode translation flag for translating \n to
\r\n. Additional flags x and x+ are also available now.

The advice for portability was to use the 'b' mode instead.

Quote from the online PHP Manual:-
Windows offers a text-mode translation flag ('t') which will transparently
translate \n to \r\n when working with the file. In contrast, you can also
use 'b' to force binary mode, which will not translate your data. To use
these flags, specify either 'b' or 't' as the last character of the mode
parameter.

The default translation mode depends on the SAPI and version of PHP that you
are using, so you are encouraged to always specify the appropriate flag for
portability reasons. You should use the 't' mode if you are working with
plain-text files and you use \n to delimit your line endings in your script,
but expect your files to be readable with applications such as notepad. You
should use the 'b' in all other cases.

If you do not specify the 'b' flag when working with binary files, you may
experience strange problems with your data, including broken image files and
strange problems with \r\n characters.

For portability, it is strongly recommended that you always use the 'b' flag
when opening files with fopen().

Again, for portability, it is also strongly recommended that you re-write
code that uses or relies upon the 't' mode so that it uses the correct line
endings and 'b' mode instead.

As of PHP 4.3.2, the default mode is set to binary for all platforms that
distinguish between binary and text mode. If you are having problems with
your scripts after upgrading, try using the 't' flag as a workaround until
you have made your script more portable as mentioned above.

Ap.Muthu

> From: "Ap.Muthu"
> Sent: 15 April 2004 11:21
> Subject: Re: ACD PHP scripting


> Hello Tjapko,
>
> I have not tried the ACD at all till date. I just downloaded the v1.3 and
on
> a cursory look I find that the read_agent_config() function should have
been
> declared before it's useage.
>
> I also do not know what the string mode "rt" in:-
>  $fp = fopen($file, "rt");
> is used for. The only string modes I know of are r, r+, w, w+. a. a+, b.
>
> If it is neither a response to a login nor to a logoff, then it displays
the
> login form.
> An additional check to ensure that the user has not already been logged on
> before displaying the form would be nice.
>
> It is imperative that all cache is flushed and the page has a meta
parameter
> for nocache.
>
> The last option is ordinarily okay to re-execute itself in case it is
> neither a login nor a logoff nor a form display.
>
> fgets($fp) is valid for PHP version > 4.2
> If you are using a lower version, then it will have to be replaced with:-
> fgets($fp,4096)
>
> Hope the above helps.
>
> Regards,
> Ap.Muthu
>
>
> > From: "XeloQ Comms"
> >15 April 2004 03:30
> > Subject: from venezuela
>
>
> > Hi Ap, You as a fanatic w32 user I would like to know if you tried that
> ACD
> > tool on the windows platform. Especially the php script. I think the
tool
> > has some bugs but I wonder if I am doing something absolutely wrong
that's
> > causing it.
> >
> > Kindest regards,
> >
> > Tjapko.
>
>



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click

_______________________________________________________

List: Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_id=8549
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux