php-general Digest 26 Dec 2009 13:52:55 -0000 Issue 6507
Topics (messages 300693 through 300699):
Re: Merry Christmas!
300693 by: Rene Veerman
Multiple Inheritance Concern
300694 by: Daniel Kolbo
300695 by: Daniel Kolbo
300697 by: Larry Garfield
Re: PHP/SWFUpload progress
300696 by: Manuel Lemos
Re: File upload directive: $_FILES['filename']['name'] instead of
$_FILES['filename']['tmp_name']
300698 by: Richard Quadling
uninstalling wamp
300699 by: Sudhakar
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 ---
On Fri, Dec 25, 2009 at 9:50 PM, Kim Madsen <[email protected]> wrote:
> Copenhagen sents kind regards too, may you all have some swell days.
>
> And C U at Queensday? :o)
>
>
Alas, Queensday is not what it used to be.
Ever since they (our fun-hating mayor Cohen and his cronies) closed down the
night market and nightly festivities, it has been on a downward slide..
The day-market has gotten way too commercial (read:lame) too.
And most of the day-street-parties have lame DJs imo, playing mostly house
music that's so monotonous that it's only nice to dance to if you completely
fill yourself up with drugs & alcohol.
Starting last year, boats are now severely limited in their audio-levels.
It's now no longer allowed "to hear the music from more than 10 meters from
the boat". Another set of nails in the coffin.
IMO, it's the neo-kak of Amsterdam that's causing this. Those nice old big
houses on the canals, they're these days owned mostly by those not raised in
Amsterdam. People from the richer villages and towns have moved in.. I read
a report in the paper about how those rich turds have complained to the city
council about the loudness and "disturbances" of Queensday..
I'll admit that on queensday with fine weather the "vrij markt" (garage
sales by 20k+ citizens in downtown alone) you can still pick up some cool
art & items cheaply. And all the kids doing the garage-sale thing with their
leftover toys are cute too of course. But that's about what's left of the
entire "old" Queensday.
I'm genuinely sorry to be the one to break the bubble about this once very
cool party..
But i recommend anyone buying a planeticket and hotelroom for it to find a
new party scene.
Queensday ain't worth the money anymore imo..
--- End Message ---
--- Begin Message ---
Hello PHPers,
I've learned that php doesn't support multiple inheritance, b/c if you
need multiple inheritance usually it is a sign you've got a design
imperfection...or so they say.
Well, I'm using a framework (Codeigniter), and i'm extending the core
libraries. The trouble is, I want to also extend a second custom class,
and I don't want to change the core codeigniter class definitions as
this makes for awkward upgrades.
I read about mixins - no thank you. i do not want to even think about
mixins as it looks like it would be the source of all debug hell...
What's a programmer to do? Is the only option i am really left with to
duplicate the code in each class?
Thanks,
dK
`
--- End Message ---
--- Begin Message ---
Daniel Kolbo wrote:
> Hello PHPers,
>
> I've learned that php doesn't support multiple inheritance, b/c if you
> need multiple inheritance usually it is a sign you've got a design
> imperfection...or so they say.
>
> Well, I'm using a framework (Codeigniter), and i'm extending the core
> libraries. The trouble is, I want to also extend a second custom class,
> and I don't want to change the core codeigniter class definitions as
> this makes for awkward upgrades.
>
> I read about mixins - no thank you. i do not want to even think about
> mixins as it looks like it would be the source of all debug hell...
>
> What's a programmer to do? Is the only option i am really left with to
> duplicate the code in each class?
>
> Thanks,
> dK
> `
I just found this in the archive:
http://old.nabble.com/Multiple-Inheritance-td15717829.html
That example Nathan provides of mixin is a lot cleaner than a different
example (from a different poster on a different site) i was looking at.
I could probably use the method Nathan proposed in a pretty clean way.
i'm justified for using this multiple inheritance workaround to keep the
core framework untouched?
Does anyone else have a different approach or suggestion?
Thanks,
dK
`
--- End Message ---
--- Begin Message ---
On Friday 25 December 2009 8:02:06 pm Daniel Kolbo wrote:
> Hello PHPers,
>
> I've learned that php doesn't support multiple inheritance, b/c if you
> need multiple inheritance usually it is a sign you've got a design
> imperfection...or so they say.
>
> Well, I'm using a framework (Codeigniter), and i'm extending the core
> libraries. The trouble is, I want to also extend a second custom class,
> and I don't want to change the core codeigniter class definitions as
> this makes for awkward upgrades.
>
> I read about mixins - no thank you. i do not want to even think about
> mixins as it looks like it would be the source of all debug hell...
>
> What's a programmer to do? Is the only option i am really left with to
> duplicate the code in each class?
>
> Thanks,
> dK
> `
If the original author of one or both libraries did their job right, they'll
have provided an interface as well as the class that implements it. Then you
can implement the interface and pass through to a new instance using
composition.
To wit:
interface AInterface {
public function doA();
}
interface BInterface {
public function doB();
}
class A implements AInterface {
public function doA() { ... }
}
class B implements BInterface {
public function doB() { ... }
}
class YourClass extends A implements BInterface {
protected $b;
public function __construct() {
$this->b = new B();
}
public function doB() {
return $this->b->doB();
}
}
(It would probably be a little more complicated in a real use case, but
hopefully that should get you the idea.)
Mind you, that presumes that the code you're dealing with provides interfaces
and when doing type checking checks against the interfaces rather than the
classes themselves. If they don't, you should file a bug against that base
library as They're Doing It Wrong(tm).
--
Larry Garfield
[email protected]
--- End Message ---
--- Begin Message ---
Hello,
on 12/24/2009 09:33 AM German Geek said the following:
> Hi all,
>
> Wishing you a merry xmas! As a gift to you a little thing that I figured out
> through long googling and trial and error:
>
> We are using the swfupload (flash) upload tool to upload files to a php
> script. For a rather cryptic reason on some clients the progress would show
> too quickly when AVG Link scanning was activated on a windows machine. The
> upload would have completed, but it was actually still uploading. Sound
> weird? Yes that's what we thought.
Very likely your modem is buffering the uploaded data.
> We ended up solving it by installing SSL (https) on that machine which
> solved the problem because the anti virus cannot "see" the upload requests
> and tamper with it.
>
> I know this is not strictly PHP related, but since this list was always
> helpful for me i thought i would share this for xmas.
>
> There is a question that came up though:
> When uploading to a php page i could find a temporary file that was growing
> on the server. Couldn't one monitor the growth of that file and therefore
> track the progress with AJAX poll requests? I know this is more overhead but
> this seems more reliable to me when there is something funny going on on the
> client machine, like with the above anti virus. I couldn't figure out how to
> determine which temp file it was though, because the request would be still
> going while the file is uploaded and you cannot read the $_FILES variable or
> similar.
That is exactly what I do with the PHP upload progress extension and a
special plug-in for the Forms Generation and Validition class. There is
no need for Flash.
http://www.phpclasses.org/formsgeneration
Here is a live example:
http://www.meta-language.net/forms-examples.html?example=test_upload_progress
This article explains it in more detail:
http://www.phpclasses.org/blog/post/61-File-upload-progress-meter-for-PHP-4-at-last.html
--
Regards,
Manuel Lemos
Find and post PHP jobs
http://www.phpclasses.org/jobs/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--- End Message ---
--- Begin Message ---
2009/12/23 Andrei Iarus <[email protected]>
>
> Found the problem: I use Zend Framework, and after using a procedre, it is
> automatically moved. :( Thanks very much, I thought it was a problem with
> PHP, but from now on, it is a Zend Framework problem. Thanks again.
>
> --- On Wed, 12/23/09, Richard Quadling <[email protected]> wrote:
>
> From: Richard Quadling <[email protected]>
> Subject: Re: [PHP] File upload directive: $_FILES['filename']['name'] instead
> of $_FILES['filename']['tmp_name']
> To: "Andrei Iarus" <[email protected]>, "PHP General list"
> <[email protected]>
> Date: Wednesday, December 23, 2009, 7:52 PM
>
> 2009/12/23 Andrei Iarus <[email protected]>:
> > Of course: also tried the is_uploaded_file, exactly like in the manual. And
> > it fails.... :(
> >
> > --- On Wed, 12/23/09, Richard Quadling <[email protected]> wrote:
> >
> > From: Richard Quadling <[email protected]>
> > Subject: Re: [PHP] File upload directive: $_FILES['filename']['name']
> > instead of $_FILES['filename']['tmp_name']
> > To: "Andrei Iarus" <[email protected]>
> > Cc: [email protected]
> > Date: Wednesday, December 23, 2009, 6:10 PM
> >
> > 2009/12/22 Andrei Iarus <[email protected]>:
> >> Hello,
> >>
> >> On my production & testing servers (production runs on a centrino and
> >> testing runs on Windows) I can only access the temporary uploaded file
> >> using
> >> ini_get( 'upload_tmp_dir' . '/' . $_FILES['filename']['name'];
> >> while the file $_FILES['filename']['tmp_name'] simply does not exist
> >> (checked with file_exists() function, and also looking in the temporary
> >> folder).
> >>
> >> Is there a problem with my PHP installations? Is there any directive to
> >> change this bihaviour?
> >>
> >> On production: PHP 5.2.10 and on testing: PHP 5.2.8 and 5.3.0
> >>
> >> Thanks in advance.
> >>
> >>
> >>
> >
> > 2 functions to get to grips with:
> >
> > 1 - is_uploaded_file()
> > 2 - move_uploaded_file()
> >
> > Example from http://php.net/is_uploaded_file
> >
> > <?php
> >
> > if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
> > echo "File ". $_FILES['userfile']['name'] ." uploaded successfully.\n";
> > echo "Displaying contents\n";
> > readfile($_FILES['userfile']['tmp_name']);
> > } else {
> > echo "Possible file upload attack: ";
> > echo "filename '". $_FILES['userfile']['tmp_name'] . "'.";
> > }
> >
> > ?>
> >
> >
> > --
> > -----
> > Richard Quadling
> > "Standing on the shoulders of some very clever giants!"
> > EE : http://www.experts-exchange.com/M_248814.html
> > Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> > ZOPA : http://uk.zopa.com/member/RQuadling
> >
> >
>
> What version of Windows?
>
> Can you provide a really basic test?
>
> And a var_dump($_FILES) please?
>
> --
> -----
> Richard Quadling
> "Standing on the shoulders of some very clever giants!"
> EE : http://www.experts-exchange.com/M_248814.html
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> ZOPA : http://uk.zopa.com/member/RQuadling
>
Glad you got it worked out.
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
--- End Message ---
--- Begin Message ---
hi
after installing wamp when i accessed phpmyadmin i got an error about root
having no password, i have tried various steps but could not get to use
phpmyadmin, so i uninstalled and reinstalled wamp, i deleted the old wamp
folder when i access phpmyadmin i get the same error message
i read that there are some files of wamp that need to be deleted from the
registery of windows, i am not very sure about regsitry as it is a bit risky
thing
can anyone advice how i can remove any unwanted wamp files and install wamp
so that i can access phpmyadmin page
thanks
--- End Message ---