Re: [PHP] Critical Error

2012-03-28 Thread Paul Scott
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 28/03/2012 17:59, Karl James wrote:
 
 MYSQL: Duplicate entry for '0' for key 1.
 
 MYSQL: Insert Error - Duplicate entry '0' for key 1,.

Simply means that you are trying to insert a database entry into your
database table that already exists, for the primary key field (look at
ID or something like that)

This is a MySQL problem more than a PHP one, but there you go (I have
been largely absent from this list for a long time, so starting off
slowly again) ...

- -- 
- -- Paul http://www.paulscott.za.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPcznzAAoJEP24vLf5r1PRD9oH/jdPx1JmLk60MgwrojgPMc61
gdt416IyZVVe+d0z2YQ3Hep+T1otd8ibqnEb0nrl3URZoa2Bc+8OsCi9qTlcl/ts
qa+MgUd6if5/FBbev02f/39xBHrYtNm/3EPDuF/sFP1bZrXAYmOyze0pI50LU9Ki
5F/UyTjaa0l7mRA0MhcIOr0Q1+ouRDKPrTrPV/NKqhMSxkinzmcOEuIcpfxd78yD
ELiPS2GUuieusrFkrlHFq6DGoS2Kk8mtZa7Pu9FqYjCUdOUJCeuPlJlCRi5FRWxG
DFesqV3Xj2FxMLE2h0sTek4NNX6PvM7tlCEzgEy7QnjbqH8RPLGI+6B9M1WIWqg=
=0ACX
-END PGP SIGNATURE-

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



Re: [PHP] Need PHP Web Developer in So Cal

2012-03-28 Thread Paul Scott
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 28/03/2012 18:04, Michael Frankel wrote:
 Hi -
 
 I am looking for a reliable, experienced PHP / Web developer or
 development company to assist me with one of my long-time clients.
 I need someone who has experience with all the following
 technologies working in a hosted environment:

[snip]

 - Can be responsive to client emergencies - NOTE: this is the MOST
 important quality

Translates to we will be phoning you at 2am and you are expected to
be there with a smile on your face for the client

Am I right? Yeah, I know I am... ;)

- -- 
- -- Paul http://www.paulscott.za.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPczphAAoJEP24vLf5r1PRd6IH/3tLKoRDrL5R/fcjYop8RyLE
Bux+xJ/N6qkMr3aYOGq/k7C6StFZGK2WqxftqJW38qakWqnpX35ZseezsQyQ70Ek
ZZossCFAQ/n3DqXNeB3RDRGfVODEKEIlAGvYnwFK04VW/bsUU69o+ac7pffN7yYu
i/622+4ssSRPafMv6t1kX/w/DlfhzGyrAKGLbibM5uX4l1cNmM/YEkPzyiu/ySFd
8L9dI+N5j0vStJUh1jRpi08EoZJXGTjMtBfOGvYgjD1bnAl+K8nGYx9irGXfpBej
GaKRGAcP7ZxFmUl61bGyrK2ijUATbjAckfi/2z6DHmuJNr0TdnqEF545t77MrcQ=
=sEhx
-END PGP SIGNATURE-

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



Re: [PHP] Intentionally generate an Internal Server Error

2011-08-07 Thread Paul Scott
On Sun, 2011-08-07 at 07:30 +0100, Ashley Sheridan wrote:

 Quickest way I know of is to mess up an .htaccess file!

Another good way to do it on shared hosts is to give a file incorrect
permissions and try and access it

-- 
-- Paul

http://www.paulscott.za.net
http://twitter.com/paulscott56
http://www.chisimba.com


signature.asc
Description: This is a digitally signed message part


Re: [PHP] Happy New Year All!

2009-12-31 Thread Paul Scott

Bipper Goes! wrote:
 return ThankYou;
 
 
 Oh god I think I blowed it up.

I prefer:

?php
while(date('Y')  2010) ;
exit (' Happy New Year');


-- 
-- Paul

http://www.paulscott.za.net
http://twitter.com/paulscott56
http://avoir.uwc.ac.za
All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal


Re: [PHP] Happy New Year All!

2009-12-31 Thread Paul Scott
--=neXtPaRt_1262280971
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit


Robert Cummings wrote:
 
 Oh dear... that's terribly inefficient... Here's a better stab:

True, but my design criteria included that it needed to fit into a 140
char tweet too...

-- 
-- Paul

http://www.paulscott.za.net
http://twitter.com/paulscott56
http://avoir.uwc.ac.za

--=neXtPaRt_1262280971
Content-Type: text/plain;

All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal


Re: [PHP] Re: Dan Brown

2009-08-03 Thread Paul Scott
Daniel Brown wrote:
 (behind schedule) and distribute refunds to clients.  Having a baby is
 difficult enough; having a baby and a career is more difficult; having
 a baby and working as a freelancer or owner/operator of a company is
 the epitome of masochism --- I'm learning that quite thoroughly
 through experience.
 

Congratulations! Welcome to the club :) We just had a very similar (we
don't have a basement) experience with baby #2, so I feel you!

It gets better, sleep is for sissies anyway :)

-- 
-- Paul

http://www.paulscott.za.net/
http://twitter.com/paulscott56
http://avoir.uwc.ac.za

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



Re: [PHP] PHPBB Speed Issues

2009-07-31 Thread Paul Scott
Ashley Sheridan wrote:
 I've optimised the images in the template, enabled the GZ compression,
 and it's only improved the speed by a mere fraction. I have noticed that
 the page itself doesn't display until after this delay, so I was
 guessing that I could maybe force the buffer to flush at key intervals
 to give the impression the pages are loading faster. Does anybody have
 any insights into this?

To bring things more on topic, why not rather have a discussion about
general scalability?

1. Cache as much as you can (everything)
2. Minimise HTTP requests
3. Use an opcode cache like APC
4. Use a RAM based cache system like memcacheD and give your db a breather
5. FINALLY, throw more hardware at it.

-- 
-- Paul

http://www.paulscott.za.net/
http://twitter.com/paulscott56
http://avoir.uwc.ac.za

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



Re: [PHP] Re: Epiphany - a salute to APC

2009-07-05 Thread Paul Scott
Eddie Drapkin wrote:
 if you want a pure opcode cache, APC is a great choice.
 
 you think this is similar to http://www.danga.com/memcached/ or you think
 this method would be faster ? Which do you say would be the greatest
 benfit ?

A simple rule of thumb that I use is:

If you have one machine and medium to large traffic loads, go APC
If you have more machines for caching servers (dedicated) and large to
holy mofo loads, then go MemcacheD

This ALL assumes that you have followed a logical scalability plan and
have separate DB servers, app servers and possibly even using a CDN or
something beforehand.

-- Paul

http://www.paulscott.za.net/
http://twitter.com/paulscott56
http://avoir.uwc.ac.za

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



Re: [PHP] Writing to a file

2009-07-03 Thread Paul Scott
Jason Carson wrote:
 How would I go about writing stuff to a file but in between the ?php ?
 tags?
 

http://www.php.net/file_put_contents

-- Paul

http://www.paulscott.za.net/
http://twitter.com/paulscott56
http://avoir.uwc.ac.za

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



Re: [PHP] PHP MySQL 500 Internal Error

2009-06-19 Thread Paul Scott
On Thu, 2009-06-18 at 22:10 -0400, Shawn Simmons wrote:
 Wrote a small script to connect to the MySql database.  Tried to run the 
 script (http://localhost/dbscript.php) and I get a 500 Internal Server 
 error.  I have been up and down the web for two days looking for a solution 
 and I am completely frustrated.  I HAVE to be missing something.  PLEASE 
 PLEASE PLEASE help.  Thanks.
 

Check permissions and ownership on the file. That often happens when the
permissions are set to 0777 as opposed to 755 (in *nix speak), so check
that the webserver user has read and execute access on the file and that
it ownds the directory etc


-- Paul
http://www.paulscott.za.net
http://twitter.com/paulscott56
http://avoir.uwc.ac.za
-- 


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



Re: [PHP] User Authentication across multiple server

2009-03-06 Thread Paul Scott
On Fri, 2009-03-06 at 10:09 +0100, Edmund Hertle wrote:

 The only method which possibly could work and came to my mind was using
 somehow $_GET parameter for username and password (encrypted).

Set a cookie and crypt that (RC4 works well) and then check for the
cookie on both sites. Kind of like a Remember me type deal

-- Paul


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



Re: [PHP] Strange charecters

2009-03-03 Thread Paul Scott
On Wed, 2009-03-04 at 10:09 +0530, Chetan Rane wrote:
 I am using ob_start() in my application. However I am getting this error
 about headers already sent.
 

_Any_ output will set that error off. Check for Notices, Warnings,
echo's, prints and var_dumps in your code.

-- Paul


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



Re: [PHP] E-Mail Attachment Filename Encoding Problem

2009-02-17 Thread Paul Scott

On Tue, 2009-02-17 at 10:30 +, Richard Heyes wrote:
  The *other* white meat?
 
 Sorry, no idea what that means.
 

Cats are the other white meat. Sorry have flu, may be delirious

-- Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] E-Mail Attachment Filename Encoding Problem

2009-02-17 Thread Paul Scott

On Tue, 2009-02-17 at 10:19 +, Richard Heyes wrote:
 There's no reason not to use it - it works for a good many people. And
 a few cats too.

The *other* white meat?

-- Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

[PHP] ANN: Chisimba-2.1.0 release!

2009-01-16 Thread Paul Scott

The next release of the Chisimba PHP5 framework is now available
(Chisimba-2.1.0).

Major enhancements included in this release are:

 - Numerous enhancements to the database abstraction layer for increased
performance
 - Numerous core bugfixes and enhancements
 - Patch descriptions added in module catalogue
 - Layout and skin enhancements
 - Increased security and RC4 encryption of session data
 - Complete authentication system overhaul
 - Remember me functionality added
 - URL rewriting
 - Remote popularity contest module
 - Additional filters for rich content
 - Some installer fixes
 
and, of course, new modules to add onto your installation!

Please take a look, download it and give it a test drive! 
 
Chisimba, for those that don't know it already, is a PHP5 framework made
in Africa, for Africa. It is a collaboration between around 16 African
Universities, as well as around 35 active developers from around the
continent.
 
It can be downloaded from AVOIR at:
 
http://avoir.uwc.ac.za/

and the documentation can be found at:
 
http://avoir.uwc.ac.za/index.php?module=newsaction=viewcategoryid=gen14Srv6Nme27_7167_1219410313

There are server setup instructions, as well as installation
walkthroughs available linking from the main AVOIR site:
 
http://avoir.uwc.ac.za/index.php?module=newsaction=viewcategoryid=gen14Srv6Nme27_2077_1219410069
 
For those interested in developing a module, or just getting some
additional info please take a look at:
 
http://avoir.uwc.ac.za/index.php?module=newsaction=viewcategoryid=gen14Srv6Nme27_6705_1226737050

-- Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] First steps towards unix and php

2009-01-09 Thread Paul Scott

On Fri, 2009-01-09 at 07:50 -0500, Daniel Brown wrote:
 I'd take SMART or urpmi over yum as well, for the record.

First choice is ./configure  make  make install, second choice is
apt

-- Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] First steps towards unix and php

2009-01-09 Thread Paul Scott

On Fri, 2009-01-09 at 14:53 +0200, Paul Scott wrote:
 First choice is ./configure  make  make install, second choice is
 apt
 

Even better, of course, is the:

Yo sysadmin intern! Install package for me please and don't screw it
up

-- Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] on Mapserver and php5_MapScript

2009-01-09 Thread Paul Scott

On Fri, 2009-01-09 at 14:15 -0500, Eduardo Arévalo wrote:
 As I write this line is highlighted in black php5_MapScript
 

You should probably ask this on the UMN Mapserver lists at
mapserver-us...@lists.osgeo.org but...
 ;
  $jStyle-outlinecolor-setRGB(200, 200, 200);

You are setting an outline colour, but the style you are using does not
allow it to be displayed. Basically all you are getting is the outline
and not the fill.

I suggest you read the excellent mapfile docs or ask on another list.

-- Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Re: hello

2009-01-09 Thread Paul Scott

On Fri, 2009-01-09 at 18:15 -0500, Phpster wrote:
 -12C in Toronto
 

Meh! 30C - 35C in Cape Town, South Africa almost every day for the last
month. It has been a scorcher this year!

-- Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Holocoste against palestinians

2009-01-07 Thread Paul Scott

On Wed, 2009-01-07 at 22:51 -0800, It flance wrote:
 The message is to webhosting companies,
 

This is not a web hosting company.

 Israel is killing palestinian children. Some sites are are showing the fotos 
 of israel's holocoste against palestinians. 
 Now here is a link that shows to israelis how to fight that too:
 http://www.jpost.com/servlet/Satellite?cid=1231167272840pagename=JPost%2FJPArticle%2FShowFull
 
 Please be aware of that.

What exactly does this inane crap have to do with PHP? I see that there
is an asshole like you on almost every list that I subscribe to (many)
and I am tired of politics creeping into FREE software. I think that
part of MY FREEDOM that you are infringing on is my FREEDOM from
politics. If I was interested in this crap, I would subscribe to an
APPROPRIATE list.

Thank YOU and good luck. 

-- Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] permission failure with fopen

2008-11-07 Thread Paul Scott

On Fri, 2008-11-07 at 14:27 +0200, Thodoris wrote:
 
  I'm testing on Windows XP SP2 with PHP 5.2.0
 

As far as I remember, you need to pass the b parameter to Windows as
well on fopen(), so you would do an fopen(/path/to/file,wb);

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

RE: [PHP] web shot script

2008-10-23 Thread Paul Scott

On Thu, 2008-10-23 at 22:20 -0400, Joey wrote:

 Really I want to do this, not pay someone to do it via those services you
 linked to.
 So nobody has seen open source code for this?

I run a free (freedom and beer) webservice to do this via the Chisimba
framework (http://avoir.uwc.ac.za) The docs and files are all in svn so
if you would like em, get em! The screenshot code is in python though.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] PHP Dev Facts

2008-10-17 Thread Paul Scott

On Fri, 2008-10-17 at 00:14 +0100, Nathan Rixham wrote:
 Evening All,
 
 I'd be /really/ interested to know who uses what!
 
 *Procedural or OOP?*
 

OOP

 *Dev OS*
 

Ubuntu 8.04

 *Dev PHP Version*
 

PHP-5.2.3

 *Live Server OS*
 

Debian

 *Live Server PHP Version*
 

PHP-5.2.3

 *Which HTTP Server Software (+version)?*
 

Apache 2

 *IDE / Dev Environment*
 

Zend Studio / Vim / nano

 *Preferred Framework(s)?*
 

Chisimba

 *Do you Unit Test?*
 

Yes - PHPUnit3

 *Most Used Internal PHP Class*
 

SPL classes

 *Preferred OS CMS*
 

Chisimba CMS

--Paul



All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

[PHP] ANN: Chisimba-2.0.3 Released!

2008-09-04 Thread Paul Scott

The next release of the Chisimba PHP5 framework is now available.

Major enhancements included in this release are:

 - PDO and MDB2 support
 - Improved database performance
 - Bug fixes
 - Better code documentation
 - API integration for many more modules
 - Remote downloads of modules (apt like module installations)

and, of course, new modules to add onto your installation!

Please take a look, download it and give it a test drive! 
 
Chisimba, for those that don't know it already, is a PHP5 framework made
in Africa, for Africa. It is a collaboration between around 16 African
Universities, as well as around 35 active developers from around the
continent.
 
It can be downloaded from AVOIR at:
 
http://trac.uwc.ac.za/trac/chisimba/downloader/download/release/5

and the docs can be found at:
 
http://avoir.uwc.ac.za/

There are server setup instructions, as well as installation
walkthroughs available linking from the main AVOIR site:
 
For those interested in developing a module, or just getting some
additional info please join our mailing list and ask some questions:
 
http://mailman.uwc.ac.za/mailman/listinfo/nextgen-online

--Paul

-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Re: very very small CMS

2008-07-19 Thread Paul Scott
On Sat, 2008-07-19 at 10:18 -0400, tedd wrote:
 At 12:48 PM +0200 7/19/08, Frank Arensmeier wrote:
 19 jul 2008 kl. 05.05 skrev Robert Cummings:
 Here's a CMS I've been working on.
 
 http://www.webbytedd.com/a/easy-page-db
 
 The idea is to allow the user edit pages in situ.
 

Tedd,

Looks pretty good, but why not use in place editing with a little bit of
AJAX rather than making the user click twice?

I would rather turn editing on, then click to edit in place.

--Paul


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



[PHP] Re: SPAM SPAM Re: [PHP] Capture homepage screenshot

2008-06-13 Thread Paul Scott


On Fri, 2008-06-13 at 14:45 -0400, Daniel Brown wrote:
 There are several commercial options available, but I may put
 together a script this afternoon capable of generating thumbnails from
 websites.  If I do, I'll keep you informed.
 

In my project, we do this through a small Python application. The cool
thing for you, is that the functionality is exposed through an XML-RPC
service as well...

You are free to use it, as long as you don't abuse it of course (we have
limited bandwidth in Africa).

The other option is to read the docs as to how its done and copy it
(it's all GPL anyway).

To see it in action, take a look at:
http://avoir.uwc.ac.za/index.php?module=cmsaction=showfulltextsectionid=init_1id=gen14Srv2Nme49_8062_1213073978

In my framework, we simply call it through a filter, so to get a
screnshot of the PHP site, I would simply add in:

[SCREENSHOT]http://www.php.net/[/SCREENSHOT] in any place that I can add
content (blog, wiki, cms etc).

Lastly, but not least at all, you could also just use our framework...
Download from http://avoir.uwc.ac.za/

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

[PHP] Re: SPAM SPAM [PHP] Build and Deployment Process

2008-06-10 Thread Paul Scott

On Tue, 2008-06-10 at 14:56 -0700, VamVan wrote:
 What is the best method to build and deploy php scripts along the different
 environments? You can talk about rpm's and stuff

In my project(s) I use Phing. http://phing.info It is even written in
PHP, so keeping this thread on topic.

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] the Y2K38 BUG

2008-05-07 Thread Paul Scott

On Wed, 2008-05-07 at 00:54 -0600, Nathan Nobbe wrote:

 looks like mine only goes to dec. 31,  =/
 

*Gasp!* best you get cracking on finding an alternative solution!

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] AI file and mapping with PHP

2008-05-07 Thread Paul Scott

On Wed, 2008-05-07 at 12:17 +0200, Angelo Zanetti wrote:
 We have a project where by we have a map in ai format (vector format). What
 we want to do is to programmatically come up with a solution that say on the
 map there is a restaurant at a certain location, that we can zoom into the
 map on that specific area.
 

Angelo,

You will need a specialised solution for this, like UMN Mapserver with
PHP/Mapscript. If you need some real, local, help, mail me off list, and
I will see about you guys paying me to do this for you (at SA prices) ;)

Seriously though, you won't get what you want with GD...

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] strange behavior, when converting float to int

2008-05-06 Thread Paul Scott

On Tue, 2008-05-06 at 09:34 -0500, Philip Thompson wrote:

 I got the same results. I'm not exactly sure what's happening, but
 I'd  
 be curious to see if there's anyone else who can shed some light.
 
 PHP Version 5.2.4.

Is this not coming from the underlying C libs that directly use the FP
on the CPU? 

I would say that the compile flags, CPU settings etc would probably have
an impact on accuracy.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] the Y2K38 BUG

2008-05-06 Thread Paul Scott

On Wed, 2008-05-07 at 10:03 +0530, Chetan Rane wrote:
 Have guys heard of the the Y2K38 Bug more details are on this link
 

Nope, but I can guess what its about.

 Can there be a possible solution. As the system which I am developing
 for my client uses Unix timestamp.
 

There are probably multiple solutions. AFAIK time is a 32 bit signed
int, making it unsigned would add like 100 years onto your app.

 This might effect my application in the future
 

If your app survives that long! Why not just maintain it and when times
change, your app changes? :)

Seriously, this is really not a big deal!
  
 
 Thank you, in Advance.

It's a pleasure my paranoid son...

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] the Y2K38 BUG

2008-05-06 Thread Paul Scott

On Tue, 2008-05-06 at 23:50 -0600, Nathan Nobbe wrote:
 true-that ;)
 anyway, the DateTime class is implemented as a 64-bit unsigned (i think)
 value.  so if you use it you should be good to go.
 
 php  echo date_create('2040-10-24')-format('M-d-Y');
 Oct-24-2040
 

a 64bit unsigned int is best, but that would only work properly on 64bit
arch. For 32bit users, making it unsigned is the best option for now,
and I suppose that by 2038 there will be another option. 

As far as I am concerned, this discussion is a discussion for the sake
of discussion. If I am still using the same apps that I use today in
2038, I will officially rethink my usefulness as a human being :)

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

RE: [PHP] Phpstop.com project - wanna be a writer?

2008-05-05 Thread Paul Scott

On Mon, 2008-05-05 at 15:12 +0200, Chris Haensel wrote:
 Maybe I can have you as a writer? ;o) And maybe 2 or 3 more of this list
 The big names, ya know *g*

Oh well, my name is only 4 letters so I guess I am out? ;)

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Web page excerpt editor

2008-05-04 Thread Paul Scott

On Sun, 2008-05-04 at 10:12 -0500, Mike Potter wrote:

 Does anyone have any experience with something else? Alternately, has
 anyone written something they'd be willing to share under GPL?

FCKEditor, TinyMCE and a host of others. All JS based, so not really
relevant on a PHP list though

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] php framework vs just php?

2008-04-22 Thread Paul Scott

On Tue, 2008-04-22 at 13:34 +0100, Richard Heyes wrote:
 Absolutely. Personally I use a lot of disparate libraries, a lot of them 
 from PEAR. Doing this I've never found the need or the inclination to 
 use a framework.
 

But that is kind of a framework!

You get two kinds of framework in PHP IMHO - the Glue frameworks (like
Chisimba, CakePHP etc) and the component frameworks (like PEAR, Zend
Framework etc).

What you are describing is simply a component framework. Just because
you choose not to call it a framework, does not mean that it is not a
framework.

--Paul



All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

[PHP] mime_content_type and FileInfo

2008-04-21 Thread Paul Scott

I am in a bit of a pickle, or is that PECL?

I need to use either mime_content_type or FileInfo to get the mime type
of a file that is dumped into the system via email.

Now that is the easy part, where the hard part comes in is that a
commercial host that I use will do neither reason being that
mime_content_type is deprecated, and that FileInfo is unstable in PECL
only :/

Anyone got a workaround on this? I *really* don't feel like writing a
zillion lines of code to get arbitrary mimetypes out that will only be
used a little while and to replace 1 and 2  lines of code respectively.

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] April Fools Easter Egg

2008-04-01 Thread Paul Scott

On Tue, 2008-04-01 at 10:28 -0400, tedd wrote:
 You got me.
 

Wobbly PHP logo on mine (PHP-5.2.5 debian)

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] new lines in textareas?

2008-03-30 Thread Paul Scott

On Sun, 2008-03-30 at 12:29 -0400, tedd wrote:
 At 9:26 PM -0700 3/29/08, Mary Anderson wrote:
 Hi all,
 I have a php script which produces text which is to be displayed 
 in a textarea.  I have the wrap for the text area set to 'hard'.  I 
 need to have newlines inserted in the text.
  \n and br don't work.  They just get quoted literally in 
 the text.  I suspect I need to use htmlspecialchars , but don't know 
 what special character to feed it.
 

Only getting to this now, but doesn't nl2br() do what you want?

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] How to install PHP 5.x on Windows Server 2000 with IIS 5 and MySQL 5.x

2008-03-27 Thread Paul Scott

On Thu, 2008-03-27 at 10:32 -0400, Wolf wrote:
 I'd suggest going with a real operating system (linux) which keeps patches 
 updated quicker...
 

As much of a Free Software advocate as I am, that is not the answer to
the question. That being said, however, I would replace the IIS with
Apache2 at least...

I seem to remember someone posting a really good guide to setting this
all up at some stage, so a quick search through the archives should
reveal all.


--Paul

-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] optimilize web page loading

2008-03-26 Thread Paul Scott

On Wed, 2008-03-26 at 09:25 +0100, Alain Roger wrote:
 i would like to know if there is a way to know how long does a web page need
 to be loaded into browser ?
 this is interesting fact for me, as i will optimilize my PHP code in order
 to reduce this time to minimum.

Try using microtime() http://www.php.net/microtime/ on either side of
your output statement(s).

--Paul
 
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] GPS Locator

2008-03-04 Thread Paul Scott

On Tue, 2008-03-04 at 11:42 -0600, Richard Lynch wrote:
 Almost for sure, browser security will not let you do this in a web
 browser.
 
 You'll probably have to write a custom desktop C application, or get
 the user to install some kind of glue widget...
 
 PEAR|PECL *might* have some USB stuff in a library you could use to
 write the PHP desktop widget and keep this on-topic, but I dunno...

DIO should let you do it, but that extension is pretty buggy last I used
it (OK like 5 years back with PHP4).

What I did was got high end barcode scanners to scan directly into a db
through a long running PHP script with it, so that should work just
fine.

That being said, though, something like a Winders COM object will
probably be a better bet (I have never used COM objects before as I
don't use Windows at all, ever) so correct me if I am wrong please!

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] What design patterns do you usually use?

2008-02-27 Thread Paul Scott

On Wed, 2008-02-27 at 19:50 +0800, skylark wrote:
 What design patterns do you usually use?

I am not sure that you are understanding what a design pattern is. It is
not a piece of software or a thing to use, but it is a set of repeatable
components that you use in whatever app you are writing. 

Take for instance an observer pattern. When would you use that? Why
would you use that? Have you used it somewhere before and what were the
circumstances? Is it repeatable? Is your previous code re-usable?

Answer some of those questions, look up design patterns (even on
wikipedia to get an overview) and buy some books to see solid examples. 

If you suspect that you need to use a specific pattern, or are
interested in how to implement a specific pattern, write some throwaway
code to do it and ask opinions.

Look at the simple things that you would probably have used already -
factory, singleton and MVC and expand on those a little to get them to
be actual design patterns that you can use/reuse.

Don't use design patterns because you heard it on TV - same as
Web2.0 _think_ about what it means to you and your enterprise before
asking for a buzzword generator to do your job for you! :)

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] What design patterns do you usually use?

2008-02-27 Thread Paul Scott

On Wed, 2008-02-27 at 14:48 +0100, Jochem Maas wrote:
 Paul Scott schreef:
 there seems to be some misunderstanding ... a design pattern is not
 a component (or anything else of substance) but merely a conceptual
 strategy used to tackle a problem ... ever find yourself writing code
 that's conceptually identical to previously written code (in a different
 site/project/context), if so you've got yourself a pattern and as such it's
 probably been documented as an 'official' design pattern with suitable fancy
 name (something like 'Observer', 'Delegator', 'Factory')
 
 chances are then that you're already using design patterns - it's just
 that you don't know them by name :-)
 

Ja, that's what I was trying to say in a long, convoluted,
burning-the-candle-at-both-ends type of way :)

Thanks Jochem for clearing that up!

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] How do you send stylized email?

2008-02-27 Thread Paul Scott

On Wed, 2008-02-27 at 13:18 -0500, Andrew Ballard wrote:

 Seriously? All e-mail? Sorry - couldn't resist. That is one serious
 disclaimer. I especially like the last line.
 

Holy crap! I had never actually looked at that stupid disclaimer before!
It gets added on the way out of our network, so like 80% of the mail
that I send doesn't even have that _HTML_ link in it.

Yech! Oh well, I suppose the suits have decided that its necessary

--Paul


All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] How do you send stylized email?

2008-02-26 Thread Paul Scott

On Tue, 2008-02-26 at 11:44 -0500, Daniel Brown wrote:
 I wonder if I can just apt-get the wedding and have it all
 automated for me.  ;-P

If only! I remember the stress, and a good friend of mine is gettin'
hitched on Sat - while I am in Uganda - go figure! 

Anyway, congrats, and enjoy the day... (Jokes aside of course)

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] How do you send stylized email?

2008-02-26 Thread Paul Scott

On Tue, 2008-02-26 at 11:27 -0500, Daniel Brown wrote:
 On Tue, Feb 26, 2008 at 10:57 AM, Robert Cummings [EMAIL PROTECTED] wrote:
   Marriage?? That's for backwards people stuck in ancient pointless
   traditions :) And moreso in today's culture... it's just a commercial
   suckfest when your money could better go to student loans and raising a
   family.
 
 http://debianddan.com/
 
 CC: Debs
 

LOL! Now you are going to get a gazillion requests coming from people
looking for debian packages (possibly a new debian based distro for
people that stutter?) 

:))

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] How do you send stylized email?

2008-02-26 Thread Paul Scott

On Tue, 2008-02-26 at 22:52 -0300, Manuel Lemos wrote:
 messages. I use this popular MIME message composing class. Try the
 test_simple_html_mail_message example script for instance.
 
 http://www.phpclasses.org/mimemessage
 
 

Hehe, I was holding my breath for Manuel to come on to this thread!

if($subject === 'something to do with mail')
{
$this-punt('mimemessage', 'phpclasses.org');
}
else {
sleep(86400);
}


;)


--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] PHP 24 hour processes?

2008-02-24 Thread Paul Scott

On Mon, 2008-02-25 at 07:39 +0100, Zoran Bogdanov wrote:
 How can you perform a timed event in PHP; for example:
 
 Count 24 hours and then delete all rows in a database...
 

I thought that this question was answered in some detail before...

Anyway, on *NIX based systems use cron.daily or on 'doze, use AT or
command scheduler I think it's called.

Either that or use a long running PHP process with ignore_user_abort()
and a time of 86400 seconds :)

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] temporary error

2008-02-21 Thread Paul Scott

On Thu, 2008-02-21 at 14:54 +0100, Mirco Soderi wrote:
 Consider the following code:
 
 $sqlQueryInserimentoDatiAllenamentoCalciPiazzati = INSERT INTO ... etc etc 

How long does it take you to write a single line of code with variable
names like that?

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Exception vs exception

2008-02-21 Thread Paul Scott

On Thu, 2008-02-21 at 21:01 -0800, Prabath Kumarasinghe wrote:
 In second approach for every query I have to write
 throw new MySQLException(My Message). It's very time
 consuming isn't it?

In order to *be* lazy, you have to *think* lazy...

Don't go and define every single query with an exception, thats just not
the lazy way, rather define a few functions that do generic stuff (or
even a single function that runs a query) and then send all of your
queries through that:

public function queryWithException($filter)
{
$results = $dblayer-query($filter);
if($results === FALSE)
{
 throw new MyException(Query failed!);
}
else {
return $results;
}
}

then in your code:

try {
$this-queryWithException(SELECT * FROM users WHERE clue  0);
}
catch (MyException $e)
{
   // clean up
}

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Deleting all rows in a database every 24 hours?

2008-02-21 Thread Paul Scott

On Fri, 2008-02-22 at 07:28 +0100, Zoran Bogdanov wrote:
 The title says it all, how do I perform an action every 24 hours?
 

$sql = TRUNCATE TABLE 'sometable';
$this-query($sql);

on a cron.daily

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Sending SMS via PHP

2008-02-20 Thread Paul Scott

On Wed, 2008-02-20 at 21:01 -0800, Nick Stinemates wrote:
  Do you need to receive SMS? If you need to receive SMS, you will need to
  host your own GSM device or modem so that people can send you SMS.
 
  If not, you can just use internet SMS gateways like clickatell to do the
  work, and post to them by HTTP, XML or email. The cost is about 6-8 cents
  per SMS. There are cheaper services, but not always reliable. If you need to
  host your own GSM device, you can use software like http://www.kannel.org
  (GPL Open Source) or http://www.visualgsm.com.
 

The thing with SMS is volume. Most commercial (bulk SMS) service
providers do provide a return path at a price, but this can get really
expensive especially at low volumes.

What you need to do is ask yourself whether you are going to do high
volume SMS or not, and look at when do the commercial providers become
more economical? What a lot of people do, is sign up for an account and
end up sending only 50 or so SMS a month, which is silly, when for the
same price as a month or two's subscription, you could buy your own GSM
modem and a prepaid SIM card and do it for half the price yourself.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] fail on preg_match_all

2008-02-20 Thread Paul Scott

On Wed, 2008-02-20 at 23:34 -0600, Hamilton Turner wrote:
 if i know the file handle is valid (i grabbed it using 'or die'), and 
   ^

This is probably your problem, you are trying to match on a resource
handle, not a string or something.

Check out http://www.php.net/preg_match_all

 the regex is valid

Won't really matter if the data is in the wrong format!

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

RE: [PHP] What community software package gets your vote? PHPfox etc...

2008-02-19 Thread Paul Scott


On Tue, 2008-02-19 at 23:21 -0500, TS wrote:
 On Feb 19, 2008 8:41 PM, TS [EMAIL PROTECTED] wrote:
  Hello everyone. I'm not sure what the budget is but, obviously inexpensive
  would be nice. Someone turned me on to PHPfox. Yet I don't have any others
  to compare it to. If you all would be so kind as to put a shout out and
 vote
  on your favorite, I'd be very grateful.

How about Chisimba? http://avoir.uwc.ac.za It is free (GPL) and has all
the features of PHPFox and more.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Template system in PHP

2008-02-14 Thread Paul Scott

On Thu, 2008-02-14 at 09:29 +0100, Zoltán Németh wrote:

 and by the way, symfony has YAML configuration files and a plugin for
 REST services.
 

and Chisimba does YAML configs in the blog module, REST, SOAP and
XML-RPC services as well as a whole whack of XML-ish things.

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Better DB Class MySQL

2008-02-14 Thread Paul Scott

On Thu, 2008-02-14 at 16:17 -0600, Richard Lynch wrote:
 And some have figured out that PDO does not quite live up to its
 promise (yet) and needs some more work...
 

I am finding this out the hard way, but just with MySQL and PostgreSQL
support (including MySQLi).

Portable, kinda, stable, not so much.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Session and Multi Server Architecture

2008-02-11 Thread Paul Scott

On Mon, 2008-02-11 at 23:03 +0530, chetan rane wrote:
  Can any one tell me what will be the best way to maintain session
 information on a Multi Server Architecture i.e a Web Cluster.

Memcached session handler. Provides failover as well as speeding things
up significantly.

Either that or in a db, but if you are already in clustering, you
probably have a memcached instance already right?

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Session and Multi Server Architecture

2008-02-11 Thread Paul Scott

On Mon, 2008-02-11 at 12:48 -0500, Nathan Nobbe wrote:

 http://us.php.net/manual/en/ref.memcache.php
 

and http://www.danga.com/memcached/

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Name of variable to string

2008-02-08 Thread Paul Scott

On Fri, 2008-02-08 at 14:37 -0500, Daniel Brown wrote:
 On Feb 8, 2008 2:18 PM, Eric Butera [EMAIL PROTECTED] wrote:
 And look who chimes in with some helpful advice!  ;-P
 

lol

(now isn't that even more useless?)

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Order directory output

2008-02-08 Thread Paul Scott

On Fri, 2008-02-08 at 21:19 -0500, Nathan Nobbe wrote:
 i hooked up an spl example; and the files are sorted by name.
 also, did you want that p inside or outside the span w/
 class=NormalText, because the opening and closing tags are
 mixed up..
 

Here is another, generic extension filter with SPL. Untested, and I have
just woken up, so if it doesn't work... :-P

class ExtensionFilter extends FilterIterator {

  private $ext; 
  private $it;

  public function __construct(DirectoryIterator $it, $ext) {
  parent::__construct($it);
  $this-it = $it;
  $this-ext = $ext;
  }
  public function accept() {
  if ( ! $this-it-isDir() ) {
$ext = array_pop(explode('.', $this-current()));
return $ext != $this-ext;
  }
  return true;
  }
}

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Exception handling in PHP

2008-02-07 Thread Paul Scott

On Wed, 2008-02-06 at 23:37 -0800, Prabath Kumarasinghe wrote:
 Does that mean for every exception do we have to write
 our custom exception and describe it from our own
 message
 

No, it means that when you want to throw a meaningful exception, you
need to type in a message. I mentioned custom exceptions, because that
is what I do, as I multilingualise my messages and do other things with
the exception, like display an XHTML page to the users.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Exception handling in PHP

2008-02-07 Thread Paul Scott


On Thu, 2008-02-07 at 00:20 -0800, Prabath Kumarasinghe wrote:
 Understood, Thanks Paul
 

Pleasure, but please don't top post, it makes it really hard to follow a
thread easily. Most people on this list take time out from their really
busy day jobs to help out, and the more time that everyone can save
them, the better.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Re: Multiple MySQL INSERT into loop

2008-02-07 Thread Paul Scott

On Thu, 2008-02-07 at 10:55 +, Colin Guthrie wrote:
 Simplest way would be to define your data in an array instead:
 
 e.g. $data = array(1 = array('id' = x, 'entry' = y, 'name' = z), ...).
 

And of course to tie it all into a transaction that can be rolled back
in case of problems.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Directory

2008-02-07 Thread Paul Scott

On Thu, 2008-02-07 at 12:30 -0600, Steve Marquez wrote:
 Could someone please point me in the right direction? I am trying to have
 PHP find out if a directory has files in it and then if it does, display and
 include, if it does not, then not display the include.

oooh, goodie! You get to play with my new favourite toys - SPL!

Try this:

public function lsDir($dir, $type='files')
{
$iterator = new RecursiveDirectoryIterator($dir);
foreach (new RecursiveIteratorIterator($iterator, 
RecursiveIteratorIterator::CHILD_FIRST) as $file)
{
if ($file-isDir()) {
$dirs[] = $file-getPathname();
} else {
$files[] = $file-getPathname();
}
}
if($type = 'files')
{
return $files;
}
else {
return $dirs;
}
}

(untested - written from mind dump - so please test 1st)

Then, AFAIK SPL also has an __autoload that you can use.

 I have looked at the Manual and did not really know where to look.
 

http://www.php.net/spl

--Paul

-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] killing a process through php webservice

2008-02-07 Thread Paul Scott

On Fri, 2008-02-08 at 09:56 +0500, Fahad javed wrote:
 I still think the problem is access rights. question is how to solve it.
 
 Any help will be greatly appreciated.
 

Yes it is access rights. You will probably have to add PHP to the root
or wheel group as a user or something insane like that. 

I know that the guys that coded the Freedom Toaster also had the same
issues with writing CD's, so do some research there as well (although I
don't think it was in PHP) and that should give you some ideas.

NOTE and Dsiclaimer: This is insane. I cannot think of a single case
where this is useful or sane. PHP is not meant to kill processes or do
root tasks at all, ever. Please don't actually do this.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Recommendation for an XML class?

2008-02-06 Thread Paul Scott

On Wed, 2008-02-06 at 15:12 -0500, Nathan Nobbe wrote:
 SimpleXML,
 http://www.php.net/manual/en/ref.simplexml.php
 

Dude, I thought you were playing with SPL! SimpleXML _then_ use the
SimpleXMLIterator to work with it!

http://www.php.net/spl

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] array problem with a zencart shipping module

2008-02-06 Thread Paul Scott

On Wed, 2008-02-06 at 23:42 -0500, Nathan Nobbe wrote:
 ouch, maybe you need to hire someone ?  besides this has more to do than
 just arrays; there is the rest of the application and clearly anyone whos
 going
 to help out must understand at least some of it..

Yeah, I concur! You really should at least understand what you are doing
before attempting a shopping cart scenario where presumably people are
going to be trusting you/your code with their hard earned dough.

If you don't know arrays, then how exactly are you going to make sure
that the thing is secure?

I would _seriously_ consider taking Nathan's advice here and hiring
someone to do this for you or even with you. With you has the advantage
that next time, you will know, and be able to do it easier - as well as
learn something along the way.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Exception handling in PHP

2008-02-06 Thread Paul Scott

On Wed, 2008-02-06 at 22:52 -0800, Prabath Kumarasinghe wrote:
 Hi All
 
 I'm little bit confusing with PHP exception handling.
 Could you able to explain how to put try{} and
 catch(){}  in a proper way in PHP. I had already read
 php exception manual but it didn't help me to get
 exact idea about exception handling in php.
 

Well, its pretty simple really...

In your objects that you create, just put in a statement that throws an
exception of some sort (I like to extend the built in exception handler
with a custom one that deals properly with db errors as well as PHP
ones) and then try{} and catch(){} them in your business logic.

example:

class someclass {

public function foo()
{
 // do something
 ...
 else {
 throw new Exception(uh-oh - we have a problem!);
 }
}

}

$thing = new someclass;
try {
$thing-foo();
}
catch(Exception $e) {
echo $e-getMessage();
exit;
}

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Exception handling in PHP

2008-02-06 Thread Paul Scott

On Wed, 2008-02-06 at 23:10 -0800, Prabath Kumarasinghe wrote:
 Is this following code work in PHP if mysql_connect
 fails.
 
 try{
 mysql_connect('localhost','user','');
 
 }catch(Exception $e){
   echo $e-getMessage();
 

Probably not. I don't think that the mysql functions throw exceptions on
failure. 

You will have to write a wrapper function to do the exception on
failure, so something like

function dbConnect()
{
   $conn = mysql_connect('','','');
   if(!$conn) {
   throw new Exception(Couldn't connect);
   }
   else {
   return $conn;
   }
}

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Anyone else doing PHP on Symbian?

2008-02-05 Thread Paul Scott

On Tue, 2008-02-05 at 14:44 +, George Pitcher wrote:

 I've recently installed PAMP (PHP, Apache, MySQL  Python) on my Nokia N95.
 I can do my development in Dreamweaver and move across to the phone and it
 all works.
 

Sounds intruiging! Care to share some resources/links as to how to set
up? I have a Sony/Ericsson P990i that I don't mind destroying with
insane hacks, and this sounds like fun!

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] how dod you get to do multiple mysql queries concurrently?

2008-02-05 Thread Paul Scott

On Tue, 2008-02-05 at 11:53 -0600, Richard Lynch wrote:
 This is actually pretty OT for the PHP list itself, really, unless you
 want to try to implement GIS in PHP, which would be a particularly Bad
 Idea (tm) due to the scale, scope, and calculations involved.
 

Err, sorry, but I must correct you there. PHP is used as one of the more
common GIS (Web mapping at least) languages. I use it extensively with
the UMN Mapserver (mapserver.gis.umn.edu) as PHP/Mapscript which you
compile into PHP as an extension to access your map data. The OT part
comes in with the actual guts of the db transaction, and the AJAX based
interfaces that everyone insists on these days.

PHP in this case is an extremely important aspect of web mapping, and I
have even used PHP to interface to GRASS and other GIS apps (OK now
_this_ is starting to be a Bad Idea(TM)).

Some of the largest web mapping and scientific apps run off
PHP/Mapscript (closest competitor is PythonMapscript).

Just to let you know...

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] how dod you get to do multiple mysql queries concurrently?

2008-02-05 Thread Paul Scott

On Mon, 2008-02-04 at 01:08 +0100, Jochem Maas wrote:
 the column spec. what kind of geomtery column is it? and

A geographical geometry i.e. a projected data set of Geo data.

 are you using it as a primary key? or some else

No, the integer gid is usually a primary key still. The geo data is
indexed though.

  ... if so what kind

AFAIK it is a modified bTree index - but I will have to look closer to
give you a more correct answer.

 of stuff are you storing in there? also in what way are you
 using it that gives you such a speed boost with queries?
 

Simply an index that is specific to a geometry.

 I read the mysql docs, I understand the principles but I'm having
 a hard time figuring out how to apply in practice in terms of
 making use of the performance gains you mentione ... specifically
 in a web environment where heavy queries are often along the lines
 of paginated data combined with user defined filters (e.g. a product
 list sorted by price, etc and filter on type/category/keyword/etc)
 

The web environment that we are talking about here is not really all
that webby ;) It is more of a web frontend to a _very_ powerful database
system...

 sorry if I'm sounding like a idiot :-)
 

Not at all, how do we learn if we don't ask questions? There is no such
thing as a stupid question, only stupid answers...

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Anyone else doing PHP on Symbian?

2008-02-05 Thread Paul Scott

On Tue, 2008-02-05 at 13:29 -0500, Daniel Brown wrote:
   Still debating what
 device I'll get next, but I want to use it as a mobile server myself.
 I had been working on a bound-for-trash PDA doing the same a while
 back, but with what we'll refer to as limited results.

I think that the key here is 

1. A decent ARM processor and a PHP build for ARM specifically (new
project??)

2. Enough RAM to be useful - at least figure out how to use a SD card or
something as a RAMDisk and use like a 2GB card?

3. Getting an entire LAMP stack on there as a package - no use messing
with things - otherwise people won't use it.

Just think of the possibilities though... I do a lot in the eLearning
sphere in PHP, and this type of thing could be a mobile eLearning server
for rural schools in Africa that is actually affordable! Students could
connect to it via thin clients or mobile phones and get an education all
in one.

--Paul



All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Fileinfo

2008-02-05 Thread Paul Scott

On Tue, 2008-02-05 at 22:49 -0800, Mad Unix wrote:
 I did what you recommended i get the same erorr
 

Depending on your distro, you may have 2 php.ini files. On debian based
systems there certainly are. One for Apache to use and another for cli.

Check that this is not the case first, you may just be using the
incorrect file.

At the end of the day, you could also just download the package, extract
it, phpize it make  make install it also and leave the problems
behind!

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Fileinfo

2008-02-05 Thread Paul Scott

On Tue, 2008-02-05 at 23:13 -0800, Mad Unix wrote:
 thanks it works now
 
 Libraries have been installed in:
/usr/local/src/Fileinfo-1.0.3/modules
 

Be sure to remember to add the extension to your php.ini now as well
with an extension= line and restart your server for the changes to take
effect.

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Schedule tasks from server

2008-02-04 Thread Paul Scott

On Mon, 2008-02-04 at 16:30 +0200, Pieter du Toit wrote:
 Is there a way that i can schedule tasks on my webserver that will 
 automatically fire on a certain time and date, without anyone visiting the 
 website?
 
 This domain is hosted by a ISP and not by me.

Ask your ISP if they support cron jobs - that'll do it. If they don't
then I would suggest moving ISP's.

I see you have an SA mail address - which ISP are you using? I probably
know the answer already if you can tell me ;)

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Schedule tasks from server

2008-02-04 Thread Paul Scott

On Mon, 2008-02-04 at 16:46 +0200, Pieter du Toit wrote:
 I am using paradigmsolutions.co.za. I read about cronjobs, but aparently it 
 is only available on unix or linux hosting, is this true?

Well, why not just host on *nix then? I see your site is a MS Frontpage
one, but most linux based ISP's also support that anyway. That way you
get the best of both worlds.

Err, just one question though, if you are using FP, where does the PHP
come in?

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] php competion

2008-02-03 Thread Paul Scott

On Sun, 2008-02-03 at 20:10 +1100, doc wrote:
 come on people try you skills at 
 
 http://www.rhwebhosting.com/comp/index.php

Reworded as:

Redesign our complete web presence and give us a couple of apps that we can 
flog to our clients,
and we *may* give you a consolation prize.

Yeah right.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Resetting a session variable

2008-02-03 Thread Paul Scott

On Sun, 2008-02-03 at 13:14 -0500, Ron Piggott wrote:
 What is the command to reset a session variable --- essentially deleting
 all of the values it contains?  Ron

Assign the session to an empty array() and then use session_destroy()



All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] about preg_replace, please help !

2008-02-03 Thread Paul Scott

On Sun, 2008-02-03 at 21:06 -0800, Casey wrote:

 Why do you need preg_replace?
 

Else he fails a homework assignment?

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] how dod you get to do multiple mysql queries concurrently?

2008-02-01 Thread Paul Scott

Did anyone actually get this mail?

More concrete example? What would you like to see?

I suspect that some of my mail is getting dropped :(

--Paul

On Fri, 2008-02-01 at 06:33 +0200, Paul Scott wrote:
 On Fri, 2008-02-01 at 03:40 +0100, Jochem Maas wrote:
 
  I for one would really like to see a concrete example of this kind of
  use of geometry columns and spacial indexes as an alternative to the stand
  integer based primary keys.
 
 
 On one of my local postGIS tables:
 
 CREATE INDEX k1
   ON kanagawa
   USING gist
   (the_geom);
 
 
 A gist index is a GEOS based spatial index. You will need GEOS to create
 one.
 
 When loading spatial data, your geometry column looks like so:
 
 01050001000102000C0011ECE564CF7561404A8999CCDABC4140E5C0981ACE75614012901CD641BD4140603C8386BE756140E525611B40BD41405BF216D3BD756140151DC9E53FBD414054DC1A4DBD756140760B997A3FBD414012219BD1BC756140D20823E33EBD41407AB2884EBC7561400F2110243EBD41404571B4D0BB756140CC0C6A213DBD4140F707192ABB7561405DF2A1803CBD4140F0F11CA4BA756140C3D1B7413CBD4140E89CB2ADB97561406F046D233CBD414017D4B7CCA97561406D47AD7F39BD4140
 
 Which is WKB (Well Known Binary) data or WKT (Well Known Text) data. The
 gist index simply indexes this as opposed to the regular gid (which you
 still use btree indexes on anyways)
 
 --Paul
 
 All Email originating from UWC is covered by disclaimer 
 http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Re: [Slightly OT] Apple MacBook MAMP and Logic

2008-02-01 Thread Paul Scott

On Fri, 2008-02-01 at 10:58 +, Colin Guthrie wrote:
 That's just how sudo works tho' right? You can configure sudo to not
 require a password for certain commands run by certain users. Not sure
 how it works on the mac as there may be some kind of wrapper but I'm
 sure there would be a way to allow your user to not enter a password for
 loading xampp It's a mac. It's like *nix. It's tweakable ;)
 

For sure! Although not recommended, I change that behaviour as soon as I
finish installing my system (generally Ubuntu). I really *hate* typing
my password on my own system!

What I do is create a root login by using sudo passwd root

which asks for my password (one last time) then I get to have a root
pass.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] array iteration vs. ArrayIterator

2008-02-01 Thread Paul Scott

On Fri, 2008-02-01 at 11:11 -0600, Greg Donald wrote:
 Thanks for the benchmark.
 

Yes, thanks! It has just confirmed what I have been experiencing as
well. 

I am busy converting a static site to a Chisimba CMS based site at the
moment with 43 000 odd static, frontpage generated HTML pages. I have
cut down processing times and regex times on the content from around 15
minutes to a few seconds (well waaay less than a minute anyway).

During the course of all of this, I have managed to create quite a few
SPL based classes that extend various aspects of the iterators
especially, which I will share soon if anyone is interested.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Calling All Opinionated ******** ....

2008-02-01 Thread Paul Scott

On Fri, 2008-02-01 at 22:18 +0100, Jochem Maas wrote:
 I'd like to hear from people who have or are using ZF with regard to their
 experiences, dislikes, likes, problems, new found fame and fortune, etc ... 
 but
 only if it concerns ZF.
 

I have integrated a few ZF components into the Chisimba framework -
search_lucene, Http_request, and a few others so far, and they are OK. I
find some of the bits really slow, but solid, others perform well.

My biggest gripe with ZF components is that the Exception handler
Zend_Exception, is sometimes tricky to override with the native Chisimba
customException handler (which produces pretty output as opposed to an
ugly call stack, and logs the ugly things (user wise) to a log file).
Sometimes it takes a few more minutes of time.

Basically, I would say evaluate each component on its own merit. If you
would like to use one, check the code and run some performance tests on
it - sometimes you will be able to roll your own in less time and with
simpler code.

--Paul 

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] how dod you get to do multiple mysql queries concurrently?

2008-01-31 Thread Paul Scott

On Fri, 2008-02-01 at 03:40 +0100, Jochem Maas wrote:

 I for one would really like to see a concrete example of this kind of
 use of geometry columns and spacial indexes as an alternative to the stand
 integer based primary keys.


On one of my local postGIS tables:

CREATE INDEX k1
  ON kanagawa
  USING gist
  (the_geom);


A gist index is a GEOS based spatial index. You will need GEOS to create
one.

When loading spatial data, your geometry column looks like so:

01050001000102000C0011ECE564CF7561404A8999CCDABC4140E5C0981ACE75614012901CD641BD4140603C8386BE756140E525611B40BD41405BF216D3BD756140151DC9E53FBD414054DC1A4DBD756140760B997A3FBD414012219BD1BC756140D20823E33EBD41407AB2884EBC7561400F2110243EBD41404571B4D0BB756140CC0C6A213DBD4140F707192ABB7561405DF2A1803CBD4140F0F11CA4BA756140C3D1B7413CBD4140E89CB2ADB97561406F046D233CBD414017D4B7CCA97561406D47AD7F39BD4140

Which is WKB (Well Known Binary) data or WKT (Well Known Text) data. The
gist index simply indexes this as opposed to the regular gid (which you
still use btree indexes on anyways)

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

[PHP] Release candidate: Chisimba-2.0.0RC1

2008-01-31 Thread Paul Scott

The next major release of the Chisimba PHP5 framework is now available.

Major enhancements included in this release are:

 - Remote downloads of modules through web interface
 - Upgrades of modules via package server in modulecatalogue
 - Skin downloads via remote package server
 - Updates to modules and core framework now taken care of via remote
 - Better use of caching mechanisms (fixed a lengthy file compile for
APC in engine class)
 - Major bugfixes to the e-Learning modules and context
 - Major improvements on usability for context
 - Additional skins to play around with

and, of course, new modules to add onto your installation!

Please take a look, download it and give it a test drive! 
 
Chisimba, for those that don't know it already, is a PHP5 framework made
in Africa, for Africa. It is a collaboration between around 16 African
Universities, as well as around 35 active developers from around the
continent.
 
It can be downloaded from AVOIR at:
 
http://cvs2.uwc.ac.za/chisimba_releases/chisimba_framework_2-0-0-rc1.tgz

or

http://cvs2.uwc.ac.za/chisimba_releases/chisimba_framework_2-0-0-rc1.zip

and the documentation wiki can be found at:
 
http://avoir.uwc.ac.za/avoir/index.php?module=wiki

The Chisimba Book will be made available with Chisimba-2.0.0 (i.e. after
the RC's have passed the test).

There are server setup instructions, as well as installation
walkthroughs available linking from the main AVOIR site:
 
http://avoir.uwc.ac.za/avoir/index.php?module=cmsaction=pageid=gen12Srv48Nme23_207
 
This is a major upgrade to previous Chisimba installations, so if you
are already using Chisimba, please consider upgrading immediately!

For those interested in developing a module, or just getting some
additional info please take a look at:
 
http://avoir.uwc.ac.za/avoir/index.php?module=cmsaction=pageid=gen12Srv48Nme23_208

Please report any issues on the mailing list(s) or in our bug tracking system:

http://mailman.uwc.ac.za/mailman/listinfo/nextgen-users
http://avoir.uwc.ac.za/mantis/

-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] how to display photos of the day?

2008-01-29 Thread Paul Scott

On Tue, 2008-01-29 at 18:33 +0800, jeffry s wrote:

 i have a mysql table contain data about 1000 rows. i want to display any of
 the photos randomly
 and it is fixed for one day.
 

MySQL has a rand() function, so you could bomb that off as a select once
a day on cron or something, or you could do a regular select and
array_rand() it in PHP.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] How can I do this -- method chaining

2008-01-29 Thread Paul Scott

On Tue, 2008-01-29 at 14:17 -0500, Eric Butera wrote:

 http://www.travisswicegood.com/index.php/2007/10/26/fluent_api_here_i_come
 


Looks like a repurpose of one of my posts:

http://fsiu.uwc.ac.za/index.php?module=blogaction=viewsinglepostid=gen9Srv59Nme5_7092_1182404204

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Getting nuequiz pro wo to work in php5

2008-01-28 Thread Paul Scott

On Mon, 2008-01-28 at 11:49 -0500, Nathan Nobbe wrote:
 ive always thought about trying moodle for this purpose.

Not to rag Moodle or anything, but trying to customize that thing is a
nightmare. Besides, if you are willing to try out Chisimba, you can
always ask me :)

There is a test install at http://pear.uwc.ac.za/elearn/ that you can
play around with. The admin username and password are available too
(just mail me) if you want to take an in depth look.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Posting Summary for Week Ending 25 January, 2008: php-general@lists.php.net

2008-01-28 Thread Paul Scott

On Mon, 2008-01-28 at 16:43 +0100, Zoltán Németh wrote:
 where is the stats for last week? the experiment is over or what? ;)
 

Jochem already did it for this week, so I think Dan is taking the week
off.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] how dod you get to do multiple mysql queries concurrently?

2008-01-28 Thread Paul Scott

On Mon, 2008-01-28 at 12:29 -0600, Richard Lynch wrote:
 Back on the mysql side of things, try using geometry columns rather
 than numerical primary keys, with spatial indexes.. it's a MASSIVE
 performance upgrade (I've cut 5 second queries down to 0.005 by using
 geo columns)
 
  Uh, could you could elaborate a bit on that (whilst I go and do some
  googling)?
 
 If you are doing geography/geometry stuff, spatial indices can be nice.
 
 I suspect that massive performance upgrade just came from having what
 is essentially a multi-field index, because MySQL can only use *ONE*
 index per query.

Yeah, for sure! You will need to use GEOS to index those rows. Also, if
your database is getting large, consider switching to PostGIS on
Postgres, as opposed to MySQL. The MySQL spatial extension is still
quite new and immature compared to PostGIS. I routinely create and
manage databases of over 10 million rows of spatial data on PostGIS, and
have never needed to look further.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Getting nuequiz pro wo to work in php5

2008-01-28 Thread Paul Scott

On Mon, 2008-01-28 at 08:35 -0800, Jim Lucas wrote:
 Well, since this quiz app doesn't work.  Does anybody have suggestions 
 on a good tool to use for in-house/office training?  Sort of like an 
 employee initial training or evaluation quiz application.  Guess it 
 doesn't have to be just for employment purposes, but something that 
 works with PHP5.

Well, you could always help test and evaluate the Chisimba e-learning
stuff, due for release at end of March. The quiz stuff I think is
complete, and should be usable now.

http://avoir.uwc.ac.za/ and go to the Chisimba section.

Oh, hang on, you will need an anonymous CVS checkout to actually use the
v2 stuff now. sigh, will be released as a RC next week.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Getting part of string matched with regular expressions

2008-01-27 Thread Paul Scott

On Mon, 2008-01-28 at 14:28 +0900, Teck wrote:
 I was using preg_replace for this, and try to delete (i.e., replace  
 the non-matched part with an empty string) the second part, but I  
 can't make it work.

Rather use preg_match_all() as that will produce an array of values,
with the first value being the original that you can then compare with.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Posting Summary for Week Ending 25 January, 2008: php-general@lists.php.net

2008-01-23 Thread Paul Scott

On Thu, 2008-01-24 at 01:13 +0100, Jochem Maas wrote:
 stats while I'm at it ... I've been busy wracking my brain trying to
 figure out
 the setup for a load-balanced configuration for one of my major
 clients ... at least
 a system capable of migrating to loadbalancing ... global file system,
 virtual machines,
 all that jazz. I'm in over my head as usual.

Have you taken a look at LVS yet? I presume  that you are not attempting
this on a Windows cluster - right?

http://www.linuxvirtualserver.org/

I just had to do the same thing for my University systems - come up with
an architecture at least. If you would like the dox, let me know - they
are all CC licensed.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] performance/load testing ...

2008-01-21 Thread Paul Scott

On Mon, 2008-01-21 at 10:50 +0100, Jochem Maas wrote:
 Does anyone have any tips, urls, advice as to how to start
 going about creating something like a 'test suite' for testing
 high load performance of a website?
 

I went through a similar headache recently, and looked at a whole whack
of testing suites that are available. You can take a look at
http://www.opensourcetesting.org/performance.php first, but I ended up
using Apache JMeter most. It really is quite configurable and usable and
gives you a lot of information.

--Paul
-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Re: Posting Summary for Week Ending 18 January, 2008: php-general@lists.php.net

2008-01-20 Thread Paul Scott

On Sun, 2008-01-20 at 10:04 -0500, Daniel Brown wrote:
 That would actually be pretty interesting.  Since we've all been
 known to beat a thread to death, it certainly wouldn't be difficult to
 collect the data.

FWIW, I would like to continue to see these postings, as mailing list
metrics are quite interesting. I have been watching this thread with
quite a bit of interest, as I would like to do something similar with
the mailing lists for my project(s). Those projects answer to funders,
and one of the metrics that our funders would like to see, is mailing
list stats. If you do a quick google for mailman stat packages, you will
see that they are sorely lacking, so, even though this particular list
is not run on mailman, Dan's script could be the start of a *really*
useful project for me and others. 

Only thing is that Dan has not posted a link to the source, nor has he
signified that he will. I have also seen a bunch of requests for graphs
and such, which I would be willing to add on in some time.

Bottom line is, I find this really interesting and useful, and would
like to use it elsewhere too.

THANKS DAN! You are at least in the top ten coolest guys in the
world

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Digital Downloads and Scale

2008-01-20 Thread Paul Scott

On Mon, 2008-01-21 at 02:43 +0100, Jochem Maas wrote:
 use simple code, optimize your db and go and read up on everything you can 
 find
 about optimizing [download] connections on your webserver ... these spring to
 mind
 

In addition to optimizing code and db (I presume that includes using
things like memcacheD, APC and a clustered db system), you should also
take a look at using something like LVS and lighthttpd to serve your
static content.

If your webserver is getting busy fulfilling requests to a download
file, simply pass the download bit to a static server running a
lightweight httpd and nothing else. Files are completely static, so this
is really quite a cool solution for this type of situation.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] Re: Match anything between two that is not a except if it is escaped...

2008-01-18 Thread Paul Scott

On Fri, 2008-01-18 at 12:28 +0200, Nikolay Ananiev wrote:
 This is for double quotes:
 '/[^]*(?:.[^]*)*/'
 
 this is for single:
 '/\'[^\']*(?:.[^\']*)*\'/'
 
 i took these from the smarty compiler class.

Has anyone started a commonly used PCRE Regexp library? It could be a
simple wiki page or something (we had one on our old site that was
getting quite large - but that is now gone - sigh)

Anyway, is anyone up for that? These things come up pretty often, and
having a library of common ones would save us all a lot of effort in
these types of threads. Something like:

Purpose: 
regex  : 
Author : 


Thoughts? We could use
http://fsiu.uwc.ac.za/index.php?module=wikiaction=view_pagename=RegularExpressionMethods
 for it.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

Re: [PHP] XAdES in PHP

2008-01-14 Thread Paul Scott

On Mon, 2008-01-14 at 10:59 -0600, Richard Lynch wrote:
 After a quick Google to find out what the Hades is XAdES, I'd suggest
 you look for a C implementation and link it in as an extension.

There are a couple of implementations of XMLDSIG in PHP that I have
seen, although none really up to scratch IMO. You could try one of those
(I think there is a pretty decent Python implementation as a starting
point) and fix it up and extend that.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

[PHP] Chisimba Release

2007-12-20 Thread Paul Scott

The next release of the Chisimba PHP5 framework is now available.

Major enhancements included in this release are:

 - Better APC support
 - Improved database performance
 - Bug fixes
 - Better code documentation
 - XML-RPC API for Video conversions module
 - XML-RPC API for the Active Dynamic Mirroring module
 - Context improvements and bug fixes
 
and, of course, new modules to add onto your installation!

Please take a look, download it and give it a test drive! 
 
Chisimba, for those that don't know it already, is a PHP5 framework made
in Africa, for Africa. It is a collaboration between around 16 African
Universities, as well as around 35 active developers from around the
continent.
 
It can be downloaded from AVOIR at:
 

http://cvs2.uwc.ac.za/chisimba_releases/chisimba_framework_1-1-3.zip
http://cvs2.uwc.ac.za/chisimba_releases/chisimba_modules_1-1-3.zip

and the doc wiki can be found at:
 
http://avoir.uwc.ac.za/avoir/index.php?module=wiki

There are server setup instructions, as well as installation
walkthroughs available linking from the main AVOIR site:
 
http://avoir.uwc.ac.za/avoir/index.php?module=cmsaction=pageid=gen12Srv48Nme23_207
 
For those interested in developing a module, or just getting some
additional info please take a look at:
 
http://avoir.uwc.ac.za/avoir/index.php?module=cmsaction=pageid=gen12Srv48Nme23_208

-- 
.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za   |
::

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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

  1   2   3   >