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

2009-02-11 Thread php-general-digest-help

php-general Digest 12 Feb 2009 00:42:51 - 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


--
---BeginMessage---

'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---
---BeginMessage---
On Tue, Feb 10, 2009 at 10:11 PM, Nathan Nobbe quickshif...@gmail.comwrote:

 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---
---BeginMessage---
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---
---BeginMessage---
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 

[PHP] Help on caching an object.

2009-02-11 Thread Yeti
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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: APC problem with PHP

2009-02-11 Thread Colin Guthrie

'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/]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help on caching an object.

2009-02-11 Thread Stuart
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/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] (Perl) Regular Expressions - oposite match or get the non-matches of a substring

2009-02-11 Thread Per Jessen
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)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help on caching an object.

2009-02-11 Thread Stuart
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/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] (Perl) Regular Expressions - oposite match or get the non-matches of a substring

2009-02-11 Thread Virgilio Quilario
 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sprintf thousand separator.

2009-02-11 Thread chris smith
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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Help on caching an object.

2009-02-11 Thread Virgilio Quilario
 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sprintf thousand separator.

2009-02-11 Thread Jo�o C�ndido de Souza Neto
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/ 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sprintf thousand separator.

2009-02-11 Thread Per Jessen
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)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Module Structure ideas

2009-02-11 Thread Virgilio Quilario
 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sprintf thousand separator.

2009-02-11 Thread Richard Heyes
 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



Re: [PHP] sprintf thousand separator.

2009-02-11 Thread Jo�o C�ndido de Souza Neto
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



Re: [PHP] sprintf thousand separator.

2009-02-11 Thread Bruno Fajardo
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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] sprintf thousand separator.

2009-02-11 Thread Jo�o C�ndido de Souza Neto
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
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] APC problem with PHP

2009-02-11 Thread APseudoUtopia
On Tue, Feb 10, 2009 at 10:11 PM, Nathan Nobbe quickshif...@gmail.comwrote:

 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.


[PHP] webapp to drive/monitor a bunch of system processes

2009-02-11 Thread bruce
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!!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: webapp to drive/monitor a bunch of system processes

2009-02-11 Thread Shawn McKenzie
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] php.ini not loaded?

2009-02-11 Thread brian

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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Looking for some PHP OO programming guides

2009-02-11 Thread Yannick Mortier
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php.ini not loaded?

2009-02-11 Thread Nathan Nobbe
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


Re: [PHP] Re: Looking for some PHP OO programming guides

2009-02-11 Thread Christoph Boget
  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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using DLL with PHP

2009-02-11 Thread Dan Shirah
 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?


Re: [PHP] php.ini not loaded?

2009-02-11 Thread brian

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



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using DLL with PHP

2009-02-11 Thread Andrew Ballard
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Module Structure ideas

2009-02-11 Thread Ashley Sheridan
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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Best way to post XML via curl?

2009-02-11 Thread Brian Dunning
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?


:-(


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Best way to post XML via curl?

2009-02-11 Thread Brian Dunning

Just realized I didn't happen to mention the problem.   :-)

The server is not seeing any of my posted fields. It's returning a  
properly-formatted XML response that says I did not submit the  
required fields. Unfortunately the server is a black box, but lots of  
other partners use it every day and supposedly there are no problems  
server side.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Best way to post XML via curl?

2009-02-11 Thread Stuart
2009/2/12 Brian Dunning br...@briandunning.com:
 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));

Drop the above line and I reckon it should work. The content you're
sending is not XML, it's form fields which CURL will default to. It
just happens that one of those fields is 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?

-Stuart

-- 
http://stut.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Best way to post XML via curl?

2009-02-11 Thread Brian Dunning
This line is the key. WITH the line, I get a properly formatted XML  
response from the server, telling me that I did not send any valid  
post fields. WITHOUT the line, all I get back from the server is a '1'  
and their tech reports that no valid call was received from me.



On Feb 11, 2009, at 4:56 PM, Stuart wrote:

curl_setopt($ch, CURLOPT_HTTPHEADER, array(Content-Type: text/ 
xml));


Drop the above line and I reckon it should work. The content you're
sending is not XML, it's form fields which CURL will default to. It
just happens that one of those fields is XML.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Best way to post XML via curl?

2009-02-11 Thread Stuart
2009/2/12 Brian Dunning br...@briandunning.com:
 This line is the key. WITH the line, I get a properly formatted XML response
 from the server, telling me that I did not send any valid post fields.
 WITHOUT the line, all I get back from the server is a '1' and their tech
 reports that no valid call was received from me.

In that case you're not sending them what they're asking for. Are the
method, login and password fields supposed to be separate or should
they be included in the xml? At the moment they're separate so when
you tell the server it's in XML format you're lying because only part
of it is.

As a test try setting $postArgs = $xml. If I'm right it might either
work or give you and authentication error.

-Stuart

 On Feb 11, 2009, at 4:56 PM, Stuart wrote:

 curl_setopt($ch, CURLOPT_HTTPHEADER, array(Content-Type: text/xml));

 Drop the above line and I reckon it should work. The content you're
 sending is not XML, it's form fields which CURL will default to. It
 just happens that one of those fields is XML.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
http://stut.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Best way to post XML via curl?

2009-02-11 Thread Brian Dunning

From the documentation:

Parameters
The following POST parameters are required:
login - Assigned
password - Assigned
method - newPrintRequest, updatePrintRequest, reprintRequest
orderxml - XML according to accompanying documentation

The error that I get says no method was provided, and if you look at  
my code, it clearly is.



On Feb 11, 2009, at 5:08 PM, Stuart wrote:


2009/2/12 Brian Dunning br...@briandunning.com:
This line is the key. WITH the line, I get a properly formatted XML  
response
from the server, telling me that I did not send any valid post  
fields.
WITHOUT the line, all I get back from the server is a '1' and their  
tech

reports that no valid call was received from me.


In that case you're not sending them what they're asking for. Are the
method, login and password fields supposed to be separate or should
they be included in the xml? At the moment they're separate so when
you tell the server it's in XML format you're lying because only part
of it is.

As a test try setting $postArgs = $xml. If I'm right it might either
work or give you and authentication error.

-Stuart


On Feb 11, 2009, at 4:56 PM, Stuart wrote:

curl_setopt($ch, CURLOPT_HTTPHEADER, array(Content-Type: text/ 
xml));


Drop the above line and I reckon it should work. The content you're
sending is not XML, it's form fields which CURL will default to. It
just happens that one of those fields is XML.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
http://stut.net/



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Best way to post XML via curl?

2009-02-11 Thread Stuart
2009/2/12 Brian Dunning br...@briandunning.com:
 From the documentation:

 Parameters
 The following POST parameters are required:
 login - Assigned
 password - Assigned
 method - newPrintRequest, updatePrintRequest, reprintRequest
 orderxml - XML according to accompanying documentation

 The error that I get says no method was provided, and if you look at my
 code, it clearly is.

The original code you had, minus the Content-Type header will do
exactly that. Either the documentation is wrong or there's something
wrong with their system.

I suggest you create an HTML file containing a form with those fields
that posts to the destination URL, fill it in with valid values and
see what happens when you post that. Remove CURL from the equation,
and if that doesn't work go back to them and show them that form and
the response you get, because according to that documentation it
should work.

-Stuart

 On Feb 11, 2009, at 5:08 PM, Stuart wrote:

 2009/2/12 Brian Dunning br...@briandunning.com:

 This line is the key. WITH the line, I get a properly formatted XML
 response
 from the server, telling me that I did not send any valid post fields.
 WITHOUT the line, all I get back from the server is a '1' and their tech
 reports that no valid call was received from me.

 In that case you're not sending them what they're asking for. Are the
 method, login and password fields supposed to be separate or should
 they be included in the xml? At the moment they're separate so when
 you tell the server it's in XML format you're lying because only part
 of it is.

 As a test try setting $postArgs = $xml. If I'm right it might either
 work or give you and authentication error.

 -Stuart

 On Feb 11, 2009, at 4:56 PM, Stuart wrote:

 curl_setopt($ch, CURLOPT_HTTPHEADER, array(Content-Type: text/xml));

 Drop the above line and I reckon it should work. The content you're
 sending is not XML, it's form fields which CURL will default to. It
 just happens that one of those fields is XML.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

 --
 http://stut.net/


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
http://stut.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Seeking PHP Work in Chicago or Telecommute

2009-02-11 Thread Daniel Brown
On Sat, Feb 7, 2009 at 23:37, Richard Lynch c...@l-i-e.com wrote:
 I figure if job postings are okay, then so are job requests, right? :-)

 I'm looking for PHP work in Chicago or telecommuting.

 My resume is here:
 http://l-i-e.com/resume.htm

I will certainly vouch for Richard's experience to perspective
employers.  If I could convince him to work for a price I could
afford, I'd hire him on the spot but rumor has it, he likes having
a roof over his head.

Nonetheless, a great programmer and a good egg.  Whomever hires
him will be exceedingly happy with the decision.

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php