[PHP] Reference or copy?

2008-07-23 Thread Yeti
Hello everyone, Many of you may be familiar with references in PHP. Now i read somewhere in the PHP manual that creating references can take longer than copies. PHP5+ also seems to reference a bit different thant PHP4 did. Here is some working example code: huge_array = array(); f

Re: [PHP] Reference or copy?

2008-07-23 Thread Robert Cummings
On Wed, 2008-07-23 at 10:07 +0200, Yeti wrote: > Hello everyone, > > Many of you may be familiar with references in PHP. Now i read > somewhere in the PHP manual that creating references can take longer > than copies. PHP5+ also seems to reference a bit different thant PHP4 > did. > Here is some w

Re: [PHP] Reference or copy?

2008-07-23 Thread Ted Wood
The general rules of thumb are --> don't use references unless you actually *want* a reference. And don't use references for performance reasons. Under PHP 4, it's generally been recommended to use a reference operator when creating objects. $obj =& new Object(); PHP uses refe

Re: [PHP] Reference or copy?

2008-07-23 Thread Ted Wood
On 23-Jul-08, at 1:19 AM, Ted Wood wrote: So PHP waits until a copy is actually needed before it makes one. Explicitly making copies incurs overhead because of the concept of "reference counting". So again, don't use references for performance reasons. That should've been: Explicitly

[PHP] Getting info from SVN commit with php

2008-07-23 Thread Raido
Hi, I would be very grateful if someone could point out some ways how to do the following: I have an SVN server but I need to add some extra to commit message which PHP will get and use(for example use the parameters from commit message to change data on mysql database... (if commit message

Re: [PHP] Getting info from SVN commit with php

2008-07-23 Thread mike
On 7/23/08, Raido <[EMAIL PROTECTED]> wrote: > I have an SVN server but I need to add some extra to commit message which > PHP will get and use(for example use the parameters from commit message to > change data on mysql database... (if commit messages first line has > character *, then run sql q

[PHP] Questions about finding ranges

2008-07-23 Thread Aslan
Hey there, I have a range of records that represent different faults and different symptoms that I want to pull out of the database, and to find the records that are the closest within each range. I am currently doing it with a barrage of if statements, but I am sure that this could be done

Re: [PHP] Getting info from SVN commit with php

2008-07-23 Thread Raido
Thank You for that fast reply. PECL was something that I din't know about. But I'll dig in with Your examples and also PECL and try to find most simple but well-working solution. Also sorry for Return Receipt, turned that off. mike wrote: On 7/23/08, Raido <[EMAIL PROTECTED]> wrote: I

Re: [PHP] Questions about finding ranges

2008-07-23 Thread Jim Lucas
Aslan wrote: Hey there, I have a range of records that represent different faults and different symptoms that I want to pull out of the database, and to find the records that are the closest within each range. I am currently doing it with a barrage of if statements, but I am sure that this

[PHP] Apache blocking certain requests instead of php

2008-07-23 Thread Arno Kuhl
I'm getting a lot of bogus requsts in the form of "index.php?id=http://64.15.67.17/~babysona/logo.jpg?";, sometimes more than a hundred a day per domain. The php script catches it, logs the request, sends an email report and replies with "access denied", but it takes processing which I'd rather not

Re: [PHP] Getting info from SVN commit with php

2008-07-23 Thread Daniel Brown
On Wed, Jul 23, 2008 at 8:22 AM, Raido <[EMAIL PROTECTED]> wrote: > > 1) Is it even possible to get commit messages text with php ? Since I can't > find the file where commit messages are. Just a quick answer to this: in your directory of your project repo, go into the hooks/ subdirectory. In

[PHP] Re: a question...

2008-07-23 Thread Daniel Brown
On Wed, Jul 23, 2008 at 12:10 PM, <[EMAIL PROTECTED]> wrote: > Yes, sorry. I have a database that records ip of attacks on a customer > server, what I like to do get a count so that I can see what subnet is > doing the major of the attacks. > > select ip from ipslimit 10; > +-+

Re: [PHP] Apache blocking certain requests instead of php

2008-07-23 Thread Per Jessen
Arno Kuhl wrote: > Is there a > way for apache to catch these requests before passing it to php? Is it > more efficient for apache to handle this than php? 2 x yes. I think you could probably use and ban all access with "Deny from all". /Per Jessen, Zürich -- PHP General Mailing List (http:

Re: [PHP] Re: a question...

2008-07-23 Thread Micah Gersten
I just want to point out that public IPs are no longer given out as Class A, B, and C networks, but based on CIDR. You can use rwhois to figure out who has use of a certain subnet and what the range of it is. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com D

Re: [PHP] Reference or copy?

2008-07-23 Thread Robert Cummings
On Wed, 2008-07-23 at 01:21 -0700, Ted Wood wrote: > On 23-Jul-08, at 1:19 AM, Ted Wood wrote: > > > > So PHP waits until a copy is actually needed before it makes one. > > Explicitly making copies incurs overhead because of the concept of > > "reference counting". So again, don't use reference

[PHP] Multi-array - What am I missing?

2008-07-23 Thread Chris Ditty
Can anyone point me in the right direction? I know I am missing something simple, but I can't place my hands on it. $myCalTime = act_getCalendarDays($config, $myMonth, $myYear); foreach($myCalTime as $calTime => $calArrayTime){ $calArray[] = $calArrayTime['day']."=>array('NULL','linked-day "

[PHP] big files download with php - configuration problem

2008-07-23 Thread Giulio Mastrosanti
Hi all, I have a set of php scripts that handle the browsing and download of file from the server. it has worked fine for a long time on a server linux, now I have got to migrate those scripts also on a windows server, and something very strange is happening: the download process hangs

[PHP] $_ENV or getenv to get bash environmental variables.. change php.ini?? env vars

2008-07-23 Thread mindspin311
I want to be able to do a getenv('SYMFONY_HOME'); or any env var that I've setup in my /etc/bashrc for everyone. But apache obviously doesn't have a shell, so it doesn't know about these. only the stuff in $_ENV. What I want to know is how can I read env vars like ANT_HOME, JAVA_HOME, etc.. in p

Re: [PHP] Multi-array - What am I missing?

2008-07-23 Thread Micah Gersten
Don't put the array definitions in quotes: Should be either: foreach($myCalTime as $calTime => $calArrayTime){ $calArray[$calArrayTime['day']] = array('NULL','linked-day '.strtolower($calArrayTime['reason']),$calArrayTime['day']); } or foreach($myCalTime as $calTime => $calArrayTime){

Re: [PHP] Multi-array - What am I missing?

2008-07-23 Thread Chris Ditty
The array($calArrayTime. is actually another string. I am mainly trying to get the values for ['day']['0'], ['reason']['0'] etc all on the same line. Sorry for not being clearer. >>> Micah Gersten <[EMAIL PROTECTED]> 7/23/2008 2:50 PM >>> Don't put the array definitions in quotes: Should be

Re: [PHP] Multi-array - What am I missing?

2008-07-23 Thread Jason Norwood-Young
On Wed, 2008-07-23 at 13:52 -0500, Chris Ditty wrote: > Can anyone point me in the right direction? I know I am missing something > simple, but I can't place my hands on it. > > $myCalTime = act_getCalendarDays($config, $myMonth, $myYear); > > foreach($myCalTime as $calTime => $calArrayTime){ >

Re: [PHP] Multi-array - What am I missing?

2008-07-23 Thread Micah Gersten
I'm still confused. What do you mean by same line? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Chris Ditty wrote: > The array($calArrayTime. is actually another string. I am mainly trying > to get the values for ['day']['0'], ['reason']['0'] etc al

Re: [PHP] Multi-array - What am I missing?

2008-07-23 Thread Micah Gersten
Nice catch, I missed that. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jason Norwood-Young wrote: > On Wed, 2008-07-23 at 13:52 -0500, Chris Ditty wrote: > >> Can anyone point me in the right direction? I know I am missing something >> simple, but I c

Re: [PHP] Multi-array - What am I missing?

2008-07-23 Thread Chris Ditty
I actually got it. Seeing Micah's code made me think. Thanks for helping. Much appreciated. >>> Micah Gersten <[EMAIL PROTECTED]> 7/23/2008 3:06 PM >>> Nice catch, I missed that. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jason Norwood-Young wrote:

Re: [PHP] Reference or copy?

2008-07-23 Thread Yeti
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reference or copy?

2008-07-23 Thread Ted Wood
In both PHP 4 and PHP 5, this would be an internal reference: $a = $b; until $b is changed. The only exception is with Object handling under PHP 4, which had flawed reference handling. So, the rule remains -- don't use references for performance reasons -- use them if you need references

Re: [PHP] Questions about finding ranges

2008-07-23 Thread VamVan
Hey, For ranges you can also use "Between" in the mysql queries. SELECT * FROM table WHERE Type= "Attainable" AND Min LIKE $var can be written as Select * from table where between min and max Just remember that "between" acts a bit wierd with dates or else Jim's solution would be perfect for yo

Re: [PHP] Questions about finding ranges

2008-07-23 Thread Micah Gersten
Here's the info on the "weirdness" of between: http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_between Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com VamVan wrote: > Hey, > > For ranges you can also use "Between" in the mysql querie

Re: [PHP] Apache blocking certain requests instead of php

2008-07-23 Thread Jim Lucas
Arno Kuhl wrote: I'm getting a lot of bogus requsts in the form of "index.php?id=http://64.15.67.17/~babysona/logo.jpg?";, sometimes more than a hundred a day per domain. The php script catches it, logs the request, sends an email report and replies with "access denied", but it takes processing w

Re: [PHP] After INSERT form submit - Data doesn't refresh!

2008-07-23 Thread VamVan
Hello, I understand what you are trying to do. But as a web developer it is never a good practice to have a insert query and page to display the record in the same page. This way you will never add the redundant data whenever the page is refreshed. So from my experience I would suggest you do thi

Re: [PHP] big files download with php - configuration problem

2008-07-23 Thread mike
On 7/23/08, Giulio Mastrosanti <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a set of php scripts that handle the browsing and download of file > from the server. > > it has worked fine for a long time on a server linux, now I have got to > migrate those scripts also on a windows server, and some

Re: [PHP] $_ENV or getenv to get bash environmental variables.. change php.ini?? env vars

2008-07-23 Thread mike
On 7/23/08, mindspin311 <[EMAIL PROTECTED]> wrote: > > I want to be able to do a getenv('SYMFONY_HOME'); or any env var that I've > setup in my /etc/bashrc for everyone. But apache obviously doesn't have a > shell, so it doesn't know about these. only the stuff in $_ENV. > > What I want to know is

[PHP] *****[SPAM(1.8)]*****

2008-07-23 Thread payne
Spam detection software, running on the system "magi.magidesign.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see postmaster for details. Co

[PHP] *****[SPAM(1.8)]*****

2008-07-23 Thread payne
Spam detection software, running on the system "magi.magidesign.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see postmaster for details. Co

[PHP] Weird issue with PHP5

2008-07-23 Thread jeff . mills
I have a module originally written for PHP-Nuke that I have ported to CPG-Nuke/DragonFlyCMS. In PHP4, the page I'm displaying works fine. In PHP5, it doesn't. The following link is a screenshot of the page using PHP4: http://nukeleaguedf.winsto.net/working-php4.jpg And a screenshot from PHP5: h

Re: [PHP] Weird issue with PHP5

2008-07-23 Thread Nathan Nobbe
On Wed, Jul 23, 2008 at 10:45 PM, <[EMAIL PROTECTED]> wrote: > > I have a module originally written for PHP-Nuke that I have ported to > CPG-Nuke/DragonFlyCMS. > > In PHP4, the page I'm displaying works fine. > In PHP5, it doesn't. > > The following link is a screenshot of the page using PHP4: > h

Re: [PHP] Weird issue with PHP5

2008-07-23 Thread jeff . mills
> > thats a decent bit of code to pick through, jeff. glancing at index.txt, > the code looks pretty straight forward, and by that i mean that it doesnt > look like theres anything that shouldnt work in php5. > > if i were to guess, i would suspect an environmental issue. you should > ensure tha

Re: [PHP] Weird issue with PHP5

2008-07-23 Thread Nathan Nobbe
On Wed, Jul 23, 2008 at 11:43 PM, <[EMAIL PROTECTED]> wrote: > > > > > thats a decent bit of code to pick through, jeff. glancing at index.txt, > > the code looks pretty straight forward, and by that i mean that it doesnt > > look like theres anything that shouldnt work in php5. > > > > if i were

Re: [PHP] Weird issue with PHP5

2008-07-23 Thread Nathan Nobbe
On Thu, Jul 24, 2008 at 12:07 AM, Nathan Nobbe <[EMAIL PROTECTED]>wrote: > On Wed, Jul 23, 2008 at 11:43 PM, <[EMAIL PROTECTED]> wrote: > >> >> > >> > thats a decent bit of code to pick through, jeff. glancing at >> index.txt, >> > the code looks pretty straight forward, and by that i mean that i

[PHP] hash_hmac: Encoding with two different results problem

2008-07-23 Thread Leon du Plessis
hi, I hope this is the right group for this type of problem: I am using hash_hmac to provide me with a sha1 encoded hash string. The problem is as follows: $hash = hash_hmac('sha1', '030B6A05696E657400C54601C60001550187360603773500018707060373796E63000187340603687474703A2F2F772E73796E632E63