php-general Digest 12 Feb 2009 00:42:51 -0000 Issue 5953

Topics (messages 288107 through 288133):

Re: APC problem with PHP
        288107 by: Colin Guthrie
        288122 by: APseudoUtopia

Re: Help on caching an object.
        288108 by: Stuart
        288110 by: Stuart
        288114 by: Virgilio Quilario

Re: (Perl) Regular Expressions - oposite match or get the non-matches of  a 
substring
        288109 by: Per Jessen
        288111 by: Virgilio Quilario

sprintf thousand separator.
        288112 by: João Cândido de Souza Neto
        288113 by: chris smith
        288115 by: João Cândido de Souza Neto
        288116 by: Per Jessen
        288118 by: Richard Heyes
        288119 by: João Cândido de Souza Neto
        288120 by: Bruno Fajardo
        288121 by: João Cândido de Souza Neto

Re: Module Structure ideas
        288117 by: Virgilio Quilario
        288132 by: Ashley Sheridan

webapp to drive/monitor a bunch of system processes
        288123 by: bruce
        288124 by: Shawn McKenzie

php.ini not loaded?
        288125 by: brian
        288127 by: Nathan Nobbe
        288130 by: brian

Re: Looking for some PHP OO programming guides
        288126 by: Yannick Mortier
        288128 by: Christoph Boget

Re: Using DLL with PHP
        288129 by: Dan Shirah
        288131 by: Andrew Ballard

Best way to post XML via curl?
        288133 by: Brian Dunning

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
'Twas brillig, and Nathan Nobbe at 11/02/09 00:10 did gyre and gimble:
a lot of php extensions are not thread safe, perhaps apc is one of them.
most people compile apache w/ mpm_prefork rather than mpm_worker for this
reason.

I know the problem is solved now but I think APC is pretty solid threading wise. It has various locking mechanisms that you can compile in to APC, including filelocks, IPC semaphores, spinlocks and pthread mutexes.

So while I don't want to comment inaccurately, I suspect that APC is pretty solid in this area.

Col

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


--- End Message ---
--- Begin Message ---
On Tue, Feb 10, 2009 at 10:11 PM, Nathan Nobbe <quickshif...@gmail.com>wrote:

> On Tue, Feb 10, 2009 at 5:53 PM, Jamie Krasnoo <jkras...@gmail.com> wrote:
>
> > Hmm, I'll try taking down the optimizer and seeing if it segfaults or
> > not. If that's what it is it's a crying shame that apc and
> > zend_optimizer can't get along.
>
>
> maybe give eaccelerator a shot, i believe theyve got an optimizer in there.
> im not sure how it stacks up to zend's, but it will do both caching and
> optimization, afaik.  also, you will find a not yet stable optimization
> extension haging out in pecl for apc,
>
> http://pecl.php.net/package/optimizer
>
> -nathan
>

I'd recommend using X-Cache. I've had nothing but good experiences with it.

--- End Message ---
--- Begin Message ---
2009/2/11 Yeti <y...@myhich.com>:
> Hello gang,
>
> First of all, yes I searched the mailing list's archive.
>
> My problem is very simple:
> I have an object that's definately called with every page request.
> It's pretty much the same for every unregistered/anonymous user.
> And it's not small. Alot of attributes are being set from DB queries etc.
>
> Now my idea was to do some sort of caching with PHP to speed things up.
> So I was wondering if anybody had experiences on this ...
>
> Of course, I considered using serialize(), but it seemed to me as if
> it could cause even more lagging since PHP requires the class to
> unserialize the object correctly. Then I would end up reading the
> class file, reading the searialized object and unserializing it. A 100
> simple DB queries might be done in the same time or at least not much
> slower.
>
> Could it be that I'm looking at the wrong place? Should it be more
> like caching the queries or something similar?
>
> Thank you very much for everyone's effort in advance.

I suggest you look at memcached - it's an in-memory volatile cache
that performs extremely well. APC has a similar feature but I've never
used it.

Also, are you guestimating the performance of DB queries against a
serialised file? Do some tests and you might be surprised at how
quickly PHP can unserialise data.

-Stuart

-- 
http://stut.net/

--- End Message ---
--- Begin Message ---
Emailing me directly is not cheap, please don't do it again without
expecting an invoice.

2009/2/11 faisal murad <faisalsa...@gmail.com>:
> how can i unsubscribe from php list.

It's really difficult. You follow the instructions shown at the end of
each frickin' email!!

>> To unsubscribe, visit: http://www.php.net/unsub.php

Yup, that's really hard!!

-Stuart

-- 
http://stut.net/

--- End Message ---
--- Begin Message ---
> My problem is very simple:
> I have an object that's definately called with every page request.
> It's pretty much the same for every unregistered/anonymous user.
> And it's not small. Alot of attributes are being set from DB queries etc.
>
> Now my idea was to do some sort of caching with PHP to speed things up.
> So I was wondering if anybody had experiences on this ...
>
> Of course, I considered using serialize(), but it seemed to me as if
> it could cause even more lagging since PHP requires the class to
> unserialize the object correctly. Then I would end up reading the
> class file, reading the searialized object and unserializing it. A 100
> simple DB queries might be done in the same time or at least not much
> slower.
>
> Could it be that I'm looking at the wrong place? Should it be more
> like caching the queries or something similar?
>
> Thank you very much for everyone's effort in advance.
>

>

serialize is much faster than getting data from database.
i use this approach to unload DB usage and it made big difference.
it would be much more faster if serialized object is saved onto ram
using xcache or similar.

Virgil
http://www.jampmark.com

--- End Message ---
--- Begin Message ---
German Geek wrote:

> I consider myself quite good with Regular Expression, but i could
> never find out how to match something like:
> 
> "match this but not this and that"
> 
> so i would like to match the first "match this" (or "another this")
> but not "not this".
> 
> Seems pretty straight forward but i haven't found a (good) solution
> yet. 

Check out "look-around" (-behind, -ahead), here for instance:

http://www.regular-expressions.info/refadv.html

> Surprisingly i couldn't figure out how to say '/!(not) this/'. Seems

!/this/  


/Per

-- 
Per Jessen, Zürich (0.4°C)


--- End Message ---
--- Begin Message ---
> Hi all,
>
> I consider myself quite good with Regular Expression, but i could never find
> out how to match something like:
>
> "match this but not this and that"
>
> so i would like to match the first "match this" (or "another this") but not
> "not this".
>
> Seems pretty straight forward but i haven't found a (good) solution yet.
> Please no solutions with extra code, i know how to do that. I need a regular
> expression that can do it, preferably Perl compatible. Surprisingly i
> couldn't figure out how to say '/!(not) this/'. Seems like there must be a
> simple way, but i can't seem to figure it out.
>
> Tried things like: '/[^n][^o][^t] this/', '/[^not]{3} this/' etc but all of
> those don't work. Looked in various books and websites but didn't find what
> i was looking for...
>


try this

/match this but (?!not this and that)/

goodluck!

Virgil
http://www.jampmark.com

--- End Message ---
--- Begin Message ---
Hello everybody.

I´d just like to know if there´s any way of defining a thousand separator to
a currency value using sprintf.

Thanks in advance. 



--- End Message ---
--- Begin Message ---
2009/2/11 João Cândido de Souza Neto <j...@consultorweb.cnt.br>:
> Hello everybody.
>
> I´d just like to know if there´s any way of defining a thousand separator to
> a currency value using sprintf.

Use number_format instead of sprintf, it's designed to do what you want.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Chris,

Thanks for your answer, but my real problem is to get thousand separator in 
jpgraph class which uses sprintf to display almost everithing;


"chris smith" <dmag...@gmail.com> escreveu na mensagem 
news:3c1395330902110457i18cec69cy9818e08cdd3ff...@mail.gmail.com...
2009/2/11 João Cândido de Souza Neto <j...@consultorweb.cnt.br>:
> Hello everybody.
>
> I´d just like to know if there´s any way of defining a thousand separator 
> to
> a currency value using sprintf.

Use number_format instead of sprintf, it's designed to do what you want.

-- 
Postgresql & php tutorials
http://www.designmagick.com/ 



--- End Message ---
--- Begin Message ---
chris smith wrote:

> 2009/2/11 João Cândido de Souza Neto <j...@consultorweb.cnt.br>:
>> Hello everybody.
>>
>> I´d just like to know if there´s any way of defining a thousand
>> separator to a currency value using sprintf.
> 
> Use number_format instead of sprintf, it's designed to do what you
> want.
> 

I wonder why number_format() isn't locale sensitive?  


/Per

-- 
Per Jessen, Zürich (2.4°C)


--- End Message ---
--- Begin Message ---
> Thanks for your answer, but my real problem is to get thousand separator in
> jpgraph class which uses sprintf to display almost everithing;

Can you format it first, and then pass it to JPGraph ?

-- 
Richard Heyes

HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.org (Updated January 31st)

--- End Message ---
--- Begin Message ---
No, I can´t, because if I do it how can jpgrhph render without numeric data? 
hehehe

"Richard Heyes" <rich...@php.net> escreveu na mensagem 
news:af8726440902110523x63ce5485p6534d10063eb4...@mail.gmail.com...
>> Thanks for your answer, but my real problem is to get thousand separator 
>> in
>> jpgraph class which uses sprintf to display almost everithing;
>
> Can you format it first, and then pass it to JPGraph ?
>
> -- 
> Richard Heyes
>
> HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
> http://www.rgraph.org (Updated January 31st) 



--- End Message ---
--- Begin Message ---
Can you extend the JPGraph class, intercepting the desired method,
formatting the output the way you need?

2009/2/11 João Cândido de Souza Neto <j...@consultorweb.cnt.br>
>
> No, I can´t, because if I do it how can jpgrhph render without numeric data?
> hehehe
>
> "Richard Heyes" <rich...@php.net> escreveu na mensagem
> news:af8726440902110523x63ce5485p6534d10063eb4...@mail.gmail.com...
> >> Thanks for your answer, but my real problem is to get thousand separator
> >> in
> >> jpgraph class which uses sprintf to display almost everithing;
> >
> > Can you format it first, and then pass it to JPGraph ?
> >
> > --
> > Richard Heyes
> >
> > HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
> > http://www.rgraph.org (Updated January 31st)
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Ok, thanks.

I´ll try to do it.

As soon as I get it I´ll let you know.

Thanks guys.

"Bruno Fajardo" <bsfaja...@gmail.com> escreveu na mensagem 
news:eeb6980b0902110534p22a8c75eqd98cceaf3a150...@mail.gmail.com...
Can you extend the JPGraph class, intercepting the desired method,
formatting the output the way you need?

2009/2/11 João Cândido de Souza Neto <j...@consultorweb.cnt.br>
>
> No, I can´t, because if I do it how can jpgrhph render without numeric 
> data?
> hehehe
>
> "Richard Heyes" <rich...@php.net> escreveu na mensagem
> news:af8726440902110523x63ce5485p6534d10063eb4...@mail.gmail.com...
> >> Thanks for your answer, but my real problem is to get thousand 
> >> separator
> >> in
> >> jpgraph class which uses sprintf to display almost everithing;
> >
> > Can you format it first, and then pass it to JPGraph ?
> >
> > --
> > Richard Heyes
> >
> > HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
> > http://www.rgraph.org (Updated January 31st)
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



--- End Message ---
--- Begin Message ---
> Last year I began to sepearte my module files to many files for their
> purposes.
>
> Last time use use lots of dirs for their types
>
> someting like
>
> controllers
>  a.cont.php
>  b.cont.php
> definition
>  a.def.php
>  b.def.php
> models
>  a.model.php
>  b.model.php
> views
>  a.view.php
>  b.view.php
>
> Then I realize this model creates confusion when you start to debug a module.
>
> My next step was putting module files in one dir,
> also I want to load them into text editor with spesific order
> (same to including order).
>
> and I came up some ting like this
>
> a.test.def.php
> c.test.mdl.php
> e.test.cnt.php
> g.test.rtr.php
> i.test.view.php
> k.test.dr.js
> m.test.m.js
> o.test.css
>
> test_app.a.def.php
> test_app.c.mdl.php
> test_app.e.cnt.php
> test_app.g.rtr.php
> test_app.i.view.php
> test_app.k.dr.js
> test_app.m.js
> test_app.o.css
>
> test.adef.php
> test.cmdl.php
> test.ecnt.php
> test.grtr.php
> test.iview.php
> test.kdr.js
> test.m.js
> test.o.css
>
> My point of view the 3. option is good for me.
>
> So I want to ask  this
>
> (beacause I'm using very closed working model. Just KDE and KATE)
>
> is kind of file structure may lead any kind of problems in future or
> diffrerent situation ?
>
> also is there any suggestion to using different methot to archive similar
> goals.
>

option #3 works for me too small projects without using frameworks.
for big projects, i prefer to organize my script files by type:
/models
/controllers
/views

i don't have problems with jumping around folder to folder because i
keep files open in separate windows.

Virgil
http://www.jampmark.com

--- End Message ---
--- Begin Message ---
On Wed, 2009-02-11 at 21:20 +0800, Virgilio Quilario wrote:
> > Last year I began to sepearte my module files to many files for their
> > purposes.
> >
> > Last time use use lots of dirs for their types
> >
> > someting like
> >
> > controllers
> >  a.cont.php
> >  b.cont.php
> > definition
> >  a.def.php
> >  b.def.php
> > models
> >  a.model.php
> >  b.model.php
> > views
> >  a.view.php
> >  b.view.php
> >
> > Then I realize this model creates confusion when you start to debug a 
> > module.
> >
> > My next step was putting module files in one dir,
> > also I want to load them into text editor with spesific order
> > (same to including order).
> >
> > and I came up some ting like this
> >
> > a.test.def.php
> > c.test.mdl.php
> > e.test.cnt.php
> > g.test.rtr.php
> > i.test.view.php
> > k.test.dr.js
> > m.test.m.js
> > o.test.css
> >
> > test_app.a.def.php
> > test_app.c.mdl.php
> > test_app.e.cnt.php
> > test_app.g.rtr.php
> > test_app.i.view.php
> > test_app.k.dr.js
> > test_app.m.js
> > test_app.o.css
> >
> > test.adef.php
> > test.cmdl.php
> > test.ecnt.php
> > test.grtr.php
> > test.iview.php
> > test.kdr.js
> > test.m.js
> > test.o.css
> >
> > My point of view the 3. option is good for me.
> >
> > So I want to ask  this
> >
> > (beacause I'm using very closed working model. Just KDE and KATE)
> >
> > is kind of file structure may lead any kind of problems in future or
> > diffrerent situation ?
> >
> > also is there any suggestion to using different methot to archive similar
> > goals.
> >
> 
> option #3 works for me too small projects without using frameworks.
> for big projects, i prefer to organize my script files by type:
> /models
> /controllers
> /views
> 
> i don't have problems with jumping around folder to folder because i
> keep files open in separate windows.
> 
> Virgil
> http://www.jampmark.com
> 
Number 3 looks good. but I would tend to keep .js and .css files in
their own directories respectively, as for most projects, I'll have lots
of different .js files for differents tasks, and several .css files
(screen, print, internet explorer, etc.) It makes it a lot easier for
me, as usually (unless I'm doing AJAX work) the php and javascript won't
overlap, and css is almost always completely separate.


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
hi...

i've got a project (goal) where i'm looking for a webbased app that
drives/runs/monitors different linux/system processes. i'm basically looking
for different apps that i can look at to get ideas/see their
layout/structure. i'm going to have to create a similar app to run some
processes that i'm dealing with.

i'm currently looking/searchin sourceforge.net/freshmeat/etc.. but i thought
i'd fire off the question here as well, in case someone has an app that
they're aware of that you can pass on to me..

my overall/ultimate goal is going to be to interface with underlying
database/tbls, to drive processes on a distributed network of machines that
i'm putting together... so i'm going to need to be able to to
monitor/start/stop a number of different apps that i create. i'm also
looking to be able to see past history of the apps that have been run using
the webapp...

but for now, any app that i can find that allows a user to manage/start/stop
different processes on a server/network would be useful.. (already looked at
nagios!)

thanks!!




--- End Message ---
--- Begin Message ---
bruce wrote:
> hi...
> 
> i've got a project (goal) where i'm looking for a webbased app that
> drives/runs/monitors different linux/system processes. i'm basically looking
> for different apps that i can look at to get ideas/see their
> layout/structure. i'm going to have to create a similar app to run some
> processes that i'm dealing with.
> 
> i'm currently looking/searchin sourceforge.net/freshmeat/etc.. but i thought
> i'd fire off the question here as well, in case someone has an app that
> they're aware of that you can pass on to me..
> 
> my overall/ultimate goal is going to be to interface with underlying
> database/tbls, to drive processes on a distributed network of machines that
> i'm putting together... so i'm going to need to be able to to
> monitor/start/stop a number of different apps that i create. i'm also
> looking to be able to see past history of the apps that have been run using
> the webapp...
> 
> but for now, any app that i can find that allows a user to manage/start/stop
> different processes on a server/network would be useful.. (already looked at
> nagios!)
> 
> thanks!!
> 
> 
> 
Have you looked at webmin?  I haven't used it in a while but it ties in
a lot of monitoring/control/config of the machine and I assume you could
easily develop plugins for it.


-- 
Thanks!
-Shawn
http://www.spidean.com

--- End Message ---
--- Begin Message ---
with php.ini in /apps/local/php5/lib, readable by all:

phpinfo says     : "configuration file path /apps/local/php5/lib"
phpinfo also says: "loaded configuration file: (none)"

.... so i'm not getting anything from php.ini.  

can someone point me at the fix for this problem?

thanks in advance
b


--- End Message ---
--- Begin Message ---
On Wed, Feb 11, 2009 at 9:54 AM, brian <brian.l...@vt.edu> wrote:

>
> with php.ini in /apps/local/php5/lib, readable by all:
>
> phpinfo says     : "configuration file path /apps/local/php5/lib"
> phpinfo also says: "loaded configuration file: (none)"
>
> .... so i'm not getting anything from php.ini.
>
> can someone point me at the fix for this problem?


webserver or cli?  if cli, take a peak at

php --ini

also, /apps/local/php5/lib should have rx for the webserver user.

you may also need to check the perms on /apps/local/php5 to ensure the
webserver user has rx on that dir as well.

-nathan

--- End Message ---
--- Begin Message ---
hi nathan thanks for the response...

it's webserver.  so the phpinfo() result in the browser should be accurate.

looks like the rx is where it should be.



Nathan Nobbe wrote:
> On Wed, Feb 11, 2009 at 9:54 AM, brian <brian.l...@vt.edu
> <mailto:brian.l...@vt.edu>> wrote:
>
>
>     with php.ini in /apps/local/php5/lib, readable by all:
>
>     phpinfo says     : "configuration file path /apps/local/php5/lib"
>     phpinfo also says: "loaded configuration file: (none)"
>
>     .... so i'm not getting anything from php.ini.
>
>     can someone point me at the fix for this problem?
>
>
> webserver or cli?  if cli, take a peak at
>
> php --ini
>
> also, /apps/local/php5/lib should have rx for the webserver user.
>
> you may also need to check the perms on /apps/local/php5 to ensure the
> webserver user has rx on that dir as well.
>
> -nathan
>


--- End Message ---
--- Begin Message ---
2009/2/11 German Geek <geek...@gmail.com>:
> I try to avoid nesting loops altogether if possible. Usually dont go beyond
> 3 levels of nesting...
> How can you require 8 levels of nesting? surely there must be something
> wrong or a more efficient algorithm...
>

No! It's just that you can't think in 8 dimensions like him.



-- 
Currently developing a browsergame...
http://www.p-game.de
Trade - Expand - Fight

Follow me at twitter!
http://twitter.com/moortier

--- End Message ---
--- Begin Message ---
> > How can you require 8 levels of nesting? surely there must be something
> > wrong or a more efficient algorithm...
> No! It's just that you can't think in 8 dimensions like him.

Yeah, at that point you are dealing with space and time and that's not a
subject of contemplation for everyone. :p

thnx,
Christoph


--- End Message ---
--- Begin Message ---
 MAYBE a little closer to a solution!

//VB for Reference
Private Declare Function DTM_CONVDMSToMultiTIFF Lib "D32_CONV.DLL" _
            (ByVal FullPathFrom As String, ByVal FullPathTo As String) As
Integer

Public Function hello(ByVal name As String) As String

    hello = "Hello" & name & "World!"
End Function
Public Function DMStoTIFFconv(ByVal FullPathFrom As String, ByVal FullPathTo
As String) As String
    Dim DMSconv As Integer
    DMSconv = DTM_CONVDMSToMultiTIFF(FullPathFrom, FullPathTo)
End Function
//PHP Code
<?php
function Hello() {
$new_com = new COM("DMStoTIFF.conv");
$output=$new_com->hello('Happy'); // Call the "hello()" method
echo $output; // Displays Hello World! (so this comes from the dll!)
$convert=$new_com->DMStoTIFFconv('C:\\TEST\\04186177.dms','C:\\TEST\04186177.tif');
}
Hello();
?>

So, previously I was having issues calling the D32_CONV.DLL...
I "think" I am past that now.

If I comment out
$convert=$new_com->DMStoTIFFconv('C:\\TEST\\04186177.dms','C:\\TEST\04186177.tif');
the "Hello Happy World" text prints to the screen no problem.

But when I try to access the VB to call the actual DTM_CONVDMSToMultiTIFF
function I am getting one of two errors. I am either timing out, or getting
a message saying incomplete headers.

The D32_CONV.DLL file is a conversion library that will convert a file from
DMS format to TIF based on two parameters. Since this function is converting
a document, do you think my problem is trying to assign that to the $convert
variable instead of a file output location?

--- End Message ---
--- Begin Message ---
On Wed, Feb 11, 2009 at 1:18 PM, Dan Shirah <mrsqua...@gmail.com> wrote:
>  MAYBE a little closer to a solution!
>
> //VB for Reference
> Private Declare Function DTM_CONVDMSToMultiTIFF Lib "D32_CONV.DLL" _
>            (ByVal FullPathFrom As String, ByVal FullPathTo As String) As
> Integer
>
> Public Function hello(ByVal name As String) As String
>
>    hello = "Hello" & name & "World!"
> End Function
> Public Function DMStoTIFFconv(ByVal FullPathFrom As String, ByVal FullPathTo
> As String) As String
>    Dim DMSconv As Integer
>    DMSconv = DTM_CONVDMSToMultiTIFF(FullPathFrom, FullPathTo)
> End Function
> //PHP Code
> <?php
> function Hello() {
> $new_com = new COM("DMStoTIFF.conv");
> $output=$new_com->hello('Happy'); // Call the "hello()" method
> echo $output; // Displays Hello World! (so this comes from the dll!)
> $convert=$new_com->DMStoTIFFconv('C:\\TEST\\04186177.dms','C:\\TEST\04186177.tif');
> }
> Hello();
> ?>
>
> So, previously I was having issues calling the D32_CONV.DLL...
> I "think" I am past that now.
>
> If I comment out
> $convert=$new_com->DMStoTIFFconv('C:\\TEST\\04186177.dms','C:\\TEST\04186177.tif');
> the "Hello Happy World" text prints to the screen no problem.
>
> But when I try to access the VB to call the actual DTM_CONVDMSToMultiTIFF
> function I am getting one of two errors. I am either timing out, or getting
> a message saying incomplete headers.
>
> The D32_CONV.DLL file is a conversion library that will convert a file from
> DMS format to TIF based on two parameters. Since this function is converting
> a document, do you think my problem is trying to assign that to the $convert
> variable instead of a file output location?
>

I wouldn't think it should matter much, but I notice you've got your
VB function declared to return a String, and never give it a value.
Shouldn't it just return the Integer value that the internal function
call is returning?

' VB Function
Public Function DMStoTIFFconv(ByVal FullPathFrom As String, ByVal FullPathTo
As String) As Integer
   DMStoTIFFconv = DTM_CONVDMSToMultiTIFF(FullPathFrom, FullPathTo)
End Function

Also, I'm wondering whether the double-slashes are getting passed into
the object method rather than being treated as escape characters. You
might try passing one of those values to your Hello() method to make
sure they are going into your class correctly.

This also doesn't begin to delve into whether the COM object uses the
same security context as PHP. I would think so, but that's just a
guess.

Andrew

--- End Message ---
--- Begin Message --- I'm going crazy, can't quite get this encoding to work. I've tried all the various combinations, trying to send this block $xml (which is a simple string variable) via post along with 3 other params:

$postArgs = http_build_query(array('method'=>'newPrintRequest', 'login'=>$login, 'password'=>$password, 'orderxml'=>$xml));
$ch = curl_init('http://test.server.com/rest_interface.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postArgs);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
$response = curl_exec($ch);

Is this use of http_build_query the best way to send XML? Any other curl options I should be setting? I tried urlencoding() the $xml, I tried htmlspecialchars(), I tried nothing at all, I tried &amp and &.... is there a "best practice" for how a big block of xml should be posted?

:-(


--- End Message ---

Reply via email to