php-general Digest 27 Aug 2008 07:04:02 -0000 Issue 5647

Topics (messages 278745 through 278756):

Re: concatenating with "." or ","
        278745 by: Yeti
        278752 by: Govinda
        278753 by: Robert Cummings

Bug in array_key_exist?
        278746 by: Korgan
        278747 by: Lupus Michaelis
        278749 by: Korgan
        278750 by: Jim Lucas
        278751 by: Korgan

Re: Quick question regarding getcwd() and directory location.
        278748 by: Micah Gersten

PHP IDE needed
        278754 by: Sascha Braun
        278755 by: Micah Gersten
        278756 by: VamVan

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
>> Bernhard wrote:
>> echo $test_string, $array_value;

It seems like they echoed them

--- End Message ---
--- Begin Message ---

I never thanked all the people who answered my Q in so many helpful ways and on so many levels. I see that this list if chock full of really quality people with loads of expertise and many other fine qualities (tedd sperling's broad perspective, for one) ... I would be tempted to thank people all the time for so many things. What to do?

-G
for 'gratitude'  and "Govinda"

Oone is a concatenated string, the other is arguments. Arguments are executed and output in order, whereas the concatenation causes the function calls to be executed first and then the echo to display the return values concatenated into a single string.


--- End Message ---
--- Begin Message ---
On Tue, 2008-08-26 at 19:56 -0600, Govinda wrote:
> >>
> I never thanked all the people who answered my Q in so many helpful  
> ways and on so many levels.    I see that this list if chock full of  
> really quality people with loads of expertise and many other fine  
> qualities (tedd sperling's broad perspective, for one) ...  I would be  
> tempted to thank people all the time for so many things.  What to do?

I take cheques :B

But seriously, I think you'll find many are happy enough to see
something like this response itself.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


--- End Message ---
--- Begin Message ---
Hi,
I have a problem with array_key_exists in if statement.

I have a class with this function

class XXX {
        private items = array();
...
...
...

public function addXXX($id, $count)
    {
       $count = (int)$cout;
        if (!array_key_exists($id, $this->items))
           $this->items[$id] = $count;
        else
           $this->items[$id] += $count;
    }

...
...

}

And I want to send instance of this class with SESSION.
If I add a item to the array, count is ok, but if i go to the next page count will change.


There is the code of index.php

 /** its loading classes ***/
 spl_autoload_register('loadClass');

 session_start();
 var_dump($_SESSION['XX']); /** A **/

 ....
 ...
 ...
 ...
 if ($_SESSION['XX'] instanceof XXX)
        $x = $_SESSION['XX'];
  else
        new...
  ..
  ..
  /** Do onzl this **/
  if ....
        $x->addXXX($id, $cnt);


  ....
  ...
  ...
  $_SESSION['XX'] = X;
  var_dump($_SESSION['XX']); /** B **/


There is a vardump if action addXXX exec:
   A:
        object(Kosik)#1 (1) { ["zbozi:private"]=>  array(0) { } }

   B:
        object(Kosik)#1 (1) { ["zbozi:private"]=>  array(1) { [1]=>  int(1) } }

And than i will go to some page and vardums are:
   A:
object(Kosik)#1 (1) { ["zbozi:private"]=> array(1) { [1]=> int(4) } } 1 : 4

   B:
         object(Kosik)#1 (1) { ["zbozi:private"]=>  array(1) { [1]=>  int(4) } }

I am thinking that do both codes in if statement,
but $this->items[$id] += $count; exec after send page.



I am using PHP Version 5.2.6 and Smarty v.2.6.19

Thanks for help :)


--- End Message ---
--- Begin Message ---
Korgan a écrit :

public function addXXX($id, $count)
    {
       $count = (int)$cout;

  Try to work with error_reporting set to E_ALL ;)


 session_start();
 var_dump($_SESSION['XX']); /** A **/

  If XX is a right value for a variable name, they are no problem.

--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org

--- End Message ---
--- Begin Message ---
Error reporting is set on E_ALL

notice: it change value if I add the item which isnt in array

Lupus Michaelis wrote:
Korgan a écrit :

public function addXXX($id, $count)
    {
       $count = (int)$cout;

  Try to work with error_reporting set to E_ALL ;)


 session_start();
 var_dump($_SESSION['XX']); /** A **/

  If XX is a right value for a variable name, they are no problem.


--- End Message ---
--- Begin Message ---
Korgan wrote:
Hi,
I have a problem with array_key_exists in if statement.

I have a class with this function

class XXX {
    private items = array();
...
...
...

public function addXXX($id, $count)
    {
       $count = (int)$cout;

     Let me point at it ^^^^

Check your spelling

If error_reporting was set to E_ALL AND display_errors were turned on, you would see that you are using an undefined variable in your method called $cout, casting is as an int and assigning the resulting value (which would always be zero) to $count.

        if (!array_key_exists($id, $this->items))
           $this->items[$id] = $count;
        else
           $this->items[$id] += $count;
    }

...
...

}

And I want to send instance of this class with SESSION.
If I add a item to the array, count is ok, but if i go to the next page count will change.


There is the code of index.php

 /** its loading classes ***/
 spl_autoload_register('loadClass');

 session_start();
 var_dump($_SESSION['XX']); /** A **/

 ....
 ...
 ...
 ...
 if ($_SESSION['XX'] instanceof XXX)
    $x = $_SESSION['XX'];
  else
    new...
  ..
  ..
  /** Do onzl this **/
  if ....
    $x->addXXX($id, $cnt);


  ....
  ...
  ...
  $_SESSION['XX'] = X;
  var_dump($_SESSION['XX']); /** B **/


There is a vardump if action addXXX exec:
   A:
    object(Kosik)#1 (1) { ["zbozi:private"]=>  array(0) { } }

   B:
    object(Kosik)#1 (1) { ["zbozi:private"]=>  array(1) { [1]=>  int(1) } }

And than i will go to some page and vardums are:
   A:
object(Kosik)#1 (1) { ["zbozi:private"]=> array(1) { [1]=> int(4) } } 1 : 4

   B:
object(Kosik)#1 (1) { ["zbozi:private"]=> array(1) { [1]=> int(4) } }

I am thinking that do both codes in if statement,
but $this->items[$id] += $count; exec after send page.



I am using PHP Version 5.2.6 and Smarty v.2.6.19

Thanks for help :)




--- End Message ---
--- Begin Message ---
Jim Lucas napsal(a):
Korgan wrote:
Hi,
I have a problem with array_key_exists in if statement.

I have a class with this function

class XXX {
    private items = array();
...
...
...

public function addXXX($id, $count)
    {
       $count = (int)$cout;

     Let me point at it ^^^^

Check your spelling

If error_reporting was set to E_ALL AND display_errors were turned on, you would see that you are using an undefined variable in your method called $cout, casting is as an int and assigning the resulting value (which would always be zero) to $count.

No variable $count is mandatory so that is defined.
But its not main idea of my question...
Function add items correctly, but if go to next page, values in array change. Values are changed passing from one page to another one, why and where?

        if (!array_key_exists($id, $this->items))
           $this->items[$id] = $count;
        else
           $this->items[$id] += $count;
    }

...
...

}

And I want to send instance of this class with SESSION.
If I add a item to the array, count is ok, but if i go to the next page count will change.


There is the code of index.php

 /** its loading classes ***/
 spl_autoload_register('loadClass');

 session_start();
 var_dump($_SESSION['XX']); /** A **/

 ....
 ...
 ...
 ...
 if ($_SESSION['XX'] instanceof XXX)
    $x = $_SESSION['XX'];
  else
    new...
  ..
  ..
  /** Do onzl this **/
  if ....
    $x->addXXX($id, $cnt);


  ....
  ...
  ...
  $_SESSION['XX'] = X;
  var_dump($_SESSION['XX']); /** B **/


There is a vardump if action addXXX exec:
   A:
    object(Kosik)#1 (1) { ["zbozi:private"]=>  array(0) { } }

   B:
object(Kosik)#1 (1) { ["zbozi:private"]=> array(1) { [1]=> int(1) } }

And than i will go to some page and vardums are:
   A:
object(Kosik)#1 (1) { ["zbozi:private"]=> array(1) { [1]=> int(4) } } 1 : 4

   B:
object(Kosik)#1 (1) { ["zbozi:private"]=> array(1) { [1]=> int(4) } }

I am thinking that do both codes in if statement,
but $this->items[$id] += $count; exec after send page.



I am using PHP Version 5.2.6 and Smarty v.2.6.19

Thanks for help :)




--- End Message ---
--- Begin Message ---
I said AFAIK.  I was under the impression the DirectoryIndex did a
redirect.  I just tested it and it does not, so you are correct Jochem. 
He has everything he needs.  He'll need the document root and
$_SERVER['REQUEST_URI'] to do this.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Jochem Maas wrote:
> Micah Gersten schreef:
>> What is the point of figuring that out?  If we knew that, we might be
>> able to help you with a solution.   As it stands what you want is not
>> possible AFAIK.
>
> you know wrong. he has all the info needed.
>
> 1. the document root of the site (/var/www/example.com)
> 2. the requested URL             (http://www.example.com/foo/bar)
>
> extract the path from the URL and stick into to the document root,
> problem sorted. No?
>
> do this:
>
> var_dump($_SERVER, $_REQUEST);
>
> read the output it contains, it should have everything you
> need although you will have to do some munging.
>
> for more esoteric setups you will have to test the code
> for completeness and possible expand it's capability to
> be able to tackle those situations.
>
> take it a step at a time.
>
> me thinks I made it sound more complicated than it is for
> most scenarios ... reading your last post it seems the
> answer is (for now) quite straight forward.
>
>>
>> Thank you,
>> Micah Gersten
>> onShore Networks
>> Internal Developer
>> http://www.onshore.com
>>
>>
>>
>> Ólafur Waage wrote:
>>> I am within a certain directory of the server via the browser.
>>>
>>> Example:
>>>
>>> http://www.example.com/foo/bar
>>> would be
>>> /var/www/example.com/foo/bar
>>>
>>> And Apache's DirectoryIndex feature is opening a index.php file that
>>> is located at
>>> /var/www/example.com/test/index.php
>>>
>>> And from that file i need to figure out the full local path of
>>> /foo/bar (which would be /var/www/example.com/foo/bar ) or any other
>>> directory i browse too.
>>>
>>> Ólafur Waage
>>>
>>>
>>>   
>>

--- End Message ---
--- Begin Message ---
Hi people,

I have a webproject which is round about 3 GB in size. I was usually
using eclipse to work with the software but over time eclipse became
very instable regarding that project.

As soon as I open classes with 2000 or more lines of code in it, an out
of memory error occours.

So I need a new IDE for linux.

Please tell me which IDE might be a true alternative for projects at
that size.

Thank you friends,

kind regards,

Sascha

--- End Message ---
--- Begin Message ---
How much RAM do you have?  Eclipse is a great IDE.  Have you upgraded to
3.4?

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Sascha Braun wrote:
> Hi people,
>
> I have a webproject which is round about 3 GB in size. I was usually
> using eclipse to work with the software but over time eclipse became
> very instable regarding that project.
>
> As soon as I open classes with 2000 or more lines of code in it, an out
> of memory error occours.
>
> So I need a new IDE for linux.
>
> Please tell me which IDE might be a true alternative for projects at
> that size.
>
> Thank you friends,
>
> kind regards,
>
> Sascha
>

--- End Message ---
--- Begin Message ---
use Aptana its awesome and free as well.

thanks



On Tue, Aug 26, 2008 at 8:29 PM, Micah Gersten <[EMAIL PROTECTED]> wrote:

> How much RAM do you have?  Eclipse is a great IDE.  Have you upgraded to
> 3.4?
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> Sascha Braun wrote:
> > Hi people,
> >
> > I have a webproject which is round about 3 GB in size. I was usually
> > using eclipse to work with the software but over time eclipse became
> > very instable regarding that project.
> >
> > As soon as I open classes with 2000 or more lines of code in it, an out
> > of memory error occours.
> >
> > So I need a new IDE for linux.
> >
> > Please tell me which IDE might be a true alternative for projects at
> > that size.
> >
> > Thank you friends,
> >
> > kind regards,
> >
> > Sascha
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---

Reply via email to