[PHP] Organising PHP projects

2004-07-27 Thread Howard Miller
I have come to PHP from Java and am finding managing large/enterprise 
projects using lots of includes and suchlike rather tricky and error prone.

Are there any projects and/or best-practice documentation for describing 
 a good way to organise large projects with lots of files and/or 
classes. I have an idea that some sort of semi-automatic system would be 
nice.

Sorry for vague question - but its a bit of a vague problem.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: is there any function can list all files in a directory?

2004-07-27 Thread Howard Miller
Sheawh wrote:
thanks all
http://www.php.net/manual/en/ref.filesystem.php
...have a look at the user submitted examples at the bottom of the page.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Accessing SMB (Samba perhaps) resources

2004-02-24 Thread Howard Miller
Hi,

I want to be able to manipulate files that are on my samba file server from
my PHP application. These shares are not normally mounted on my web server
and it would be inconvenient and yet another administative maintenance task
to do so.

So... I want to be able to present a form to the user where they can type a
URL (eg, //my.sambaserver/myshare/some/directory), a username and a
password and for PHP to be able to manipulate the files therein.

Maybe this is easy, but I can't see how to do it!! Any help appreciated.

Thanks!!

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



[PHP] Accessing SMB (Samba perhaps) resources

2004-02-24 Thread Howard Miller
Hi,

I want to be able to manipulate files that are on my samba file server from
my PHP application. These shares are not normally mounted on my web server
and it would be inconvenient and yet another administative maintenance task
to do so.

So... I want to be able to present a form to the user where they can type a
URL (eg, //my.sambaserver/myshare/some/directory), a username and a
password and for PHP to be able to manipulate the files therein.

Maybe this is easy, but I can't see how to do it!! Any help appreciated.

Thanks!!

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



[PHP] Encrypted Zip Files

2004-02-24 Thread Howard Miller
Hi (again),

I need to unzip (in/from PHP) files that have been zipped using pkzip on a
windows machine using a password.

Has anybody any thoughts on how to do this. I was just going to call a
command line program (if I can find one!), but thought I would ask if there
is something cleverer.

Thanks!!

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



[PHP] Re: MySQL update

2004-02-24 Thread Howard Miller
You can't

well, not via PHP anyway. You would need to do a select first to establish
if any of these values exist in the database. Something like...

select first,last,email from mytable where first=x or last=y or email=z;

then check which one of first,last,email is non-empty.

BUT.. do you *realy* want firstname and lastname to be unique??

HM

 

Matthew Oatham wrote:

> Hi,
> 
> I have an update statement that tries to update a number of values - these
> values have unique value constraint so when I do the update it will either
> succeed or fail. If it fails how can I determine where the update failed.
> i.e. pinpoint the value that was not unique?
> 
> At the moment I am doing ...
> 
> $sql = mysql_query("UPDATE dis_user SET first_name = '$firstName',
> last_name = '$lastName', email_address = '$emailAddress' WHERE user_id =
> '$userId'");
> 
> if(!$sql) {
> echo "Data not inserted due error";
> }
> 
> How can I improve on the above to give specific error information.
> 
> Thanks
> 
> Matt

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



RE: [PHP] MySQL update

2004-02-24 Thread Howard Miller
I am prepared to be wrong (but I'm too lazy to go and try it)...

does MySql return a detailed enough error message to detect *which* field
caused the problem. IIRC, I don't think it does.

Anyway *if* it does it will be in here...

http://www.mysql.com/doc/en/Error-returns.html

DUP UNIQUE I guess.

HM



Jay Blanchard wrote:

> [snip]
> How can I improve on the above to give specific error information.
> [/snip]
> 
> 
> Use mysql_error() http://www.php.net/mysql_error

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



Re: [PHP] Accessing SMB (Samba perhaps) resources

2004-02-24 Thread Howard Miller
Well, mainly because PHP doesn't (I think) have a mount function. It would
mean executing an external command. I always regard that as living a bit
dangerously - it can be difficult to write robust code that will recover
from a problem that way. 

Adam Voigt wrote:

> Why can't you just mount the share on-the-fly when they enter the
> username and pass?
> 
> 
> On Tue, 2004-02-24 at 06:11, Howard Miller wrote:
>> Hi,
>> 
>> I want to be able to manipulate files that are on my samba file server
>> from my PHP application. These shares are not normally mounted on my web
>> server and it would be inconvenient and yet another administative
>> maintenance task to do so.
>> 
>> So... I want to be able to present a form to the user where they can type
>> a URL (eg, //my.sambaserver/myshare/some/directory), a username and a
>> password and for PHP to be able to manipulate the files therein.
>> 
>> Maybe this is easy, but I can't see how to do it!! Any help appreciated.
>> 
>> Thanks!!

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



[PHP] Re: Accessing SMB (Samba perhaps) resources

2004-02-25 Thread Howard Miller
Aha!

This looks really cool! Why can I never find this sort of stuff :-)

Thanks very much.

Howard


Manuel Lemos wrote:

> Hello,
> 
> On 02/24/2004 08:11 AM, Howard Miller wrote:
>> I want to be able to manipulate files that are on my samba file server
>> from my PHP application. These shares are not normally mounted on my web
>> server and it would be inconvenient and yet another administative
>> maintenance task to do so.
>> 
>> So... I want to be able to present a form to the user where they can type
>> a URL (eg, //my.sambaserver/myshare/some/directory), a username and a
>> password and for PHP to be able to manipulate the files therein.
> 
> You may want to try this Samba Web client class that does precisely what
> you want:
> 
> http://www.phpclasses.org/smbwebclient
> 

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



Re: [PHP] Re: Accessing SMB (Samba perhaps) resources

2004-02-25 Thread Howard Miller
No I didn't say that I *wouldn't* run external commands. However I want the
operation to be transparent and non-confusing to the user, so they don't
get get with error messages from the Unix mount command or something. I
just expected a lot of grief/drama doing it that way.

I'll give the class a go and see how I get on.

Manuel Lemos wrote:

> Hello,
> 
> On 02/24/2004 04:03 PM, Adam Voigt wrote:
>> He said he doesn't want to run commands, which this script does.
> 
> Did he? I read his message again and I could not see where he explicitly
> says he does not want to run commands.
> 
> What this class does is to let you access networked remote shares via
> Samba without having to mount them on the local file system.
> 
> 
I want to be able to manipulate files that are on my samba file server
from my PHP application. These shares are not normally mounted on my web
server and it would be inconvenient and yet another administative
maintenance task to do so.

So... I want to be able to present a form to the user where they can
type a URL (eg, //my.sambaserver/myshare/some/directory), a username and
a password and for PHP to be able to manipulate the files therein.
>>>
>>>You may want to try this Samba Web client class that does precisely what
>>>you want:
>>>
>>>http://www.phpclasses.org/smbwebclient
> 
> 

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