Re: [PHP] Re: php framework, large site

2007-06-18 Thread Robert Cummings
On Tue, 2007-06-19 at 13:41 +0800, Crayon Shin Chan wrote:
> On Tuesday 19 June 2007 09:35, Robert Cummings wrote:
> 
> > Ah but it is quite possible that the OP will go ahead and try to build
> > a framework, he may fail miserably, all the while learning from his
> > mistakes. Then he may try again and subsequently build a kickass
> > framework. 
> 
> In the pragmatic world where you're working on a project, for a living, to 
> a time schedule, then learning from other people's mistakes is less time 
> consuming than creating your own mistakes, recognise that they are 
> mistakes and then learn from them.
> 
> Of course if you invoke your "it's only for fun" defence then pragmatism 
> wouldn't come into it and whatever you do or don't do doesn't really 
> matter.

I wouldn't call it a defence. It's a point of view.

> > Since not all paths lead to the same conclusion it is just 
> > as possible that if he doesn't go down this path that he will never
> > create a kickass framework no matter how many frameworks he studies.
> 
> Now you're trudging into the realms of philosophy, crystal ball gazing and 
> groundless speculation.

No, it's simple probability.

> > Some of the greatest science comes from those unaware of established
> > rules and theories.
> 
> I'm sure most people on the list aren't looking to make revolutionary 
> advances in php programming. Most are simply looking for practical 
> answers to practical questions.

And many will encounter serendipity along the way regardless of what
they are looking to achieve.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread Crayon Shin Chan
On Tuesday 19 June 2007 09:35, Robert Cummings wrote:

> Ah but it is quite possible that the OP will go ahead and try to build
> a framework, he may fail miserably, all the while learning from his
> mistakes. Then he may try again and subsequently build a kickass
> framework. 

In the pragmatic world where you're working on a project, for a living, to 
a time schedule, then learning from other people's mistakes is less time 
consuming than creating your own mistakes, recognise that they are 
mistakes and then learn from them.

Of course if you invoke your "it's only for fun" defence then pragmatism 
wouldn't come into it and whatever you do or don't do doesn't really 
matter.

> Since not all paths lead to the same conclusion it is just 
> as possible that if he doesn't go down this path that he will never
> create a kickass framework no matter how many frameworks he studies.

Now you're trudging into the realms of philosophy, crystal ball gazing and 
groundless speculation.

> Some of the greatest science comes from those unaware of established
> rules and theories.

I'm sure most people on the list aren't looking to make revolutionary 
advances in php programming. Most are simply looking for practical 
answers to practical questions.

-- 
Crayon

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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread Crayon Shin Chan
On Tuesday 19 June 2007 09:12, Nathan Nobbe wrote:

> it seems to me most people use the terms flavor and distribution
> interchangeably when referring to linux.

Yeah and most people forget that linux (the kernel) is only a tiny part of 
a "linux distribution".

> although gentoo linux [the only os i run] is designed on the same
> basic concept of freeBSD it is entirely unique; basically a freeBSD
> rewrite w/ the linux kernel; o, it can run w/ the freeBSD kernel too.
> in effect a completely new breed of os was born; and i didnt catch
> that one on your list; probly because it is essentially "distro Z", so
> to speak.

I use gentoo too. I didn't mention it because it has relatively few 
derivatives.

-- 
Crayon

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



Re: [PHP] Php script diagnostic app?

2007-06-18 Thread Guillaume Theoret

Thanks a lot for that post Paul.

It brings up a question though. You said to never ever use that on a
production server (an important disclaimer!) so I was wondering what
people here used to log and simulate loads. I've used OpenSTA (
http://opensta.org/ ) and I was pleased with the results but it only
works with windows. What do you guys generally use under linux? Just
squid? Something else?

I suppose I can just set up a windows box if I have to since OpenSTA
acts as a transparent gateway but if there's a good linux solution out
there for recording usage and playing it back concurrently I'd like to
hear about it. With OpenSTA to create a test script it's as easy as
clicking the record button to create the script and stop when you're
done. Then you can go in and manually edit the script if you like and
you can play it back as many times as you'd like concurrently (thereby
simulating many users). Anyone know of anything like this?

Thanks

On 6/18/07, Paul Scott <[EMAIL PROTECTED]> wrote:


On Mon, 2007-06-18 at 06:39 +0200, Paul Scott wrote:
> If you would like a more detailed HOWTO, please let me know, and I will
> write up something for you.

http://fsiu.uwc.ac.za/index.php?module=blog&action=viewsingle&postid=gen9Srv59Nme5_9262_1182142431&userid=3897070607

--Paul


All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm


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



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



Re: [PHP] RE: [Updated] Previous and Next Month and Year

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 21:36 -0600, Keith Spiller wrote:
> Hi Guys,
> 
> RE:  [Updated] Previous and Next Month and Year
> 
> Here is part of my code:
> 
>   $month = 6;
>   // Current month value, but changes changes with next/prev links.
>   // Value used by a mini calendar script "phpcalendar"...
>   // Originally derived via:  $month = date('n', time());
>   // And updated with $month = $month +1 for next month
>   // And $month = $month -1 for next month
>   // So the value will be 1 through 12 for current year's months.
>   // And 0, -1, -2 etc. for last year and 13, 14 etc. for next year.
> 
>   $prev_month = date('F Y', mktime(0, 0, 0, date("m")-$month, date("d"), 
> date("Y")));
>   $next_month = date('F Y', mktime(0, 0, 0, date("m")+$month, date("d"), 
> date("Y")));
> 
>   echo "Month: $month  \n";
>   echo "Prev: $prev_month  \n";
>   echo "Next: $next_month  \n";
> 
> The result:
>   Month: 6
>   Prev: December 2006
>   Next: December 2007
> 
> The desired results would be:
>   Month: 6
>   Prev: May 2007
>   Next: July 2007
> 
> And needs to bear in mind the year...
> 
> The phpcalendar script is working perfectly with my own next
> and prev month links using $month +1 and $month -1.  So I am
> trying to get my Event boxes to work in the same way listing
> the previous month, current month and next month.



Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] RE: [Updated] Previous and Next Month and Year

2007-06-18 Thread Keith Spiller

Hi Guys,

RE:  [Updated] Previous and Next Month and Year

Here is part of my code:

 $month = 6;
 // Current month value, but changes changes with next/prev links.
 // Value used by a mini calendar script "phpcalendar"...
 // Originally derived via:  $month = date('n', time());
 // And updated with $month = $month +1 for next month
 // And $month = $month -1 for next month
 // So the value will be 1 through 12 for current year's months.
 // And 0, -1, -2 etc. for last year and 13, 14 etc. for next year.

 $prev_month = date('F Y', mktime(0, 0, 0, date("m")-$month, date("d"), 
date("Y")));
 $next_month = date('F Y', mktime(0, 0, 0, date("m")+$month, date("d"), 
date("Y")));


 echo "Month: $month  \n";
 echo "Prev: $prev_month  \n";
 echo "Next: $next_month  \n";

The result:
 Month: 6
 Prev: December 2006
 Next: December 2007

The desired results would be:
 Month: 6
 Prev: May 2007
 Next: July 2007

And needs to bear in mind the year...

The phpcalendar script is working perfectly with my own next
and prev month links using $month +1 and $month -1.  So I am
trying to get my Event boxes to work in the same way listing
the previous month, current month and next month.

Thanks,


Keith 


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



Re: [PHP] Date

2007-06-18 Thread Larry Garfield
On Monday 18 June 2007, Robert Cummings wrote:
> On Mon, 2007-06-18 at 21:57 -0400, Ron Piggott wrote:
> > If
> >
> > $expiry_date = "2007-10-17";
> >
> > How do I add 7 days to this?  I know the strtotime("+7 days"); command,
> > but don't know how to make it work with a date that isn't today.
>
> You would do:
>
> strtotime( '+7 days', $time );
>
> The $time is a unix timestamp... so you'll need to convert $expiry_date
> to a unix timestamp. You can take a look at the mktime() function for
> more information.

Just be meta about it.

strtotime('+7 days', strtotime($expiry_date)); 

Ta da! :-)

(Note: strtotime() is probably not the fastest to execute way of doing it, but 
it's the fastest to write.  Choose wisely.)

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



Re: [PHP] Date

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 21:57 -0400, Ron Piggott wrote:
> If
> 
> $expiry_date = "2007-10-17";
> 
> How do I add 7 days to this?  I know the strtotime("+7 days"); command,
> but don't know how to make it work with a date that isn't today.

You would do:

strtotime( '+7 days', $time );

The $time is a unix timestamp... so you'll need to convert $expiry_date
to a unix timestamp. You can take a look at the mktime() function for
more information.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Date

2007-06-18 Thread Ron Piggott

If

$expiry_date = "2007-10-17";

How do I add 7 days to this?  I know the strtotime("+7 days"); command,
but don't know how to make it work with a date that isn't today.

(Please respond directly to my e-mail address)

Ron


Re: [PHP] Comparing string to array

2007-06-18 Thread Larry Garfield
Perhaps you're looking for in_array()?

On Monday 18 June 2007, Richard Davey wrote:
> Hi all,
>
> Ok it's 2am, my brain has gone to mush and I am having trouble
> figuring out an easy way to do this, can anyone shed some light?
>
> Take a peek at the following code:
>
> // START
> 
>  print_r($_POST);
>
> $userparam = "test['sam'][]";
>
> //  How to check if $userparam exists in the $_POST array
> //  and get all the values from it?
>
> //  Obviously this won't work, but you get the idea:
> if (isset($_POST[$userparam]))
> {
> echo 'yeah';
> $values = $_POST[$userparam];
> }
> else
> {
> echo 'nah';
> }
> ?>
> 
>
> 
>
> red
> green
> blue
> red2
> green2
> blue2
>
> 
>
> 
> // END
>
> From the code above I'm trying to figure out how to tell if the
> $userparam exists in the $_POST array. PHP automatically expands the
> form element name into multi-dim arrays within $_POST, so a simple
> 'isset' as shown in the code above won't play because it's got a
> totally useless array key passed to it.
>
> I need a way to turn the string:
>
> "test['sam'][]"
>
> into something I can look into $_POST for.
>
> Any ideas? The coffee boost is wearing off, but I want to get this
> licked tonight :-\
>
> Cheers,
>
> Rich
> --
> Zend Certified Engineer
> http://www.corephp.co.uk
>
> "Never trust a computer you can't throw out of a window"


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



Re: [PHP] generate images of register definitions

2007-06-18 Thread Mike Frysinger

On 6/9/07, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Sat, June 9, 2007 4:27 pm, Mike Frysinger wrote:
> anyone know of some software to generate images like this:
> http://wh0rd.org/register.png
> idea is i have a list of registers and their bit meanings, and i want
> to automatically generate images like the above one from this data
>
> yes, i can write some custom code in PHP using GD, but i'd much rather
> use someone else's work than start from scratch

It's remotely possible that you could hack something from JP Graph to
look not completely unlike that...

Though I suspect you might find it easier to start from scratch,
honestly...


yeah ive just started from scratch ... here's what ive got so far in
case anyone happens to wander across this ...

$reg = new register("WDOG_CTL", "Watchdog Control Register",
0xFFC00200, 0x0AD0, 16,
   array(
   array(15, 15, "WDRO", "0 - Watchdog timer has not expired\n1 -
Watchdog timer has expired", W1C),
   array(11, 4, "WDEN", "0xAD - Counter disabled\nAll other
values - Counter enabled"),
   array(2, 1, "WDEV", "00 - Generate reset event\n01 - Generate
NMI\n10 - Generate GP interrupt\n11 - Disable event generation")
   )
);
register_to_png($reg);

http://wh0rd.org/register2.png

maybe i'll start a cheesy sf project for it
-mike

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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 21:12 -0400, Nathan Nobbe wrote:
> On 6/18/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:
>
> > > and you never know a new one could just become the best one.
> >
> > Look, if the OP has what it takes to build "the best" framework he would
> > have just gone ahead and did it instead asking. That is not to say that
> > in future when he has more experience he could not go on to build a
> > kickass framework.
> >
>
> agreed

Ah but it is quite possible that the OP will go ahead and try to build a
framework, he may fail miserably, all the while learning from his
mistakes. Then he may try again and subsequently build a kickass
framework. Since not all paths lead to the same conclusion it is just as
possible that if he doesn't go down this path that he will never create
a kickass framework no matter how many frameworks he studies.

Some of the greatest science comes from those unaware of established
rules and theories.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread Robert Cummings
On Tue, 2007-06-19 at 05:31 +0800, Crayon Shin Chan wrote:
> On Tuesday 19 June 2007 02:18, Robert Cummings wrote:
> 
> > I put that exact phrase (double quoted of course) into Google and
> > turned up the following:
> >
> > Your search - "there's a fine line between personal satisfaction
> > and egotism" - did not match any documents.
> >
> > I'm going to guess you just made it up.
> 
> Glad you did some research. As a matter of fact I did made it up just now. 
> Are you disputing that the saying is not widely used, or that it has no 
> truth in it?

Making up phrases and passing them off as though they are common adages
only goes towards showing that you have no steam to your argument.

> And just for fun here's another I just made up (I've no idea what Google 
> has to say on this):
> 
> "There's a fine line between personal satisfaction and personal 
> gratification"

I won't bother looking. I have little faith in your words now. If I
wanted fallacious reasoning I'd go watch a commercial on the telly.

> > Jumping to conclusions attempts to bypass logical argument and so rests
> > on a weak foundation.
> 
> Jumping to conclusions in the literal sense (as opposed to it's negative 
> connotation) means making a judgement based on limited facts. As long as 
> said conclusion does not fly in the face of the known facts then where is 
> the bypassing of logical argument? However I grant you that a judgement 
> without all the facts is based on weak foundations. But you can't expect 
> me to ask the OP to submit a psychological assessment and attestations of 
> personal character from ministers/priests/preachers/mullahs of 3 major 
> faiths, before I can ascertain what his/her motives are for asking a 
> question.

You could ask the OP for more information rather than jump to
conclusions. Sort of moot now though since the OP re-iterated that he
was indeed seeking information on how to start a framework. This should
have been the logical conclusion to which one would jump given that the
only fact that was known was that the OP wanted guidance on how to start
a framework. All else you came up with was flight of fancy.

> > Actually, I was suggesting giving thought to any particular worldview
> > before jumping on the bandwagon. I wasn't suggesting being different
> > for the sake of being different. It is important to make informed
> > decisions.
> 
> Thank you.

You're welcome.

> > > Again you're jumping to conclusions I never mentioned popularity.
> > > However when a project has not seen any updates for years and is
> > > still marked as "in the planning stages" then I _would_ jump to
> > > conclusions and assume it has been neglected/abandoned/forgotten/etc.
> >
> > I know for fact that popularity doesn't constitute quality - there's no
> > jumping to conclusion there.
> 
> Gordon bennett, why are you so fixated on popularity, I mentioned at all 
> in my posts. Maybe it's a Freudian [insert appropriate terminology here] 
> because your framework is not as popular as you think it ought to be and 
> so you're being defensive? In that case you're suffering from an 
> inferiority complex.

You're not very good at this: http://en.wikipedia.org/wiki/Ad_hominem
At any rate, if you jump on the site, go to the about section and read
the history, you'll see I wrote my framework for my MUD. So I fall into
the "just for fun" crowd. But anyways, nowadays I use my framework
pretty much every single day I work and I make good money doing so. If I
were being defensive I'd have probably tried telling the OP to use my
framework. I stopped evangelizing it a couple of years ago... I don't
care if people use it or not *lol*.

> Read what I wrote above, I'm talking about UPDATES (or the lack of), not 
> popularity.

You implied it.

> > The only one placing limits on what you can do is... dun dun dun...
> > YOU! Well maybe the government also, but that's only until you get
> > caught.
> 
> To an extent. But a lot of money certainly helps. Unless you're limiting 
> your fields of study to theoretical mathematics/physics.

Certainly helps some. Others get by fine without a lot of money.

> > > > You cannot discount the merit of one
> > > > person's contribution because you think they should have another
> > > > work style/ethic.
> 
> On the contrary I greatly appreciate all the wonderful software that 
> one-person bands all over the world has contributed to the public 

You mean "have contributed" not "has contributed" *smirk*.

> domain/free/open source space.
> 
> > Exactly, and where does it say that he wants to join an existing
> > project?
> 
> Nowhere. We're all here to exchange ideas, information, suggestions and 
> new angles on (mis)preconceptions (at least I hope most of us are), and 
> maybe a flame or 2. So just because the OP "did not explicitly state that 
> he wanted to join an existing project", it does not mean that he "would 
> not join an existing project" or "make use of an existing project" under 
>

[PHP] Comparing string to array

2007-06-18 Thread Richard Davey
Hi all,

Ok it's 2am, my brain has gone to mush and I am having trouble
figuring out an easy way to do this, can anyone shed some light?

Take a peek at the following code:

// START






red
green
blue
red2
green2
blue2




// END

From the code above I'm trying to figure out how to tell if the
$userparam exists in the $_POST array. PHP automatically expands the
form element name into multi-dim arrays within $_POST, so a simple
'isset' as shown in the code above won't play because it's got a
totally useless array key passed to it.

I need a way to turn the string:

"test['sam'][]"

into something I can look into $_POST for.

Any ideas? The coffee boost is wearing off, but I want to get this
licked tonight :-\

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

"Never trust a computer you can't throw out of a window"

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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread Nathan Nobbe

On 6/18/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:

On Tuesday 19 June 2007 02:04, Nathan Nobbe wrote:

> discouraging new framework development is like telling the people of
> the world never to develop a new flavor of linux.

There are no new flavours of linux. You're probably mixing it up with
linux distributions of which there are many.

it seems to me most people use the terms flavor and distribution
interchangeably when referring to linux.

Most of which are, whilst

not exactly useless, have limited appeal. Yes they are fun and I love
trying them out. I also make customised livecds for my own personal use.
But the vast majority of these linux distros are based on "distro A",
which is based on "distro B", which is based on "distro C", ..., which is
based on "distro Z", which is based on either Debian, Redhat, Slackware
or Suse. However for real work I would only use a major distro where I
can expect timely updates and security fixes.

although gentoo linux [the only os i run] is designed on the same
basic concept of freeBSD it is entirely unique; basically a freeBSD
rewrite w/ the linux kernel; o, it can run w/ the freeBSD kernel too.
in effect a completely new breed of os was born; and i didnt catch
that one on your list; probly because it is essentially "distro Z", so
to speak.


> we all know its a massive undertaking, but there is merit and purpose
> in it nonetheless.

And just what might the "merit" and "purpose" be? We can probably conclude
that the "purpose" is to facilitate the creation of a "large site", but
the OP never said what/whether there is any merit. But the creation of
a "large site" does not imply that there needs to be a new framework, so
the "purpose" is not clear.


i suppose i began to think in general terms rather than the context of
this thread.


> and you never know a new one could just become the best one.

Look, if the OP has what it takes to build "the best" framework he would
have just gone ahead and did it instead asking. That is not to say that
in future when he has more experience he could not go on to build a
kickass framework.


agreed

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



Re: [PHP] Controlling project version

2007-06-18 Thread Larry Garfield
On Monday 18 June 2007, Chris wrote:

> >> Compare that to:
> >>
> >> cvs tag -b "branch name" module_name
> >>
> >> ;)
> >
> > Ok, this is where you need to understand the fundamental difference
> > between how CVS and Subversion work. For CVS branching and tagging are
> > operations in themselves. In Subversion they're just copies. How you
> > layout your repository is up to you, but the recommended layout is
> > usually used because you need somewhere in the repository to put
> > branches and tags.
> >
> > As for how to do it... think of it as simply copying files and it should
> > make sense...
> >
> > svn copy svn+ssh://server/repos/trunk svn+ssh://server/repos/tags/mytag
>
> That does make sense - it's just a pain to re-do a repository if you
> didn't set it up properly in the first place (which I never thought I'd
> have to do for a version control system).
>
> Anyway thanks for the tip ;)

SVN's architecture for branching and tagging is a lot nicer.  CVS's UI 
primitives for branching and tagging are a lot nicer.  I think SVN is easier 
to fix in that regard than CVS is.  I'm rather curious why some stock hook 
scripts don't exist to do that for you already.  

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



[PHP] fsocketopen not returning data properly

2007-06-18 Thread Dan
I'm having trouble with sockets in PHP, if anyone has the time to help out 
that would be awesome.

I am trying to get the result of a post

echo httpSocketConnection("www.google.com", "POST", "/search", "q=test", 
"80");


This should post to google.com with a query of test.  Then give me the 
response.  The function I'm using is below.


Here's the function's code:

function httpSocketConnection($host, $method, $path, $data, $port)
   {
   $method = strtoupper($method);

   if ($method == "GET")
   {
   $path.= '?'.$data;
   }

   $filePointer = fsockopen($host, $port, $errorNumber, $errorString);

   if (!$filePointer)
   {
   logEvent('debug', 'Failed opening http socket connection: 
'.$errorString.' ('.$errorNumber.')\n');

   return false;
   }

   $requestHeader = $method." ".$path."  HTTP/1.1\r\n";
   $requestHeader.= "Host: ".$host."\r\n";
   $requestHeader.= "User-Agent:  Mozilla/5.0 (Windows; U; Windows 
NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0\r\n";
   $requestHeader.= "Content-Type: 
application/x-www-form-urlencoded\r\n";


   if ($method == "POST")
   {
   $requestHeader.= "Content-Length: ".strlen($data)."\r\n";
   }

   $requestHeader.= "Connection: close\r\n\r\n";

   if ($method == "POST")
   {
   $requestHeader.= $data;
   }

   fwrite($filePointer, $requestHeader);

   $responseHeader = '';
   $responseContent = '';

   do
   {
   $responseHeader.= fread($filePointer, 1);
   }
   while (!preg_match('/\\r\\n\\r\\n$/', $responseHeader));


   if (!strstr($responseHeader, "Transfer-Encoding: chunked"))
   {
   while (!feof($filePointer))
   {
   $responseContent.= fgets($filePointer, 128);
   }
   }
   else
   {

   while ($chunk_length = hexdec(fgets($filePointer)))
   {
   $responseContentChunk = '';

   logEventToTextFile('debug', $chunk_length);
   $read_length = 0;

   while ($read_length < $chunk_length)
   {
   $responseContentChunk .= fread($filePointer, 
$chunk_length - $read_length);

   $read_length = strlen($responseContentChunk);
   }

   $responseContent.= $responseContentChunk;

   fgets($filePointer);

   }

   }

   logEventToTextFile('debug', $responseContent);


   return chop($responseContent);
   } 


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



Re: [PHP] PHP calling an ISAPI Extension

2007-06-18 Thread Jim Lucas

Dan wrote:
I wish I could, I can't count on the script being on a linux machine.  I 
also can't expect people to rebuild PHP with the curl library just to 
use my script.  Is there any other way to do a post to a page from a php 
function?


- Daniel

"Jim Lucas" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

Dan wrote:
I would normaly do it with an AJAX call but I need to do a post from 
WITHIN a PHP function, so when it's doing php stuff

ex.
function something()
{
echo 'whatever';
$response = post some data to a ISAPI Extension eg. post to 
http://domain.com/scripts/app.dll

return $response . "other data";
}


""Jay Blanchard"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

[snip]
I'm in need of a way to contact an ISAPI Extension from a PHP function.
Does anyone know how I would be able to do this?  Usually you would post
a
page to their URL/actionname.  Can I do a POST from a PHP function
without
reloading the page, and get a result back?  That's one tall order.
Anyone
want to give it a shot?
[/snip]

Do the POST with an AJAX call


perform an ajax call the a php script that calls curl to do a post to 
the ISAPI extension


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare 



The only method that I am aware of is the fsockopen method you mention in your 
other email

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] PHP calling an ISAPI Extension

2007-06-18 Thread Dan
I wish I could, I can't count on the script being on a linux machine.  I 
also can't expect people to rebuild PHP with the curl library just to use my 
script.  Is there any other way to do a post to a page from a php function?


- Daniel

"Jim Lucas" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

Dan wrote:
I would normaly do it with an AJAX call but I need to do a post from 
WITHIN a PHP function, so when it's doing php stuff

ex.
function something()
{
echo 'whatever';
$response = post some data to a ISAPI Extension eg. post to 
http://domain.com/scripts/app.dll

return $response . "other data";
}


""Jay Blanchard"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

[snip]
I'm in need of a way to contact an ISAPI Extension from a PHP function.
Does anyone know how I would be able to do this?  Usually you would post
a
page to their URL/actionname.  Can I do a POST from a PHP function
without
reloading the page, and get a result back?  That's one tall order.
Anyone
want to give it a shot?
[/snip]

Do the POST with an AJAX call


perform an ajax call the a php script that calls curl to do a post to the 
ISAPI extension


--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare 


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



Re: [PHP] PHP calling an ISAPI Extension

2007-06-18 Thread Dan
For example, I could use function fsockopen but that seems like it would 
probably be pretty slow doing all that, and if there's a php function or 
small script that would be preferable over the 50/60 lines you would need to 
do it properly with fsockopen.


- Daniel

""Jay Blanchard"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

[snip]
I'm in need of a way to contact an ISAPI Extension from a PHP function.
Does anyone know how I would be able to do this?  Usually you would post
a
page to their URL/actionname.  Can I do a POST from a PHP function
without
reloading the page, and get a result back?  That's one tall order.
Anyone
want to give it a shot?
[/snip]

Do the POST with an AJAX call 


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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread tedd

At 1:39 AM +0800 6/19/07, Crayon Shin Chan wrote:

On Monday 18 June 2007 04:00, Robert Cummings wrote:
 > Maybe so, but much science and many breakthroughs are still done by the
 > lone inventory/researcher.

Particularly in the field of astronomy where amateurs are still able to
contribute greatly. However gone are the days when I could conduct high
energy particle physics experiments in my own basement and launch
interplanetary space probes from my own backyard.


Yes, but the fact still remains, for the exception of drug companies 
passing DNA sequences off as patents, the *majority* of patents for 
inventions are due to the efforts of a lone risk taker putting his 
money, time, and effort on the line trying to invent something.


And, one *never* could "conduct high energy particle physics 
experiments in my own basement and launch interplanetary space probes 
from my own backyard".


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread tedd

At 2:18 PM -0400 6/18/07, Robert Cummings wrote:

On Tue, 2007-06-19 at 01:39 +0800, Crayon Shin Chan wrote:
 > On Monday 18 June 2007 04:00, Robert Cummings wrote:


-snip-

Looks like someone released the Kraken.  :-)

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread tedd

At 1:48 AM +0800 6/19/07, Crayon Shin Chan wrote:

On Tuesday 19 June 2007 00:36, tedd wrote:


 What about the wasted time in searching through "billions of
 half-baked to fully-baked
 frameworks" to find one that works for you? That's really a waste of
 time.


Well search through the fully-baked frameworks only, and don't create
another half-baked one.

And are you seriously suggesting that you can create a fairly decent
framework from scratch in less time than it takes to evaluate what's out
there?


For me? Absolutely! I haven't failed myself yet.

But, then again, I don't work on important stuff. I'm just a simple 
key puncher with satisfied customers.


Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] PHP calling an ISAPI Extension

2007-06-18 Thread Jim Lucas

Dan wrote:
I would normaly do it with an AJAX call but I need to do a post from 
WITHIN a PHP function, so when it's doing php stuff

ex.
function something()
{
echo 'whatever';
$response = post some data to a ISAPI Extension eg. post to 
http://domain.com/scripts/app.dll

return $response . "other data";
}


""Jay Blanchard"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

[snip]
I'm in need of a way to contact an ISAPI Extension from a PHP function.
Does anyone know how I would be able to do this?  Usually you would post
a
page to their URL/actionname.  Can I do a POST from a PHP function
without
reloading the page, and get a result back?  That's one tall order.
Anyone
want to give it a shot?
[/snip]

Do the POST with an AJAX call


perform an ajax call the a php script that calls curl to do a post to the ISAPI 
extension

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] PHP calling an ISAPI Extension

2007-06-18 Thread Dan
I would normaly do it with an AJAX call but I need to do a post from WITHIN 
a PHP function, so when it's doing php stuff

ex.
function something()
{
echo 'whatever';
$response = post some data to a ISAPI Extension eg. post to 
http://domain.com/scripts/app.dll

return $response . "other data";
}


""Jay Blanchard"" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

[snip]
I'm in need of a way to contact an ISAPI Extension from a PHP function.
Does anyone know how I would be able to do this?  Usually you would post
a
page to their URL/actionname.  Can I do a POST from a PHP function
without
reloading the page, and get a result back?  That's one tall order.
Anyone
want to give it a shot?
[/snip]

Do the POST with an AJAX call 


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



RE: [PHP] PHP calling an ISAPI Extension

2007-06-18 Thread Jay Blanchard
[snip]
I'm in need of a way to contact an ISAPI Extension from a PHP function. 
Does anyone know how I would be able to do this?  Usually you would post
a 
page to their URL/actionname.  Can I do a POST from a PHP function
without 
reloading the page, and get a result back?  That's one tall order.
Anyone 
want to give it a shot?
[/snip]

Do the POST with an AJAX call

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



[PHP] PHP calling an ISAPI Extension

2007-06-18 Thread Dan
I'm in need of a way to contact an ISAPI Extension from a PHP function. 
Does anyone know how I would be able to do this?  Usually you would post a 
page to their URL/actionname.  Can I do a POST from a PHP function without 
reloading the page, and get a result back?  That's one tall order.  Anyone 
want to give it a shot?


- Daniel 


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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread Crayon Shin Chan
On Tuesday 19 June 2007 02:04, Nathan Nobbe wrote:

> discouraging new framework development is like telling the people of
> the world never to develop a new flavor of linux.

There are no new flavours of linux. You're probably mixing it up with 
linux distributions of which there are many. Most of which are, whilst 
not exactly useless, have limited appeal. Yes they are fun and I love 
trying them out. I also make customised livecds for my own personal use. 
But the vast majority of these linux distros are based on "distro A", 
which is based on "distro B", which is based on "distro C", ..., which is 
based on "distro Z", which is based on either Debian, Redhat, Slackware 
or Suse. However for real work I would only use a major distro where I 
can expect timely updates and security fixes.

> we all know its a massive undertaking, but there is merit and purpose
> in it nonetheless.

And just what might the "merit" and "purpose" be? We can probably conclude 
that the "purpose" is to facilitate the creation of a "large site", but 
the OP never said what/whether there is any merit. But the creation of 
a "large site" does not imply that there needs to be a new framework, so 
the "purpose" is not clear.

> and you never know a new one could just become the best one.

Look, if the OP has what it takes to build "the best" framework he would 
have just gone ahead and did it instead asking. That is not to say that 
in future when he has more experience he could not go on to build a 
kickass framework.

-- 
Crayon

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



Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Daniel Brown

On 6/18/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

Daniel Brown wrote:
> On 6/18/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
>> First off, don't jack someone else's thread.
>
>Am I not getting all of the list messages today?  I didn't see
> where the thread hijacking occurred
>


--
Jim Lucas

"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
 by William Shakespeare




   Weird, I didn't get those messages.  I wasn't being a smartass, I
was legitimately wondering if I was missing emails from the list
today, and apparently I am.

   Thanks, Jim.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Jim Lucas

Daniel Brown wrote:

On 6/18/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

First off, don't jack someone else's thread.


   Am I not getting all of the list messages today?  I didn't see
where the thread hijacking occurred




--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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

Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Myron Turner

Jim Lucas wrote:

First off, don't jack someone else's thread.

Secondly, I think it might have something to do with the space  in the 
file name.


Try changing all spaces to %20 and see what happens.

$string = str_replace(' ', '%20', $string);

should do the trick

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare


Since my own reader isn't threaded I wasn't aware of the threading 
issue.  I'll keep this in mind in the future.


I assume by spaces you are referring to E:\Program Files\.  Well, if a 
php package for windows can't understand its own file system something 
is seriously wrong.  But in fact that's not the case since dokuwiki runs 
on the system and uses io_readFile.


Glad to see you are now crediting Shakespeare.

--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread Crayon Shin Chan
On Tuesday 19 June 2007 02:18, Robert Cummings wrote:

> I put that exact phrase (double quoted of course) into Google and
> turned up the following:
>
> Your search - "there's a fine line between personal satisfaction
> and egotism" - did not match any documents.
>
> I'm going to guess you just made it up.

Glad you did some research. As a matter of fact I did made it up just now. 
Are you disputing that the saying is not widely used, or that it has no 
truth in it?

And just for fun here's another I just made up (I've no idea what Google 
has to say on this):

"There's a fine line between personal satisfaction and personal 
gratification"

> Jumping to conclusions attempts to bypass logical argument and so rests
> on a weak foundation.

Jumping to conclusions in the literal sense (as opposed to it's negative 
connotation) means making a judgement based on limited facts. As long as 
said conclusion does not fly in the face of the known facts then where is 
the bypassing of logical argument? However I grant you that a judgement 
without all the facts is based on weak foundations. But you can't expect 
me to ask the OP to submit a psychological assessment and attestations of 
personal character from ministers/priests/preachers/mullahs of 3 major 
faiths, before I can ascertain what his/her motives are for asking a 
question.

> Actually, I was suggesting giving thought to any particular worldview
> before jumping on the bandwagon. I wasn't suggesting being different
> for the sake of being different. It is important to make informed
> decisions.

Thank you.

> > Again you're jumping to conclusions I never mentioned popularity.
> > However when a project has not seen any updates for years and is
> > still marked as "in the planning stages" then I _would_ jump to
> > conclusions and assume it has been neglected/abandoned/forgotten/etc.
>
> I know for fact that popularity doesn't constitute quality - there's no
> jumping to conclusion there.

Gordon bennett, why are you so fixated on popularity, I mentioned at all 
in my posts. Maybe it's a Freudian [insert appropriate terminology here] 
because your framework is not as popular as you think it ought to be and 
so you're being defensive? In that case you're suffering from an 
inferiority complex.

Read what I wrote above, I'm talking about UPDATES (or the lack of), not 
popularity.

> The only one placing limits on what you can do is... dun dun dun...
> YOU! Well maybe the government also, but that's only until you get
> caught.

To an extent. But a lot of money certainly helps. Unless you're limiting 
your fields of study to theoretical mathematics/physics.

> > > You cannot discount the merit of one
> > > person's contribution because you think they should have another
> > > work style/ethic.

On the contrary I greatly appreciate all the wonderful software that 
one-person bands all over the world has contributed to the public 
domain/free/open source space.

> Exactly, and where does it say that he wants to join an existing
> project?

Nowhere. We're all here to exchange ideas, information, suggestions and 
new angles on (mis)preconceptions (at least I hope most of us are), and 
maybe a flame or 2. So just because the OP "did not explicitly state that 
he wanted to join an existing project", it does not mean that he "would 
not join an existing project" or "make use of an existing project" under 
any circumstances. Given good enough reasons he could be persuaded one 
way or another.

> Maybe he was about to think things through and just wanted a bump in
> the right direction... the right direction being "how to start my own
> framework" 

And do you have any pearls of wisdom to start this young novice on the 
road to enlightenment? Given that you have apparently built your own 
framework I am frankly disappointed that you have nothing better to 
contribute than to reply to my mindless drivel. And a :) for good 
measure.

> and not "how to join someone else's project". 

And as that is the best advice given the circumstances that is what I 
suggest.

> Ahh, you discount the merit of having fun doing things like this. Many
> great inventions have seen the light of day just because someone was
> having fun doing them.

I am not discounting that merit. But I've a feeling that the OP is not 
doing his large site for fun, but what do I know - I'm always jumping 
into conclusions.

> What constitutes a fully-baked framework? Please indicate some valid
> measure of "fully-baked" versus "half-baked". Your quantitative methods
> of analysis will be appreciated I'm sure. And remember, popularity
> isn't necessarily a measure of quality and so can't be used solely to
> indicate fully-baked... maybe fully-baking, but certainly not
> fully-baked.

Frankly the OP cannot make a reasonable assessment as to how much baked 
any particular framework is then it is my sincere belief that he is in 
even less of a position to create new framework. Personally, how much 
bake

Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Daniel Brown

On 6/18/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

First off, don't jack someone else's thread.


   Am I not getting all of the list messages today?  I didn't see
where the thread hijacking occurred

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Jim Lucas

Myron Turner wrote:
I've written a plugin for DokuWiki which uses the following DokuWiki 
function for reading files:


   function io_readFile($file,$clean=true){
 $ret = '';
 if(@file_exists($file)){
   if(substr($file,-3) == '.gz'){
 $ret = join('',gzfile($file));
   }else if(substr($file,-4) == '.bz2'){
 $ret = bzfile($file);
   }else{
 $ret = join('',file($file));
   }
 }
 if($clean){
   return cleanText($ret);
 }else{
   return $ret;
 }
   }

On Linux machines, this seems to behave as you would hope, that is, if 
the file doesn't exist then you get back a null string. In any event, 
none of the users who have installed it on Linux machines have had a 
problem with it.  And I have done several installs myself. But one user 
installed the plugin on a Windows machine and the code fell through to 
$ret = join('',file($file)) even though there was no $file.  The result 
was an error message:


 Permission denied in *E:\Program Files\EasyPHP 
2.0b1\www\dokuwiki\inc\io.php* on line *97


*Line 97 is the join.  So the function is attempting to read a 
non-existent file.


I was just wondering whether there is some difference in the way his PHP 
version handles the @ operator in:


  if(@file_exists($file))

That is, is it possible that by suppressing errors, this expression 
somehow returns true?  And is it a bug?



Thanks.

Myron



First off, don't jack someone else's thread.

Secondly, I think it might have something to do with the space  in the file 
name.

Try changing all spaces to %20 and see what happens.

$string = str_replace(' ', '%20', $string);

should do the trick

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Myron Turner

Edward Vermillion wrote:


On Jun 18, 2007, at 3:30 PM, Myron Turner wrote:

I've written a plugin for DokuWiki which uses the following DokuWiki 
function for reading files:


function io_readFile($file,$clean=true){
$ret = '';
if(@file_exists($file)){
if(substr($file,-3) == '.gz'){
$ret = join('',gzfile($file));
}else if(substr($file,-4) == '.bz2'){
$ret = bzfile($file);
}else{
$ret = join('',file($file));
}
}
if($clean){
return cleanText($ret);
}else{
return $ret;
}
}

On Linux machines, this seems to behave as you would hope, that is, 
if the file doesn't exist then you get back a null string. In any 
event, none of the users who have installed it on Linux machines have 
had a problem with it. And I have done several installs myself. But 
one user installed the plugin on a Windows machine and the code fell 
through to $ret = join('',file($file)) even though there was no 
$file. The result was an error message:


Permission denied in *E:\Program Files\EasyPHP 
2.0b1\www\dokuwiki\inc\io.php* on line *97


*Line 97 is the join. So the function is attempting to read a 
non-existent file.


I was just wondering whether there is some difference in the way his 
PHP version handles the @ operator in:


if(@file_exists($file))

That is, is it possible that by suppressing errors, this expression 
somehow returns true? And is it a bug?





Are you sure the file doesn't exist? Could it just be that it exists, 
but the permissions are not set correctly?


Ed


I don't really know, since I am depending on the user's feed-back. But 
apparently he hadn't done anything yet with the plugin, so no files 
would have been in that directory. But it's a possibility since the code 
doesn't check for whether the file is readable.


It could just be a Windows issue, but I thought I'd check here, because 
if it's something that others have run into and which I can rectify I'd 
want to do it.


--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

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



Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Edward Vermillion


On Jun 18, 2007, at 3:30 PM, Myron Turner wrote:

I've written a plugin for DokuWiki which uses the following  
DokuWiki function for reading files:


   function io_readFile($file,$clean=true){
 $ret = '';
 if(@file_exists($file)){
   if(substr($file,-3) == '.gz'){
 $ret = join('',gzfile($file));
   }else if(substr($file,-4) == '.bz2'){
 $ret = bzfile($file);
   }else{
 $ret = join('',file($file));
   }
 }
 if($clean){
   return cleanText($ret);
 }else{
   return $ret;
 }
   }

On Linux machines, this seems to behave as you would hope, that is,  
if the file doesn't exist then you get back a null string. In any  
event, none of the users who have installed it on Linux machines  
have had a problem with it.  And I have done several installs  
myself. But one user installed the plugin on a Windows machine and  
the code fell through to $ret = join('',file($file)) even though  
there was no $file.  The result was an error message:


 Permission denied in *E:\Program Files\EasyPHP 2.0b1 
\www\dokuwiki\inc\io.php* on line *97


*Line 97 is the join.  So the function is attempting to read a non- 
existent file.


I was just wondering whether there is some difference in the way  
his PHP version handles the @ operator in:


  if(@file_exists($file))

That is, is it possible that by suppressing errors, this expression  
somehow returns true?  And is it a bug?





Are you sure the file doesn't exist? Could it just be that it exists,  
but the permissions are not set correctly?


Ed

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



[PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Myron Turner
I've written a plugin for DokuWiki which uses the following DokuWiki 
function for reading files:


   function io_readFile($file,$clean=true){
 $ret = '';
 if(@file_exists($file)){
   if(substr($file,-3) == '.gz'){
 $ret = join('',gzfile($file));
   }else if(substr($file,-4) == '.bz2'){
 $ret = bzfile($file);
   }else{
 $ret = join('',file($file));
   }
 }
 if($clean){
   return cleanText($ret);
 }else{
   return $ret;
 }
   }

On Linux machines, this seems to behave as you would hope, that is, if 
the file doesn't exist then you get back a null string. In any event, 
none of the users who have installed it on Linux machines have had a 
problem with it.  And I have done several installs myself. But one user 
installed the plugin on a Windows machine and the code fell through to 
$ret = join('',file($file)) even though there was no $file.  The result 
was an error message:


 Permission denied in *E:\Program Files\EasyPHP 
2.0b1\www\dokuwiki\inc\io.php* on line *97


*Line 97 is the join.  So the function is attempting to read a 
non-existent file.


I was just wondering whether there is some difference in the way his PHP 
version handles the @ operator in:


  if(@file_exists($file))

That is, is it possible that by suppressing errors, this expression 
somehow returns true?  And is it a bug?



Thanks.

Myron

--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

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



RE: [PHP] subtracting time from date and time

2007-06-18 Thread Richard Kurth
 
You are right I was looking at it as 0735 was in the morning sorry about
that.
In that case it works perfect

> -Original Message-
> From: Jim Lucas [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 18, 2007 12:21 PM
> To: Richard Kurth
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] subtracting time from date and time
> 
> Richard Kurth wrote:
> >  
> > 
> >> -Original Message-
> >> From: Chris Boget [mailto:[EMAIL PROTECTED]
> >> Sent: Monday, June 18, 2007 10:55 AM
> >> To: Brad Bonkoski; Richard Kurth
> >> Cc: php-general@lists.php.net
> >> Subject: Re: [PHP] subtracting time from date and time
> >>
> >>> Something like this will get it into a time stamp...and
> >> then you can
> >>> do your calculations with ease, and reformat...
> >>>  >>>$str = "20070617T193500";
> >>>list($date, $time) = explode("T",$str); ?>
> >> Even easier:
> >>
> >> $timestamp = strtotime( $str );
> >> http://us2.php.net/manual/en/function.strtotime.php
> >>
> >> $oneMinute = 60; // seconds
> >> $oneHour= $oneMinute * 60;
> >> $oneDay = $oneHour * 24;
> >>
> >> echo '5 minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( 
> >> $oneMinute *
> >> 5 ));
> >> echo '5 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( 
> $oneHour * 
> >> 5 )); echo '5 days ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( 
> >> $oneDay * 5 ));
> > 
> > This works great tell you get to 8 hours ago it shows the 
> correct time 
> > but it does not change the date to the day before. 8 hours 
> ago should 
> > be
> > 06/16/2007 11:35:00 but what it shows is 06/17/2007 11:35:00
> > 
> > $str = "20070617T193500";
> 
> Notice that this time stamp is formatted in 24/hr days.
> 
> so
> year  2007
> month 6
> day   17
> 
> hour  19  = 7pm  (not 7am)
> minute15
> second00
> 
> 
> > $timestamp = strtotime( $str );
> > $oneMinute = 60; // seconds
> > $oneHour= $oneMinute * 60;
> > $oneDay = $oneHour * 24;
> > echo 'time: ' . date( 'm/d/Y h:i:s', $timestamp ); 
> echo""; echo '5 
> > minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( 
> $oneMinute *5 )); 
> > echo""; echo '15 minutes ago: ' . date( 'm/d/Y h:i:s', 
> $timestamp 
> > - ( $oneMinute *15 )); echo""; echo '30 minutes ago: ' . date( 
> > 'm/d/Y h:i:s', $timestamp - ( $oneMinute *30 )); 
> echo""; echo '1 
> > hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour * 1 )); 
> > echo""; echo '2 hours ago: ' . date( 'm/d/Y h:i:s', 
> $timestamp - ( 
> > $oneHour * 2 )); echo""; echo '5 hours ago: ' . date( 'm/d/Y 
> > h:i:s', $timestamp - ( $oneHour  * 5 )); echo""; echo '7 hours 
> > ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour  * 7 )); 
> > echo""; echo '8 hours ago: ' . date( 'm/d/Y h:i:s', 
> $timestamp - ( 
> > $oneHour  * 8));
> > 
> 
> 
> --
> Jim Lucas
> 
> "Some men are born to greatness, some achieve greatness,
> and some have greatness thrust upon them."
> 
> Twelfth Night, Act II, Scene V
>  by William Shakespeare
> 
> --
> PHP General Mailing List (http://www.php.net/) To 
> unsubscribe, visit: http://www.php.net/unsub.php
> 

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



Re: [PHP] subtracting time from date and time

2007-06-18 Thread Jim Lucas

Richard Kurth wrote:
 


-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 18, 2007 10:55 AM

To: Brad Bonkoski; Richard Kurth
Cc: php-general@lists.php.net
Subject: Re: [PHP] subtracting time from date and time

Something like this will get it into a time stamp...and 
then you can 

do your calculations with ease, and reformat...


Even easier:

$timestamp = strtotime( $str );
http://us2.php.net/manual/en/function.strtotime.php

$oneMinute = 60; // seconds
$oneHour= $oneMinute * 60;
$oneDay = $oneHour * 24;

echo '5 minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( 
$oneMinute *

5 ));
echo '5 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( 
$oneHour * 5 )); echo '5 days ago: ' . date( 'm/d/Y h:i:s', 
$timestamp - ( $oneDay * 5 ));


This works great tell you get to 8 hours ago it shows the correct time but
it does not change the date to the day before. 8 hours ago should be 
06/16/2007 11:35:00 but what it shows is 06/17/2007 11:35:00


$str = "20070617T193500";


Notice that this time stamp is formatted in 24/hr days.

so
year2007
month   6
day 17

hour19  = 7pm  (not 7am)
minute  15
second  00



$timestamp = strtotime( $str );
$oneMinute = 60; // seconds
$oneHour= $oneMinute * 60;
$oneDay = $oneHour * 24;
echo 'time: ' . date( 'm/d/Y h:i:s', $timestamp );
echo"";
echo '5 minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneMinute *5
));
echo"";
echo '15 minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneMinute *15
));
echo"";
echo '30 minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneMinute *30
));
echo"";
echo '1 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour * 1 )); 
echo"";
echo '2 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour * 2 )); 
echo"";

echo '5 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour  * 5 ));
echo"";
echo '7 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour  * 7 ));
echo"";
echo '8 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour  * 8));




--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



RE: [PHP] subtracting time from date and time

2007-06-18 Thread Chris Boget
> This works great tell you get to 8 hours ago 
> it shows the correct time but it does not change 
> the date to the day before. 8 hours ago should be
> 06/16/2007 11:35:00 but what it shows is 06/17/2007 
> 11:35:00

Your code works for me.  Though, I had to change the format of $str
slightly to get it to work on a windows box.  Additionally, I tried the
following (which also worked):

';

  }
?>

thnx,
Chris

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



RE: [PHP] subtracting time from date and time

2007-06-18 Thread Richard Kurth
 

> -Original Message-
> From: Chris Boget [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 18, 2007 10:55 AM
> To: Brad Bonkoski; Richard Kurth
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] subtracting time from date and time
> 
> > Something like this will get it into a time stamp...and 
> then you can 
> > do your calculations with ease, and reformat...
> >  >$str = "20070617T193500";
> >list($date, $time) = explode("T",$str); ?>
> 
> Even easier:
> 
> $timestamp = strtotime( $str );
> http://us2.php.net/manual/en/function.strtotime.php
> 
> $oneMinute = 60; // seconds
> $oneHour= $oneMinute * 60;
> $oneDay = $oneHour * 24;
> 
> echo '5 minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( 
> $oneMinute *
> 5 ));
> echo '5 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( 
> $oneHour * 5 )); echo '5 days ago: ' . date( 'm/d/Y h:i:s', 
> $timestamp - ( $oneDay * 5 ));

This works great tell you get to 8 hours ago it shows the correct time but
it does not change the date to the day before. 8 hours ago should be 
06/16/2007 11:35:00 but what it shows is 06/17/2007 11:35:00

$str = "20070617T193500";
$timestamp = strtotime( $str );
$oneMinute = 60; // seconds
$oneHour= $oneMinute * 60;
$oneDay = $oneHour * 24;
echo 'time: ' . date( 'm/d/Y h:i:s', $timestamp );
echo"";
echo '5 minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneMinute *5
));
echo"";
echo '15 minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneMinute *15
));
echo"";
echo '30 minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneMinute *30
));
echo"";
echo '1 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour * 1 )); 
echo"";
echo '2 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour * 2 )); 
echo"";
echo '5 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour  * 5 ));
echo"";
echo '7 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour  * 7 ));
echo"";
echo '8 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour  * 8));

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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread Robert Cummings
On Tue, 2007-06-19 at 01:39 +0800, Crayon Shin Chan wrote:
> On Monday 18 June 2007 04:00, Robert Cummings wrote:
> 
> > Typo... *yawn*. 
> 
> Please lookup the real meaning of typo .

>From Webster's: an error (as of spelling) in typed or typeset material

I misspelled your as you're. Are you suggesting I used "you're" because
I don't know the difference? Sorry to disappoint, I often type "you're"
instead of "your" and "your" instead of "you're" as I'm typing quickly
and not really spending enough time consciously telling my brain which
to send to my fingers.

> > You knew what was intended.
> 
> Of course. I'm not a computer and can make judgements based on context and 
> experience. I only brought it up because you seem to delight in 
> grammatical correctness (whatever that is).

I delight as is find amusing at times for fun. Your post lacked the
obligatory smiley to indicate humour ;)

> > Don't confuse pursuit of happiness and personal satisfaction as hubris.
> 
> As the saying goes, "there's a fine line between personal satisfaction and 
> egotism".

I put that exact phrase (double quoted of course) into Google and turned
up the following:

Your search - "there's a fine line between personal satisfaction
and egotism" - did not match any documents.

I'm going to guess you just made it up.

> > They are quite different and you can't glean hubris simply from reading
> > that someone wants to write their own framework. You are jumping to
> > conclusions.
> 
> Of course I'm jumping to conclusions - what I'm hoping is that they are 
> informed ones. One cannot include every bit of background information 
> into a mailing list question so the respondents will have to make 
> assumptions.

Jumping to conclusions attempts to bypass logical argument and so rests
on a weak foundation.

> > I have no problems with the philosophy of free software, but I do have
> > issues when someone suggests that we should all follow, like sheep to
> > the slaughter, a particular worldview. 
> 
> Being different "just because", is not very constructive nor cool - it may 
> seem so when you're a teenybopper but I'm sure you've outgrown that stage 
> by now. And just because more than 1 person share the same viewpoint or 
> common cause does not automagically change them into sheep. Before you go 
> jumping into conclusions - I'm not against people being different if 
> their "justification" for being different is anything other than "just 
> because".

Actually, I was suggesting giving thought to any particular worldview
before jumping on the bandwagon. I wasn't suggesting being different for
the sake of being different. It is important to make informed decisions.

> > What you "_would_ like" and what 
> > you "will get" is entirely up to individual in question.
> 
> That's why I didn't use "I insist".

No, but you asserted your opinion with disregard for personal choice by
claiming hubris motivates the pursuit of such goals.

> > You presume the use of SourceForge to host such a project. 
> 
> Well I suppose I could have wrote ""Yet Another Soon To Be Neglected 
> Sourceforge/Freshmeat/Savannah/BerliOS/etc Project", but I was relying on 
> the readers' powers of inference to fill in the blanks.

As I did and clearly stated below my comment about SourceForge :)

> > Popularity hardly constitutes a measurement of quality.
> 
> Again you're jumping to conclusions I never mentioned popularity. However 
> when a project has not seen any updates for years and is still marked 
> as "in the planning stages" then I _would_ jump to conclusions and assume 
> it has been neglected/abandoned/forgotten/etc.

I know for fact that popularity doesn't constitute quality - there's no
jumping to conclusion there.

> > ...they are in no way obligated to do so. If their ideas are bright
> > enough then chances are they will attract their own following. 
> 
> Just because I may or may not be ranting against something, I'm not 
> foolish to think that my rantings will obligate anyone to do anything.

It's good that you understand that.

> > Maybe so, but much science and many breakthroughs are still done by the
> > lone inventory/researcher.
> 
> Particularly in the field of astronomy where amateurs are still able to 
> contribute greatly. However gone are the days when I could conduct high 
> energy particle physics experiments in my own basement and launch 
> interplanetary space probes from my own backyard.

I guess you mean science like this:

http://discovermagazine.com/2007/mar/radioactive-boy-scout

The only one placing limits on what you can do is... dun dun dun... YOU!
Well maybe the government also, but that's only until you get caught.

> > You cannot discount the merit of one 
> > person's contribution because you think they should have another work
> > style/ethic.
> >
> > > Now going back to the OP:
> > >
> > > "...can some body help me, how to start php framwork for large
> > > site?", in the absence of any other cues, this

Re: [PHP] Re: php framework, large site

2007-06-18 Thread Nathan Nobbe

discouraging new framework development is like telling the people of the
world never to develop a new flavor of linux.
we all know its a massive undertaking, but there is merit and purpose in it
nonetheless.
and you never know a new one could just become the best one.

-nathan

On 6/18/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:


On Tuesday 19 June 2007 00:36, tedd wrote:

> What about the wasted time in searching through "billions of
> half-baked to fully-baked
> frameworks" to find one that works for you? That's really a waste of
> time.

Well search through the fully-baked frameworks only, and don't create
another half-baked one.

And are you seriously suggesting that you can create a fairly decent
framework from scratch in less time than it takes to evaluate what's out
there?

--
Crayon

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




Re: [PHP] subtracting time from date and time

2007-06-18 Thread Chris Boget
Something like this will get it into a time stamp...and then you can do 
your calculations with ease, and reformat...




Even easier:

$timestamp = strtotime( $str );
http://us2.php.net/manual/en/function.strtotime.php

$oneMinute = 60; // seconds
$oneHour= $oneMinute * 60;
$oneDay = $oneHour * 24;

echo '5 minutes ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneMinute * 
5 ));

echo '5 hours ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneHour * 5 ));
echo '5 days ago: ' . date( 'm/d/Y h:i:s', $timestamp - ( $oneDay * 5 ));

etc., etc., etc.

thnx,
Chris 


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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread Crayon Shin Chan
On Tuesday 19 June 2007 00:36, tedd wrote:

> What about the wasted time in searching through "billions of
> half-baked to fully-baked
> frameworks" to find one that works for you? That's really a waste of
> time.

Well search through the fully-baked frameworks only, and don't create 
another half-baked one.

And are you seriously suggesting that you can create a fairly decent 
framework from scratch in less time than it takes to evaluate what's out 
there?

-- 
Crayon

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



Re: [PHP] subtracting time from date and time

2007-06-18 Thread Brad Bonkoski
Something like this will get it into a time stamp...and then you can do 
your calculations with ease, and reformat...



-Brad

Richard Kurth wrote:

I am trying to figure out what is the most accurate way to find the time
after I subtract 5 min,15 min, 30 min 1 hour 2 hours and 5 hours from a date
and time that is formatted like this 
20070617T193500 this is the way it has to be formatted to work in a

vcalendar
 
 
 

  


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



Re: [PHP] Re: php framework, large site

2007-06-18 Thread Crayon Shin Chan
On Monday 18 June 2007 04:00, Robert Cummings wrote:

> Typo... *yawn*. 

Please lookup the real meaning of typo .

> You knew what was intended.

Of course. I'm not a computer and can make judgements based on context and 
experience. I only brought it up because you seem to delight in 
grammatical correctness (whatever that is).

> Don't confuse pursuit of happiness and personal satisfaction as hubris.

As the saying goes, "there's a fine line between personal satisfaction and 
egotism".

> They are quite different and you can't glean hubris simply from reading
> that someone wants to write their own framework. You are jumping to
> conclusions.

Of course I'm jumping to conclusions - what I'm hoping is that they are 
informed ones. One cannot include every bit of background information 
into a mailing list question so the respondents will have to make 
assumptions.

> I have no problems with the philosophy of free software, but I do have
> issues when someone suggests that we should all follow, like sheep to
> the slaughter, a particular worldview. 

Being different "just because", is not very constructive nor cool - it may 
seem so when you're a teenybopper but I'm sure you've outgrown that stage 
by now. And just because more than 1 person share the same viewpoint or 
common cause does not automagically change them into sheep. Before you go 
jumping into conclusions - I'm not against people being different if 
their "justification" for being different is anything other than "just 
because".

> What you "_would_ like" and what 
> you "will get" is entirely up to individual in question.

That's why I didn't use "I insist".

> You presume the use of SourceForge to host such a project. 

Well I suppose I could have wrote ""Yet Another Soon To Be Neglected 
Sourceforge/Freshmeat/Savannah/BerliOS/etc Project", but I was relying on 
the readers' powers of inference to fill in the blanks.

> Popularity hardly constitutes a measurement of quality.

Again you're jumping to conclusions I never mentioned popularity. However 
when a project has not seen any updates for years and is still marked 
as "in the planning stages" then I _would_ jump to conclusions and assume 
it has been neglected/abandoned/forgotten/etc.

> ...they are in no way obligated to do so. If their ideas are bright
> enough then chances are they will attract their own following. 

Just because I may or may not be ranting against something, I'm not 
foolish to think that my rantings will obligate anyone to do anything.

> Maybe so, but much science and many breakthroughs are still done by the
> lone inventory/researcher.

Particularly in the field of astronomy where amateurs are still able to 
contribute greatly. However gone are the days when I could conduct high 
energy particle physics experiments in my own basement and launch 
interplanetary space probes from my own backyard.

> You cannot discount the merit of one 
> person's contribution because you think they should have another work
> style/ethic.
>
> > Now going back to the OP:
> >
> > "...can some body help me, how to start php framwork for large
> > site?", in the absence of any other cues, this question gives me the
> > impression that the questioner is completely clueless (sorry if it
> > offends you OP), to which the only sensible response is "to use a
> > variety of existing frameworks until you no longer need to ask the
> > question".
>
> Actually from the OP's statement I see that he wants clues on how to
> start a FRAMEWORK, not clues on how to start a PROJECT. If he wanted
> you to infer another intent he probably would have used another set of
> words. And if he did mean PROJECT instead of FRAMEWORK then he should
> have stated so since given no other context we can only know what he
> has written... all else is conjecture. It's possible I missed something
> though, perhaps invisible font text *uhuh uhuh*, and there really is
> the word "project" in the OP's post. I'd appreciate you pointing it out
> to me.

Please point out to me where in the above paragraph (ie starting from the 
line "Now going back to the OP:") do I mention PROJECT. What kind of nit 
are you trying to pick?

And in other news:

>1. gain experience from doing [your own framework]

I would wager that a clueless newbie would learn faster and more about 
frameworks by _using_ and _studying_ other mature frameworks. Because, to 
re-iterate and paraphrase what I said earlier, the very fact that the OP 
had to ask "how to start my own framework" means that the OP really 
hadn't thought things through and did not do any feasibility studies etc. 
In any case a mailing list is not the best place to answer such an open 
ended question, especially if the best contributions that *you* can come 
up with is 

"yes, it's fun to make your own framework"

and

> Yep, fly like a chicken.


-- 
Crayon

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



[PHP] subtracting time from date and time

2007-06-18 Thread Richard Kurth
I am trying to figure out what is the most accurate way to find the time
after I subtract 5 min,15 min, 30 min 1 hour 2 hours and 5 hours from a date
and time that is formatted like this 
20070617T193500 this is the way it has to be formatted to work in a
vcalendar
 
 
 


[PHP] Aggressive PHP Smart Caching

2007-06-18 Thread Alexander Romanovich

I'm a PHP developer looking for feedback on a caching approach I put
together recently. It's informed by thoughts people have shared on this
newslist and other places over the years. My goal was to come up with an
extremely lightweight flat file caching system which solves various concerns
about portability, speed, and specific feature implementations.


Included is a wishlist I generated to explain the approach. The code is
small, and documented, and easy to test for those interested. Feedback form
attached to the following web page (but this newsgroup is as good a forum as
any, too).


http://technologies.babywhale.net/cache/


RE: [PHP] Re: php framework, large site

2007-06-18 Thread tedd

On Monday 18 June 2007 00:12, Robert Cummings wrote:

 > Good reasons to write your own:

It's an extremely inefficient use of precious time. Inventing the wheel
over and over. Surely out of the billions of half-baked to fully-baked
frameworks out there must be something suitable for everyone. How far
would you take it? Write your own PHP, why not write your own OS, heck
build your own computer while you're at it :)

--
Crayon



What about the wasted time in searching through "billions of 
half-baked to fully-baked

frameworks" to find one that works for you? That's really a waste of time.

Additionally, you said:


heck build your own computer while you're at it :)


Yeah, like this world need another Apple.  :-)

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 17:52 +0200, Jochem Maas wrote:
> Robert Cummings wrote:
> > On Mon, 2007-06-18 at 17:24 +0200, Jochem Maas wrote:
> >> Daniel Brown wrote:
> >>> On 6/18/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> >> 
> >>
> >>>Keep in mind, though, that a good part of the time here in the
> >>> United States, employment is gained by knowing someone (not
> >>> necessarily political, but someone may ask, "hey, do you know anyone
> >>> who knows how to  ").  That's actually how I got the job that I'm
> >>> in, and my degree was in Criminal Justice back in the nineties.  I
> >>> never got a computer science degree, nor do I think I ever plan on
> >>> getting one.
> >> 
> >>
> >> which explains why 90% of wallstreet-broker/CEO types that I've met
> >> (you know six figure salaries and 7 figure bonuses) are thick as pigshit.
> > 
> > And why exactly were you hanging around the pig sty? (perchance you were
> > looking for the sheep pen and lost your way? ;) ;)
> > 
> > Ba  d Jochem!
> 
> not sure what the reference to sheep is about, but lets just say I was
> born in the sty. Animal Farm anyone?

Ooooh, just the usual sheep reference :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Jochem Maas
Robert Cummings wrote:
> On Mon, 2007-06-18 at 17:24 +0200, Jochem Maas wrote:
>> Daniel Brown wrote:
>>> On 6/18/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> 
>>
>>>Keep in mind, though, that a good part of the time here in the
>>> United States, employment is gained by knowing someone (not
>>> necessarily political, but someone may ask, "hey, do you know anyone
>>> who knows how to  ").  That's actually how I got the job that I'm
>>> in, and my degree was in Criminal Justice back in the nineties.  I
>>> never got a computer science degree, nor do I think I ever plan on
>>> getting one.
>> 
>>
>> which explains why 90% of wallstreet-broker/CEO types that I've met
>> (you know six figure salaries and 7 figure bonuses) are thick as pigshit.
> 
> And why exactly were you hanging around the pig sty? (perchance you were
> looking for the sheep pen and lost your way? ;) ;)
> 
> Ba  d Jochem!

not sure what the reference to sheep is about, but lets just say I was
born in the sty. Animal Farm anyone?

> 
> Cheers,
> Rob.

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 08:41 -0700, Jim Lucas wrote:
> Daniel Brown wrote:
> > On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> >> On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> >> > On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> >> > > On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> >> > > > On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> >> > > > > clive wrote:
> >> > > > > >>
> >> > > > > >> I have no clue how big the files are, but you might want to 
> >> store them
> >> > > > > >> in a database. That can speed up things, but don't ask me 
> >> how much ;)
> >> > > > > >>
> >> > > > > >> Tijnema
> >> > > > > >>
> >> > > > > > no dude, while database are convenient, files systems are 
> >> faster, I mean
> >> > > > > > thats what they were designed for, serving files.
> >> > > > > >
> >> > > > > > For lots of files I would store them in directories and sub 
> >> directories.
> >> > > > >
> >> > > > > Yeah amen!
> >> > > > >
> >> > > > > I generally use a two character hex hash in  my main folder to 
> >> give 255
> >> > > > > sub folders each containing files.
> >> > > > >
> >> > > > > In my case the hash is calculated from some known info - e.g. 
> >> a database
> >> > > > > ID and then stored in a meta data table.
> >> > > > >
> >> > > > > Col
> >> > > > >
> >> > > > > --
> >> > > > > PHP General Mailing List (http://www.php.net/)
> >> > > > > To unsubscribe, visit: http://www.php.net/unsub.php
> >> > > > >
> >> > > > >
> >> > > >
> >> > > >Tij,
> >> > > >
> >> > > >Referring to one of my earlier posts in this thread, as a
> >> > > > refresher, database information is stored in files.  So to store 
> >> files
> >> > > > in a database means the following has to take place:
> >> > > >
> >> > > >1.) Data is uploaded to the server.
> >> > > >2.) Data is processed by the database server.
> >> > > >3.) Data is compressed and encrypted.
> >> > > >4.) Data is written to disk.
> >> > > >(4b. - optional) Data file is checked for integrity and
> >> > > > correctness of write.
> >> > > >
> >> > > >Then, to serve the content, a similar reverse occurs:
> >> > > >
> >> > > >1.) Request is sent to the server via a script.
> >> > > >2.) The script interfaces with the database to locate the
> >> > > > desired data row.
> >> > > >3.) Once located, the data is pulled in raw form from the 
> >> database file.
> >> > > >4.) The data is then decompressed and decrypted.
> >> > > >5.) The data is streamed back to the script.
> >> > > >6.) The script decides how to handle it, based upon 
> >> hard-coded options.
> >> > > >
> >> > > >For a filesystem, it's simpler.  Uploading:
> >> > > >
> >> > > >1.) Data is uploaded.
> >> > > >2.) Data is written to disk.
> >> > > >
> >> > > >Serving:
> >> > > >
> >> > > >1.) Request is sent via script, FTP, socket connection, or
> >> > > > local request.
> >> > > >2.) File is served through via the method requested.
> >> > > >
> >> > > >So there are several pros and cons for each, but just to list
> >> > > > three of each with regard to database storage:
> >> > > >
> >> > > >Pros:
> >> > > >Can be stored centralized and portable, without needing 
> >> to archive.
> >> > > >Automatically encrypted and compressed upon storage.
> >> > > >Easier and faster to search.
> >> > > >Cons:
> >> > > >Slower storage and retrieval
> >> > > >Much greater risk of corruption
> >> > > >Not always cross-compatible across platforms, versions,
> >> > > > installations, etc.
> >> > > >
> >> > > > --
> >> > > > Daniel P. Brown
> >> > >
> >> > > How sure are you about all this?
> >> > > Benchmarks?
> >> > >
> >> > > What about search time for the harddrives etc? It needs to scan the
> >> > > inode table to find the file, etc.., then it needs to locate that 
> >> file
> >> > > on the harddrive, while the second file might be on the other side of
> >> > > the disk
> >> > >
> >> > > Storing all files in one single filesystem means you have only 1 
> >> inode
> >> > > :) All data is stored at same place (atleast, it should be)
> >> > >
> >> > > Tijnema
> >> > >
> >> >
> >> >Do I have benchmarks?  No.  Do I have the time to do them now?  No.
> >> >
> >> >Do I feel confident enough that if you were to run those benchmark
> >> > tests that it would prove me right?  Damn straight.  ;-P
> >> >
> >> > --
> >> > Daniel P. Brown
> >>
> >> I think I have some time to write a simple script in a few hours, I'd
> >> like to see what the performance difference is :)
> >>
> >> Tijnema
> >>
> > 
> >Well, keep in mind that I don't expect that you'd see much
> > difference at all with a single file, but try doing multiple files of
> > ASCII and binary, various sizes, and also several simultaneous
> > connections.
> > 
> >Two other things I forgot to mention with database storage are a
> > pro an

[PHP] Re: Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Colin Guthrie
Robert Cummings wrote:
> Things I learned to do while obtaining my B.C.S. degree:
> 
...
... snip of lots of interesting/funny stuff
...
> For me going to university was a little bit about getting a piece of
> paper and a lot about having fun and meeting people (I met my wife
> there). One thing that I think is helpful about university is that it
> brings a lot of smaller pieces of the greater picture together in a
> useful and cohesive manner.

That was an exceptionally well written and well thought out response. It
was very funny but also quite correct if my own recollections (hazy as
they are) are anything to go by! All universities are part of the
university of life after all ;)

Col

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Jim Lucas

Daniel Brown wrote:

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > > On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> > > > clive wrote:
> > > > >>
> > > > >> I have no clue how big the files are, but you might want to 
store them
> > > > >> in a database. That can speed up things, but don't ask me 
how much ;)

> > > > >>
> > > > >> Tijnema
> > > > >>
> > > > > no dude, while database are convenient, files systems are 
faster, I mean

> > > > > thats what they were designed for, serving files.
> > > > >
> > > > > For lots of files I would store them in directories and sub 
directories.

> > > >
> > > > Yeah amen!
> > > >
> > > > I generally use a two character hex hash in  my main folder to 
give 255

> > > > sub folders each containing files.
> > > >
> > > > In my case the hash is calculated from some known info - e.g. 
a database

> > > > ID and then stored in a meta data table.
> > > >
> > > > Col
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> > >Tij,
> > >
> > >Referring to one of my earlier posts in this thread, as a
> > > refresher, database information is stored in files.  So to store 
files

> > > in a database means the following has to take place:
> > >
> > >1.) Data is uploaded to the server.
> > >2.) Data is processed by the database server.
> > >3.) Data is compressed and encrypted.
> > >4.) Data is written to disk.
> > >(4b. - optional) Data file is checked for integrity and
> > > correctness of write.
> > >
> > >Then, to serve the content, a similar reverse occurs:
> > >
> > >1.) Request is sent to the server via a script.
> > >2.) The script interfaces with the database to locate the
> > > desired data row.
> > >3.) Once located, the data is pulled in raw form from the 
database file.

> > >4.) The data is then decompressed and decrypted.
> > >5.) The data is streamed back to the script.
> > >6.) The script decides how to handle it, based upon 
hard-coded options.

> > >
> > >For a filesystem, it's simpler.  Uploading:
> > >
> > >1.) Data is uploaded.
> > >2.) Data is written to disk.
> > >
> > >Serving:
> > >
> > >1.) Request is sent via script, FTP, socket connection, or
> > > local request.
> > >2.) File is served through via the method requested.
> > >
> > >So there are several pros and cons for each, but just to list
> > > three of each with regard to database storage:
> > >
> > >Pros:
> > >Can be stored centralized and portable, without needing 
to archive.

> > >Automatically encrypted and compressed upon storage.
> > >Easier and faster to search.
> > >Cons:
> > >Slower storage and retrieval
> > >Much greater risk of corruption
> > >Not always cross-compatible across platforms, versions,
> > > installations, etc.
> > >
> > > --
> > > Daniel P. Brown
> >
> > How sure are you about all this?
> > Benchmarks?
> >
> > What about search time for the harddrives etc? It needs to scan the
> > inode table to find the file, etc.., then it needs to locate that 
file

> > on the harddrive, while the second file might be on the other side of
> > the disk
> >
> > Storing all files in one single filesystem means you have only 1 
inode

> > :) All data is stored at same place (atleast, it should be)
> >
> > Tijnema
> >
>
>Do I have benchmarks?  No.  Do I have the time to do them now?  No.
>
>Do I feel confident enough that if you were to run those benchmark
> tests that it would prove me right?  Damn straight.  ;-P
>
> --
> Daniel P. Brown

I think I have some time to write a simple script in a few hours, I'd
like to see what the performance difference is :)

Tijnema



   Well, keep in mind that I don't expect that you'd see much
difference at all with a single file, but try doing multiple files of
ASCII and binary, various sizes, and also several simultaneous
connections.

   Two other things I forgot to mention with database storage are a
pro and con, respectively - caching and accessibility.



and the fact that a lot of hosting environments have a DB on a different 
machine.

This would make for a much worse performance then the local filesystem.

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 11:25 -0400, Daniel Brown wrote:
> On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > > > >Referring to one of my earlier posts in this thread, as a
> > > > > refresher, database information is stored in files.  So to store files
> > > > > in a database means the following has to take place:
> > > > >
> > > > >1.) Data is uploaded to the server.
> > > > >2.) Data is processed by the database server.
> > > > >3.) Data is compressed and encrypted.
> > > > >4.) Data is written to disk.
> > > > >(4b. - optional) Data file is checked for integrity and
> > > > > correctness of write.
> > > > >
> > > > >Then, to serve the content, a similar reverse occurs:
> > > > >
> > > > >1.) Request is sent to the server via a script.
> > > > >2.) The script interfaces with the database to locate the
> > > > > desired data row.
> > > > >3.) Once located, the data is pulled in raw form from the 
> > > > > database file.
> > > > >4.) The data is then decompressed and decrypted.
> > > > >5.) The data is streamed back to the script.
> > > > >6.) The script decides how to handle it, based upon hard-coded 
> > > > > options.
> > > > >
> > > > >For a filesystem, it's simpler.  Uploading:
> > > > >
> > > > >1.) Data is uploaded.
> > > > >2.) Data is written to disk.

This isn't quite correct. There are numerous databases that allow you to
assign a raw partition and they manage the filesystem themselves thus
the intermediate OS dependence is eliminated. As such, the database
probably wins in this situation since you also get rapid searching on
any meta data fields and since you probably have to issue a query
anyways (for either approach), this approach is superior since you no
longer need to interact with the filesystem at all. The only negative is
that writing to the database will be less efficient due to escaping of
the data. But reading will be much faster. And in practice, I'd wager,
it's rare that images are created more often than read.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Daniel Brown

On 6/18/07, Jochem Maas <[EMAIL PROTECTED]> wrote:

Tijnema wrote:
> On 6/18/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:

...

>> >> Edward
>
> Yes, but if you pay $10K for you study, and you get $1K extra each
> year, you need to work 10 years to get your money back, and I didn't
> even count the costs of your valuable time...

Tijnema your showing your age - the calculation you give is, to put it
politely, naive. stick to what you know until such time as you've paid
for and dealt with one or more of the following out of your pocket:

huur/hypotheek
ziektenkostenverzekering
inkostenbelasting
alimentatie
een tas vol boodschapen
een brommer
jou eigen schoenen

sorry kid, I couldn't resist. ;-)

>
> Tijnema
>

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




Een prostituee van wat u een ziekte zult krijgen die heeft geen naam.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 17:24 +0200, Jochem Maas wrote:
> Daniel Brown wrote:
> > On 6/18/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> 
> 
> 
> >>
> > 
> >Keep in mind, though, that a good part of the time here in the
> > United States, employment is gained by knowing someone (not
> > necessarily political, but someone may ask, "hey, do you know anyone
> > who knows how to  ").  That's actually how I got the job that I'm
> > in, and my degree was in Criminal Justice back in the nineties.  I
> > never got a computer science degree, nor do I think I ever plan on
> > getting one.
> 
> 
> 
> which explains why 90% of wallstreet-broker/CEO types that I've met
> (you know six figure salaries and 7 figure bonuses) are thick as pigshit.

And why exactly were you hanging around the pig sty? (perchance you were
looking for the sheep pen and lost your way? ;) ;)

Ba  d Jochem!

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Jochem Maas
Robert Cummings wrote:

...

> 
> Cheers,
> Rob.

great story Robert (look spelt it correctly that time ;-)) - made my day!

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Jochem Maas
Daniel Brown wrote:
> On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
>> On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
>> > On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
>> > > Yes, but if you pay $10K for you study, and you get $1K extra each
>> > > year, you need to work 10 years to get your money back, and I didn't
>> > > even count the costs of your valuable time...
>> > >
>> >
>> >Ten thousand dollars for a college degree?  Where the hell is
>> that school?!?
>> >
>> >When I was in college, I paid more than that per year, and it
>> > wasn't even /that/ good of a school!
>> >
>> > --
>> > Daniel P. Brown
>>
>> Well, here in the Netherlands, I'm not totally sure about the prices
>> but in € it's about the price we pay...
>> Government pays the rest.. :)
>> IIRC, it was €2.5K for the college itself, and €1K for studying books
>> each year, well, nearly all studies are four year here, so that means
>> about €14K total.
>> Close to €10k ;), but let me correct it, it's nearly $19K.
>> So that means working 19 years :P, or get $2K extra each year :)
>>
>> Tijnema
>>
> 
>Here, you either have to be destitute, a minority, have done
> something extremely beneficial to humanity, know someone in political
> power, win a lottery, or serve at least one full tour in the armed
> services to get free money from the government for school.  They'll
> gladly give you loans, though at 14-19% APR or higher.

we have a more social system in holland - although the figures Tijnema is
quoting are crap unless you assume that mummy and daddy pay for just
about everything but the actual book and study fees.

I know one guy that has 90,000 euro debt from medical school - admittedly
he's taken 7-9 years (he had a stopyear I believe) but nonetheless you get the
point (especially if you know that the guy also had various parttime jobs during
that time)

> 

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Daniel Brown

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > > On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> > > > clive wrote:
> > > > >>
> > > > >> I have no clue how big the files are, but you might want to store 
them
> > > > >> in a database. That can speed up things, but don't ask me how much ;)
> > > > >>
> > > > >> Tijnema
> > > > >>
> > > > > no dude, while database are convenient, files systems are faster, I 
mean
> > > > > thats what they were designed for, serving files.
> > > > >
> > > > > For lots of files I would store them in directories and sub 
directories.
> > > >
> > > > Yeah amen!
> > > >
> > > > I generally use a two character hex hash in  my main folder to give 255
> > > > sub folders each containing files.
> > > >
> > > > In my case the hash is calculated from some known info - e.g. a database
> > > > ID and then stored in a meta data table.
> > > >
> > > > Col
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > >
> > > >
> > >
> > >Tij,
> > >
> > >Referring to one of my earlier posts in this thread, as a
> > > refresher, database information is stored in files.  So to store files
> > > in a database means the following has to take place:
> > >
> > >1.) Data is uploaded to the server.
> > >2.) Data is processed by the database server.
> > >3.) Data is compressed and encrypted.
> > >4.) Data is written to disk.
> > >(4b. - optional) Data file is checked for integrity and
> > > correctness of write.
> > >
> > >Then, to serve the content, a similar reverse occurs:
> > >
> > >1.) Request is sent to the server via a script.
> > >2.) The script interfaces with the database to locate the
> > > desired data row.
> > >3.) Once located, the data is pulled in raw form from the database 
file.
> > >4.) The data is then decompressed and decrypted.
> > >5.) The data is streamed back to the script.
> > >6.) The script decides how to handle it, based upon hard-coded 
options.
> > >
> > >For a filesystem, it's simpler.  Uploading:
> > >
> > >1.) Data is uploaded.
> > >2.) Data is written to disk.
> > >
> > >Serving:
> > >
> > >1.) Request is sent via script, FTP, socket connection, or
> > > local request.
> > >2.) File is served through via the method requested.
> > >
> > >So there are several pros and cons for each, but just to list
> > > three of each with regard to database storage:
> > >
> > >Pros:
> > >Can be stored centralized and portable, without needing to archive.
> > >Automatically encrypted and compressed upon storage.
> > >Easier and faster to search.
> > >Cons:
> > >Slower storage and retrieval
> > >Much greater risk of corruption
> > >Not always cross-compatible across platforms, versions,
> > > installations, etc.
> > >
> > > --
> > > Daniel P. Brown
> >
> > How sure are you about all this?
> > Benchmarks?
> >
> > What about search time for the harddrives etc? It needs to scan the
> > inode table to find the file, etc.., then it needs to locate that file
> > on the harddrive, while the second file might be on the other side of
> > the disk
> >
> > Storing all files in one single filesystem means you have only 1 inode
> > :) All data is stored at same place (atleast, it should be)
> >
> > Tijnema
> >
>
>Do I have benchmarks?  No.  Do I have the time to do them now?  No.
>
>Do I feel confident enough that if you were to run those benchmark
> tests that it would prove me right?  Damn straight.  ;-P
>
> --
> Daniel P. Brown

I think I have some time to write a simple script in a few hours, I'd
like to see what the performance difference is :)

Tijnema



   Well, keep in mind that I don't expect that you'd see much
difference at all with a single file, but try doing multiple files of
ASCII and binary, various sizes, and also several simultaneous
connections.

   Two other things I forgot to mention with database storage are a
pro and con, respectively - caching and accessibility.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 15:18 +0100, Colin Guthrie wrote:
>  so another key thing I'd personally like
> to see is the commitment to the cause! If someone comes on board for 6
> months this is not ideal, but if they stick around for 2 years+ then
> this is perfect! This is always hard to judge for everyone tho' as
> people (and companies) change.

Unless of course they suck and you can't get rid of them and they linger
forever... it happens *hehe*.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Jochem Maas
Daniel Brown wrote:
> On 6/18/07, Robert Cummings <[EMAIL PROTECTED]> wrote:



>>
> 
>Keep in mind, though, that a good part of the time here in the
> United States, employment is gained by knowing someone (not
> necessarily political, but someone may ask, "hey, do you know anyone
> who knows how to  ").  That's actually how I got the job that I'm
> in, and my degree was in Criminal Justice back in the nineties.  I
> never got a computer science degree, nor do I think I ever plan on
> getting one.



which explains why 90% of wallstreet-broker/CEO types that I've met
(you know six figure salaries and 7 figure bonuses) are thick as pigshit.

> 

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Jochem Maas
Tijnema wrote:
> On 6/18/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:

...

>> >> Edward
> 
> Yes, but if you pay $10K for you study, and you get $1K extra each
> year, you need to work 10 years to get your money back, and I didn't
> even count the costs of your valuable time...

Tijnema your showing your age - the calculation you give is, to put it
politely, naive. stick to what you know until such time as you've paid
for and dealt with one or more of the following out of your pocket:

huur/hypotheek
ziektenkostenverzekering
inkostenbelasting
alimentatie
een tas vol boodschapen
een brommer
jou eigen schoenen

sorry kid, I couldn't resist. ;-)

> 
> Tijnema
> 

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Tijnema

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> > > clive wrote:
> > > >>
> > > >> I have no clue how big the files are, but you might want to store them
> > > >> in a database. That can speed up things, but don't ask me how much ;)
> > > >>
> > > >> Tijnema
> > > >>
> > > > no dude, while database are convenient, files systems are faster, I mean
> > > > thats what they were designed for, serving files.
> > > >
> > > > For lots of files I would store them in directories and sub directories.
> > >
> > > Yeah amen!
> > >
> > > I generally use a two character hex hash in  my main folder to give 255
> > > sub folders each containing files.
> > >
> > > In my case the hash is calculated from some known info - e.g. a database
> > > ID and then stored in a meta data table.
> > >
> > > Col
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >Tij,
> >
> >Referring to one of my earlier posts in this thread, as a
> > refresher, database information is stored in files.  So to store files
> > in a database means the following has to take place:
> >
> >1.) Data is uploaded to the server.
> >2.) Data is processed by the database server.
> >3.) Data is compressed and encrypted.
> >4.) Data is written to disk.
> >(4b. - optional) Data file is checked for integrity and
> > correctness of write.
> >
> >Then, to serve the content, a similar reverse occurs:
> >
> >1.) Request is sent to the server via a script.
> >2.) The script interfaces with the database to locate the
> > desired data row.
> >3.) Once located, the data is pulled in raw form from the database 
file.
> >4.) The data is then decompressed and decrypted.
> >5.) The data is streamed back to the script.
> >6.) The script decides how to handle it, based upon hard-coded 
options.
> >
> >For a filesystem, it's simpler.  Uploading:
> >
> >1.) Data is uploaded.
> >2.) Data is written to disk.
> >
> >Serving:
> >
> >1.) Request is sent via script, FTP, socket connection, or
> > local request.
> >2.) File is served through via the method requested.
> >
> >So there are several pros and cons for each, but just to list
> > three of each with regard to database storage:
> >
> >Pros:
> >Can be stored centralized and portable, without needing to archive.
> >Automatically encrypted and compressed upon storage.
> >Easier and faster to search.
> >Cons:
> >Slower storage and retrieval
> >Much greater risk of corruption
> >Not always cross-compatible across platforms, versions,
> > installations, etc.
> >
> > --
> > Daniel P. Brown
>
> How sure are you about all this?
> Benchmarks?
>
> What about search time for the harddrives etc? It needs to scan the
> inode table to find the file, etc.., then it needs to locate that file
> on the harddrive, while the second file might be on the other side of
> the disk
>
> Storing all files in one single filesystem means you have only 1 inode
> :) All data is stored at same place (atleast, it should be)
>
> Tijnema
>

   Do I have benchmarks?  No.  Do I have the time to do them now?  No.

   Do I feel confident enough that if you were to run those benchmark
tests that it would prove me right?  Damn straight.  ;-P

--
Daniel P. Brown


I think I have some time to write a simple script in a few hours, I'd
like to see what the performance difference is :)

Tijnema

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Daniel Brown

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> > clive wrote:
> > >>
> > >> I have no clue how big the files are, but you might want to store them
> > >> in a database. That can speed up things, but don't ask me how much ;)
> > >>
> > >> Tijnema
> > >>
> > > no dude, while database are convenient, files systems are faster, I mean
> > > thats what they were designed for, serving files.
> > >
> > > For lots of files I would store them in directories and sub directories.
> >
> > Yeah amen!
> >
> > I generally use a two character hex hash in  my main folder to give 255
> > sub folders each containing files.
> >
> > In my case the hash is calculated from some known info - e.g. a database
> > ID and then stored in a meta data table.
> >
> > Col
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>Tij,
>
>Referring to one of my earlier posts in this thread, as a
> refresher, database information is stored in files.  So to store files
> in a database means the following has to take place:
>
>1.) Data is uploaded to the server.
>2.) Data is processed by the database server.
>3.) Data is compressed and encrypted.
>4.) Data is written to disk.
>(4b. - optional) Data file is checked for integrity and
> correctness of write.
>
>Then, to serve the content, a similar reverse occurs:
>
>1.) Request is sent to the server via a script.
>2.) The script interfaces with the database to locate the
> desired data row.
>3.) Once located, the data is pulled in raw form from the database 
file.
>4.) The data is then decompressed and decrypted.
>5.) The data is streamed back to the script.
>6.) The script decides how to handle it, based upon hard-coded options.
>
>For a filesystem, it's simpler.  Uploading:
>
>1.) Data is uploaded.
>2.) Data is written to disk.
>
>Serving:
>
>1.) Request is sent via script, FTP, socket connection, or
> local request.
>2.) File is served through via the method requested.
>
>So there are several pros and cons for each, but just to list
> three of each with regard to database storage:
>
>Pros:
>Can be stored centralized and portable, without needing to archive.
>Automatically encrypted and compressed upon storage.
>Easier and faster to search.
>Cons:
>Slower storage and retrieval
>Much greater risk of corruption
>Not always cross-compatible across platforms, versions,
> installations, etc.
>
> --
> Daniel P. Brown

How sure are you about all this?
Benchmarks?

What about search time for the harddrives etc? It needs to scan the
inode table to find the file, etc.., then it needs to locate that file
on the harddrive, while the second file might be on the other side of
the disk

Storing all files in one single filesystem means you have only 1 inode
:) All data is stored at same place (atleast, it should be)

Tijnema



   Do I have benchmarks?  No.  Do I have the time to do them now?  No.

   Do I feel confident enough that if you were to run those benchmark
tests that it would prove me right?  Damn straight.  ;-P

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



[PHP] Re: Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Colin Guthrie
Jochem Maas wrote:
> Edward Kay wrote:
> 
> ...
> 
>> But the advert is for a GRADUATE developer ;) Whilst your messages to this
>> list show you know a lot about PHP, I doubt you've managed to fit a degree
>> in yet :)
> 
> What does a graduate php developer earn in Scotland? and is it
> the the piece of paper that's important or is it a reference to the
> general skill level (personally I don't see much direct corellation
> between academic capabilities and practical coding/sysadmin skill).
> 
> just thinking out loud guys :-)

Yeah I know what you mean. The bit of paper isn't really all that
important, but it's the pool of people where you are most likely to get
good candidates. I certainly wouldn't turn someone away if their skill
set looked good but they didn't have a degree.

Coding ability is obviously important but as it's a small company,
fitting in with the ethos and ethics of small companies is equally
important (if not more so).

If I'm being honest I never finished my final year at Uni because I was
off starting my own company. I did get a bit of paper but it wasn't as
fancy as the one I'd have gotten if I'd finished that last year!

One thing that is important is that hiring someone is expensive. Not
necessarily in terms of $$$ but in terms of time and integrating new
people into the team, learning the processes and such (it all boils down
to $$$ in the end of course!), so another key thing I'd personally like
to see is the commitment to the cause! If someone comes on board for 6
months this is not ideal, but if they stick around for 2 years+ then
this is perfect! This is always hard to judge for everyone tho' as
people (and companies) change.


Col

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Daniel Brown

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > Yes, but if you pay $10K for you study, and you get $1K extra each
> > year, you need to work 10 years to get your money back, and I didn't
> > even count the costs of your valuable time...
> >
>
>Ten thousand dollars for a college degree?  Where the hell is that 
school?!?
>
>When I was in college, I paid more than that per year, and it
> wasn't even /that/ good of a school!
>
> --
> Daniel P. Brown

Well, here in the Netherlands, I'm not totally sure about the prices
but in € it's about the price we pay...
Government pays the rest.. :)
IIRC, it was €2.5K for the college itself, and €1K for studying books
each year, well, nearly all studies are four year here, so that means
about €14K total.
Close to €10k ;), but let me correct it, it's nearly $19K.
So that means working 19 years :P, or get $2K extra each year :)

Tijnema



   Here, you either have to be destitute, a minority, have done
something extremely beneficial to humanity, know someone in political
power, win a lottery, or serve at least one full tour in the armed
services to get free money from the government for school.  They'll
gladly give you loans, though at 14-19% APR or higher.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Tijnema

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> clive wrote:
> >>
> >> I have no clue how big the files are, but you might want to store them
> >> in a database. That can speed up things, but don't ask me how much ;)
> >>
> >> Tijnema
> >>
> > no dude, while database are convenient, files systems are faster, I mean
> > thats what they were designed for, serving files.
> >
> > For lots of files I would store them in directories and sub directories.
>
> Yeah amen!
>
> I generally use a two character hex hash in  my main folder to give 255
> sub folders each containing files.
>
> In my case the hash is calculated from some known info - e.g. a database
> ID and then stored in a meta data table.
>
> Col
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

   Tij,

   Referring to one of my earlier posts in this thread, as a
refresher, database information is stored in files.  So to store files
in a database means the following has to take place:

   1.) Data is uploaded to the server.
   2.) Data is processed by the database server.
   3.) Data is compressed and encrypted.
   4.) Data is written to disk.
   (4b. - optional) Data file is checked for integrity and
correctness of write.

   Then, to serve the content, a similar reverse occurs:

   1.) Request is sent to the server via a script.
   2.) The script interfaces with the database to locate the
desired data row.
   3.) Once located, the data is pulled in raw form from the database file.
   4.) The data is then decompressed and decrypted.
   5.) The data is streamed back to the script.
   6.) The script decides how to handle it, based upon hard-coded options.

   For a filesystem, it's simpler.  Uploading:

   1.) Data is uploaded.
   2.) Data is written to disk.

   Serving:

   1.) Request is sent via script, FTP, socket connection, or
local request.
   2.) File is served through via the method requested.

   So there are several pros and cons for each, but just to list
three of each with regard to database storage:

   Pros:
   Can be stored centralized and portable, without needing to archive.
   Automatically encrypted and compressed upon storage.
   Easier and faster to search.
   Cons:
   Slower storage and retrieval
   Much greater risk of corruption
   Not always cross-compatible across platforms, versions,
installations, etc.

--
Daniel P. Brown


How sure are you about all this?
Benchmarks?

What about search time for the harddrives etc? It needs to scan the
inode table to find the file, etc.., then it needs to locate that file
on the harddrive, while the second file might be on the other side of
the disk

Storing all files in one single filesystem means you have only 1 inode
:) All data is stored at same place (atleast, it should be)

Tijnema

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Tijnema

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:
> Yes, but if you pay $10K for you study, and you get $1K extra each
> year, you need to work 10 years to get your money back, and I didn't
> even count the costs of your valuable time...
>

   Ten thousand dollars for a college degree?  Where the hell is that school?!?

   When I was in college, I paid more than that per year, and it
wasn't even /that/ good of a school!

--
Daniel P. Brown


Well, here in the Netherlands, I'm not totally sure about the prices
but in € it's about the price we pay...
Government pays the rest.. :)
IIRC, it was €2.5K for the college itself, and €1K for studying books
each year, well, nearly all studies are four year here, so that means
about €14K total.
Close to €10k ;), but let me correct it, it's nearly $19K.
So that means working 19 years :P, or get $2K extra each year :)

Tijnema

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



Re: [PHP] Unable to use exec() in php

2007-06-18 Thread Daniel Brown

On 6/18/07, MIKE YRABEDRA <[EMAIL PROTECTED]> wrote:



Is there a special way to allow only a specific user to execute the
system_exec() and exec() calls?



on 6/18/07 10:31 AM, Daniel Brown at [EMAIL PROTECTED] wrote:

> On 6/18/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:
>> On Monday 18 June 2007 13:15, makhan wrote:
>>
>> Stop top posting.
>>
>>> I am also using shell_exec('matlab -r myscript') to run
>>> my matlab script.
>>
>> Using shell_exec('matlab -r /path/to/myscript') would be a better idea.
>>
>> --
>> Crayon
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>  exec('date 2>&1',$ret);
> echo $ret."\n";
> ?>

--
Mike Yrabedra B^)>

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




   Mike,

   This is technically thread hijacking.  You'll get a better
response (and less flames) if you start your own thread.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Unable to use exec() in php

2007-06-18 Thread Daniel Brown

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 6/18/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:
> > On Monday 18 June 2007 13:15, makhan wrote:
> >
> > Stop top posting.
> >
> > > I am also using shell_exec('matlab -r myscript') to run
> > > my matlab script.
> >
> > Using shell_exec('matlab -r /path/to/myscript') would be a better idea.
> >
> > --
> > Crayon
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> exec('date 2>&1',$ret);
>echo $ret."\n";
> ?>
>
> --
> Daniel P. Brown

He's on windows ;)

Tijnema



/me smacks head.

"Doy!"

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Daniel Brown

On 6/18/07, Tijnema <[EMAIL PROTECTED]> wrote:

Yes, but if you pay $10K for you study, and you get $1K extra each
year, you need to work 10 years to get your money back, and I didn't
even count the costs of your valuable time...



   Ten thousand dollars for a college degree?  Where the hell is that school?!?

   When I was in college, I paid more than that per year, and it
wasn't even /that/ good of a school!

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Daniel Brown

On 6/18/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Mon, 2007-06-18 at 10:40 -0400, Robert Cummings wrote:
> On Mon, 2007-06-18 at 16:22 +0200, Tijnema wrote:
> > On 6/18/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
> > > Jochem Maas wrote:
> > > > Edward Kay wrote:
> > > >
> > > > ...
> > > >
> > > >
> > > >> But the advert is for a GRADUATE developer ;) Whilst your messages to 
this
> > > >> list show you know a lot about PHP, I doubt you've managed to fit a 
degree
> > > >> in yet :)
> > > >>
> > > >
> > > > What does a graduate php developer earn in Scotland? and is it
> > > > the the piece of paper that's important or is it a reference to the
> > > > general skill level (personally I don't see much direct corellation
> > > > between academic capabilities and practical coding/sysadmin skill).
> > > >
> > > > just thinking out loud guys :-)
> > > >
> > > >
> > > This is always beat around...and my 2 cents are that all the "piece of
> > > paper" is worth is showing you have a certain level of commitment needed
> > > to complete the degree program (important for any job), and that you
> > > have the ability to learn.  Granted...there are always exceptions to the
> > > rule...
> >
> > I think that these programs are too overall based, and jobs are mostly
> > quite focused on a single point. Very simple example, you're working
> > on a text based site, why do you need to know how to use the GD
> > functions?
> > If each company would create its own very simple test, that only
> > focuses on the actual point, than that would see who is appropriate
> > for the job, and who isn't
>
> Maybe so,  but it would tell you who can adapt to change ;) Not that a

Should have read "but it won't tell you..."

Cheers,
Rob.
--
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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




   Keep in mind, though, that a good part of the time here in the
United States, employment is gained by knowing someone (not
necessarily political, but someone may ask, "hey, do you know anyone
who knows how to  ").  That's actually how I got the job that I'm
in, and my degree was in Criminal Justice back in the nineties.  I
never got a computer science degree, nor do I think I ever plan on
getting one.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Tijnema

On 6/18/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Mon, 2007-06-18 at 10:40 -0400, Robert Cummings wrote:
> On Mon, 2007-06-18 at 16:22 +0200, Tijnema wrote:
> > On 6/18/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
> > > Jochem Maas wrote:
> > > > Edward Kay wrote:
> > > >
> > > > ...
> > > >
> > > >
> > > >> But the advert is for a GRADUATE developer ;) Whilst your messages to 
this
> > > >> list show you know a lot about PHP, I doubt you've managed to fit a 
degree
> > > >> in yet :)
> > > >>
> > > >
> > > > What does a graduate php developer earn in Scotland? and is it
> > > > the the piece of paper that's important or is it a reference to the
> > > > general skill level (personally I don't see much direct corellation
> > > > between academic capabilities and practical coding/sysadmin skill).
> > > >
> > > > just thinking out loud guys :-)
> > > >
> > > >
> > > This is always beat around...and my 2 cents are that all the "piece of
> > > paper" is worth is showing you have a certain level of commitment needed
> > > to complete the degree program (important for any job), and that you
> > > have the ability to learn.  Granted...there are always exceptions to the
> > > rule...
> >
> > I think that these programs are too overall based, and jobs are mostly
> > quite focused on a single point. Very simple example, you're working
> > on a text based site, why do you need to know how to use the GD
> > functions?
> > If each company would create its own very simple test, that only
> > focuses on the actual point, than that would see who is appropriate
> > for the job, and who isn't
>
> Maybe so,  but it would tell you who can adapt to change ;) Not that a

Should have read "but it won't tell you..."

Cheers,
Rob.


I guessed that rob ;)

Tijnema

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



Re: [PHP] Re: [BULK] Re: [PHP] OK to have many files in one folder?

2007-06-18 Thread Daniel Brown

On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:

clive wrote:
>>
>> I have no clue how big the files are, but you might want to store them
>> in a database. That can speed up things, but don't ask me how much ;)
>>
>> Tijnema
>>
> no dude, while database are convenient, files systems are faster, I mean
> thats what they were designed for, serving files.
>
> For lots of files I would store them in directories and sub directories.

Yeah amen!

I generally use a two character hex hash in  my main folder to give 255
sub folders each containing files.

In my case the hash is calculated from some known info - e.g. a database
ID and then stored in a meta data table.

Col

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




   Tij,

   Referring to one of my earlier posts in this thread, as a
refresher, database information is stored in files.  So to store files
in a database means the following has to take place:

   1.) Data is uploaded to the server.
   2.) Data is processed by the database server.
   3.) Data is compressed and encrypted.
   4.) Data is written to disk.
   (4b. - optional) Data file is checked for integrity and
correctness of write.

   Then, to serve the content, a similar reverse occurs:

   1.) Request is sent to the server via a script.
   2.) The script interfaces with the database to locate the
desired data row.
   3.) Once located, the data is pulled in raw form from the database file.
   4.) The data is then decompressed and decrypted.
   5.) The data is streamed back to the script.
   6.) The script decides how to handle it, based upon hard-coded options.

   For a filesystem, it's simpler.  Uploading:

   1.) Data is uploaded.
   2.) Data is written to disk.

   Serving:

   1.) Request is sent via script, FTP, socket connection, or
local request.
   2.) File is served through via the method requested.

   So there are several pros and cons for each, but just to list
three of each with regard to database storage:

   Pros:
   Can be stored centralized and portable, without needing to archive.
   Automatically encrypted and compressed upon storage.
   Easier and faster to search.
   Cons:
   Slower storage and retrieval
   Much greater risk of corruption
   Not always cross-compatible across platforms, versions,
installations, etc.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 10:40 -0400, Robert Cummings wrote:
> On Mon, 2007-06-18 at 16:22 +0200, Tijnema wrote:
> > On 6/18/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
> > > Jochem Maas wrote:
> > > > Edward Kay wrote:
> > > >
> > > > ...
> > > >
> > > >
> > > >> But the advert is for a GRADUATE developer ;) Whilst your messages to 
> > > >> this
> > > >> list show you know a lot about PHP, I doubt you've managed to fit a 
> > > >> degree
> > > >> in yet :)
> > > >>
> > > >
> > > > What does a graduate php developer earn in Scotland? and is it
> > > > the the piece of paper that's important or is it a reference to the
> > > > general skill level (personally I don't see much direct corellation
> > > > between academic capabilities and practical coding/sysadmin skill).
> > > >
> > > > just thinking out loud guys :-)
> > > >
> > > >
> > > This is always beat around...and my 2 cents are that all the "piece of
> > > paper" is worth is showing you have a certain level of commitment needed
> > > to complete the degree program (important for any job), and that you
> > > have the ability to learn.  Granted...there are always exceptions to the
> > > rule...
> > 
> > I think that these programs are too overall based, and jobs are mostly
> > quite focused on a single point. Very simple example, you're working
> > on a text based site, why do you need to know how to use the GD
> > functions?
> > If each company would create its own very simple test, that only
> > focuses on the actual point, than that would see who is appropriate
> > for the job, and who isn't
> 
> Maybe so,  but it would tell you who can adapt to change ;) Not that a

Should have read "but it won't tell you..."

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Unable to use exec() in php

2007-06-18 Thread MIKE YRABEDRA


Is there a special way to allow only a specific user to execute the
system_exec() and exec() calls?



on 6/18/07 10:31 AM, Daniel Brown at [EMAIL PROTECTED] wrote:

> On 6/18/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:
>> On Monday 18 June 2007 13:15, makhan wrote:
>> 
>> Stop top posting.
>> 
>>> I am also using shell_exec('matlab -r myscript') to run
>>> my matlab script.
>> 
>> Using shell_exec('matlab -r /path/to/myscript') would be a better idea.
>> 
>> --
>> Crayon
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
> 
>  exec('date 2>&1',$ret);
> echo $ret."\n";
> ?>

-- 
Mike Yrabedra B^)>

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



Re: [PHP] Unable to use exec() in php

2007-06-18 Thread Tijnema

On 6/18/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 6/18/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:
> On Monday 18 June 2007 13:15, makhan wrote:
>
> Stop top posting.
>
> > I am also using shell_exec('matlab -r myscript') to run
> > my matlab script.
>
> Using shell_exec('matlab -r /path/to/myscript') would be a better idea.
>
> --
> Crayon
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

&1',$ret);
   echo $ret."\n";
?>

--
Daniel P. Brown


He's on windows ;)

Tijnema

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 16:22 +0200, Tijnema wrote:
> On 6/18/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:
> > Jochem Maas wrote:
> > > Edward Kay wrote:
> > >
> > > ...
> > >
> > >
> > >> But the advert is for a GRADUATE developer ;) Whilst your messages to 
> > >> this
> > >> list show you know a lot about PHP, I doubt you've managed to fit a 
> > >> degree
> > >> in yet :)
> > >>
> > >
> > > What does a graduate php developer earn in Scotland? and is it
> > > the the piece of paper that's important or is it a reference to the
> > > general skill level (personally I don't see much direct corellation
> > > between academic capabilities and practical coding/sysadmin skill).
> > >
> > > just thinking out loud guys :-)
> > >
> > >
> > This is always beat around...and my 2 cents are that all the "piece of
> > paper" is worth is showing you have a certain level of commitment needed
> > to complete the degree program (important for any job), and that you
> > have the ability to learn.  Granted...there are always exceptions to the
> > rule...
> 
> I think that these programs are too overall based, and jobs are mostly
> quite focused on a single point. Very simple example, you're working
> on a text based site, why do you need to know how to use the GD
> functions?
> If each company would create its own very simple test, that only
> focuses on the actual point, than that would see who is appropriate
> for the job, and who isn't

Maybe so,  but it would tell you who can adapt to change ;) Not that a
university degree will tell you that either.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Robert Cummings
On Mon, 2007-06-18 at 10:08 -0400, Brad Bonkoski wrote:
> Jochem Maas wrote:
> > Edward Kay wrote:
> >
> > ...
> >
> >   
> >> But the advert is for a GRADUATE developer ;) Whilst your messages to this
> >> list show you know a lot about PHP, I doubt you've managed to fit a degree
> >> in yet :)
> >> 
> >
> > What does a graduate php developer earn in Scotland? and is it
> > the the piece of paper that's important or is it a reference to the
> > general skill level (personally I don't see much direct corellation
> > between academic capabilities and practical coding/sysadmin skill).
> >
> > just thinking out loud guys :-)
> >
> >   
> This is always beat around...and my 2 cents are that all the "piece of 
> paper" is worth is showing you have a certain level of commitment needed 
> to complete the degree program (important for any job), and that you 
> have the ability to learn.  Granted...there are always exceptions to the 
> rule...
> 
> Plus, at least in the US, it [a degree] always opens the door for more 
> money! ;-)

Things I learned to do while obtaining my B.C.S. degree:

1. Time management - how to maximize partying time while
   still getting projects done on time. I used a "night
   before" philosophy that incorporated the all-nighter
   strategy. This particular approach isn't for everyone.
   I found 2 litres of cola and a bag of Viva Puffs were
   helpful at alleviating night-time drowsiness. This
   strategy can also work for studying for exams.

2. Efficiency - due to many hangovers there was a great
   need for better efficiency in the learning process. To
   decrease the requisite time needed to absorb information
   it was necessary to not bother showing up to class since
   reading the textbooks was much quicker than listening to
   the sleep inducing drone of the professor (who in many
   cases was practically reading from the textbook). An added
   bonus is you don't need to weep through the ignorant
   questions that are almost guaranteed to be raised
   throughout the class by students who didn't do any reading
   at all. Textbooks also often had nice little chunks of
   source code and margin tidbits that the professor expected
   you to read anyways). I must add though, there were some
   exceptionally interesting professors that made the
   showing up worthwhile, my favourites were the distributed
   and parallel programming courses.

3. Networking - I found branching out to the artsy
   disciplines to be quite invigorating. For some reason
   the distribution of women to men in these areas are much
   more condusive to relationships. I also learned some
   other networking stuff but that was course work. Another
   good area for networking was the campus pub... I had
   an especially delightful time one night when all the
   tutors for my 4th year algorithms course were present and
   I whupped their butts at pool >:)

4. Independence - all the drooling keeners never wanted the
   partying type in their group when group projects were
   mandated. As a result you often learned how to do
   everything yourself -- the night before of course :)

5. Budgeting - how to pay off a student debt during the dot
   com bust days. This mostly involved not doing what was
   done during the years of studying... aka partying :/ It
   took me 6 years to pay off 70k in student debt *lol*.

For me going to university was a little bit about getting a piece of
paper and a lot about having fun and meeting people (I met my wife
there). One thing that I think is helpful about university is that it
brings a lot of smaller pieces of the greater picture together in a
useful and cohesive manner.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Unable to use exec() in php

2007-06-18 Thread Daniel Brown

On 6/18/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote:

On Monday 18 June 2007 13:15, makhan wrote:

Stop top posting.

> I am also using shell_exec('matlab -r myscript') to run
> my matlab script.

Using shell_exec('matlab -r /path/to/myscript') would be a better idea.

--
Crayon

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




&1',$ret);
   echo $ret."\n";
?>

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Tijnema

On 6/18/07, Brad Bonkoski <[EMAIL PROTECTED]> wrote:

Jochem Maas wrote:
> Edward Kay wrote:
>
> ...
>
>
>> But the advert is for a GRADUATE developer ;) Whilst your messages to this
>> list show you know a lot about PHP, I doubt you've managed to fit a degree
>> in yet :)
>>
>
> What does a graduate php developer earn in Scotland? and is it
> the the piece of paper that's important or is it a reference to the
> general skill level (personally I don't see much direct corellation
> between academic capabilities and practical coding/sysadmin skill).
>
> just thinking out loud guys :-)
>
>
This is always beat around...and my 2 cents are that all the "piece of
paper" is worth is showing you have a certain level of commitment needed
to complete the degree program (important for any job), and that you
have the ability to learn.  Granted...there are always exceptions to the
rule...


I think that these programs are too overall based, and jobs are mostly
quite focused on a single point. Very simple example, you're working
on a text based site, why do you need to know how to use the GD
functions?
If each company would create its own very simple test, that only
focuses on the actual point, than that would see who is appropriate
for the job, and who isn't


Plus, at least in the US, it [a degree] always opens the door for more
money! ;-)

>> Edward


Yes, but if you pay $10K for you study, and you get $1K extra each
year, you need to work 10 years to get your money back, and I didn't
even count the costs of your valuable time...

Tijnema

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



Re: [PHP] generating an html intro text ...

2007-06-18 Thread Jochem Maas
Stut wrote:
> Jochem Maas wrote:
>> Stut wrote:
>>> I'm sure Tidy could be employed to do this job. Grab your target length
>>> of text, backtrack until you find < or >. If it's a < then chop that bit
>>> off. Then give it to Tidy to fix the HTML. That should close off any
>>> open tags and give you a properly formed snippet.
>>>
>>> Or you could implement the same functionality yourself quite easily, and
>>> it doesn't need to be well-formed HTML but you would need to check for
>>> tags that don't need closing (img, br, etc).
>>
>> Stut, I going to go out on a limb and say 'bullshit' to those comments,
>> no personal offence meant (I mostly value your input *alot*, but I
>> guess we
>> can't agree all the time):
> 
> None taken, 

good.

> but I think you're making this into a bigger problem than it
> is.

okay.

> 
>> 1. simply backtracking to a '<' or '>' doesn't account for unescaped
>> output
>> within the content pieces/parts of the html, e.g.:
>>
>> look this here character '<' ammounts to invalid html
> 
> If the content is not escaped then it's not going to get displayed
> properly by the browser, so why worry about it?

because plenty/most browser do display it 'properly' even though the actual
HTML is valid - most of my clients use that POS called IE - which does an 
amazing
job at turing dogshit tagsoup (especially M$ proprietary generate cruft - think 
FrontPage, Word,
Publisher etc) into something 'pretty' in the browser window (and usually 
displaying what
the user/client expected ... we'll not go it the flipside where valid HTML is 
borked when output :-/

the client cares that things always display correctly - regardless of the cruft 
that
marketing drone X input into the [internal company] backend system .. when it's 
10-30K euros in turnover
a day that's understandable.

> 
>> 2. backtracking in the manner you describe does account for a large
>> ammount of
>> hmtl at the beginning of the string - remember that the aim of the
>> game is
>> to truncate the user visible content of the html string in question
>> (the comment below would be required to be part of the output - think
>> html comment
>> spam, which is quite effective and some clients state as a requirement):
>>
>> look at
>> this
> 
> Comments are easily removed before snippet generation with a simple regex.
> 
>> you say 'you could implement the same functionality yourself quite
>> easily' - if
>> that was true then why does nobody have a readymade solution - it's
>> not as if the
>> requirement is 'way out there' as far as web development goes. I don't
>> think creating routines
>> for doing advanced manipulation of XML/HTML strings 'properly' is
>> something very simple,
>> something that can be atested to by the relative complexity of libtidy
>> and libxml2.
>>
>> I not looking for a hack job here, I need something that can be relied
>> on to output
>> html strings that will not break the validity (& layout) of a page
>> regardless of the
>> quality of input.
>>
>> the more I think about it the more I inclined to think that Tidy is
>> about to become
>> a close friend. :-)
> 
> If I were you I would definitely be looking at Tidy because it's been
> well tested in the real world and will save a huge amount of effort.
> However, I don't think writing code to do this amounts to a hack. The
> rules of markup are very clear and with a little thought you could
> easily handle the vast majority of possible situations.

probably but 'vast majority' != 'ALL' - and I garantee marketing drone X will
break the system before I can turn my back, murphy's law and all that!

1 word, short word, 2 syllables, first syllable sounds like 'sky'. :-)

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Brad Bonkoski

Jochem Maas wrote:

Edward Kay wrote:

...

  

But the advert is for a GRADUATE developer ;) Whilst your messages to this
list show you know a lot about PHP, I doubt you've managed to fit a degree
in yet :)



What does a graduate php developer earn in Scotland? and is it
the the piece of paper that's important or is it a reference to the
general skill level (personally I don't see much direct corellation
between academic capabilities and practical coding/sysadmin skill).

just thinking out loud guys :-)

  
This is always beat around...and my 2 cents are that all the "piece of 
paper" is worth is showing you have a certain level of commitment needed 
to complete the degree program (important for any job), and that you 
have the ability to learn.  Granted...there are always exceptions to the 
rule...


Plus, at least in the US, it [a degree] always opens the door for more 
money! ;-)



Edward




  


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



Re: [PHP] Re: Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Tijnema

On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:

Tijnema wrote:
> Well, I have a lot experience with PHP, HTML and MySQL. Also some
> experience with Unix system administration.  I'm 15 years old, so
> could I apply for the job? :)

We can offer a competitive package that involves free milk and cookies,
a nap time in the afternoon and a note to get you out of gym class. :p


Forget the note, gym classes are over, holiday time :)
Milk is for babies ;) Don't you have some cola?


Unfortunately, we would be looking for someone who is a little older,
certainly they would need to be over 16 in order to be even *allowed* to
work! We are really looking for someone who has come through university,
but open to anyone who cares to contact us!


Hmm, I don't know the exact laws about working under 16/18, but
atleast you could offer a holiday job ;) I'm available for next 2
months :)


All that said, we may be hiring again in a years time so when you get to
16 drop us a line ;)

Col


That will be in early 2008, I hope I don't forget your company, or
that I get overruled by other companies...



PS free milk and cookies and an afternoon nap actually sounds quite good
now I come to think about it.. :p


:)

Tijnema

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



Re: [PHP] generating an html intro text ...

2007-06-18 Thread Stut

Jochem Maas wrote:

Stut wrote:

I'm sure Tidy could be employed to do this job. Grab your target length
of text, backtrack until you find < or >. If it's a < then chop that bit
off. Then give it to Tidy to fix the HTML. That should close off any
open tags and give you a properly formed snippet.

Or you could implement the same functionality yourself quite easily, and
it doesn't need to be well-formed HTML but you would need to check for
tags that don't need closing (img, br, etc).


Stut, I going to go out on a limb and say 'bullshit' to those comments,
no personal offence meant (I mostly value your input *alot*, but I guess we
can't agree all the time):


None taken, but I think you're making this into a bigger problem than it is.


1. simply backtracking to a '<' or '>' doesn't account for unescaped output
within the content pieces/parts of the html, e.g.:

look this here character '<' ammounts to invalid html


If the content is not escaped then it's not going to get displayed 
properly by the browser, so why worry about it?



2. backtracking in the manner you describe does account for a large ammount of
hmtl at the beginning of the string - remember that the aim of the game is
to truncate the user visible content of the html string in question
(the comment below would be required to be part of the output - think html 
comment
spam, which is quite effective and some clients state as a requirement):

look at this


Comments are easily removed before snippet generation with a simple regex.


you say 'you could implement the same functionality yourself quite easily' - if
that was true then why does nobody have a readymade solution - it's not as if 
the
requirement is 'way out there' as far as web development goes. I don't think 
creating routines
for doing advanced manipulation of XML/HTML strings 'properly' is something 
very simple,
something that can be atested to by the relative complexity of libtidy and 
libxml2.

I not looking for a hack job here, I need something that can be relied on to 
output
html strings that will not break the validity (& layout) of a page regardless 
of the
quality of input.

the more I think about it the more I inclined to think that Tidy is about to 
become
a close friend. :-)


If I were you I would definitely be looking at Tidy because it's been 
well tested in the real world and will save a huge amount of effort. 
However, I don't think writing code to do this amounts to a hack. The 
rules of markup are very clear and with a little thought you could 
easily handle the vast majority of possible situations.


The most hack-like way would be to purely ensure that you don't break in 
the middle of an actual tag (whether it be an opening or closing tag), 
and then wrap it in another tag and let the browser take care of closing 
unclosed tags.


-Stut

--
http://stut.net/

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Jochem Maas
Edward Kay wrote:

...

> 
> But the advert is for a GRADUATE developer ;) Whilst your messages to this
> list show you know a lot about PHP, I doubt you've managed to fit a degree
> in yet :)

What does a graduate php developer earn in Scotland? and is it
the the piece of paper that's important or is it a reference to the
general skill level (personally I don't see much direct corellation
between academic capabilities and practical coding/sysadmin skill).

just thinking out loud guys :-)

> 
> Edward
> 

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



Re: [PHP] Re: Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Chris Boget

PS free milk and cookies and an afternoon nap actually sounds quite good
now I come to think about it.. :p


Almost better than healthcare and retirement benefits... :)

thnx,
Chris

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



Re: [PHP] generating an html intro text ...

2007-06-18 Thread Jochem Maas
Stut wrote:
> Edward Kay wrote:

...

>>
>> A few thoughts I've had on this problem:
>>
>> Assuming it is well formed HTML, you could use a stack. Parse the string
>> putting all opening tags on the stack and then removing them when the
>> close
>> tag is found. This will leave you with all the un-closed tags and in the
>> correct order.
>>
>> Remember that some tags can be self closing ( etc).

I'd rather not go down this route I think - because I feel it's too
error prone given the kind of crap one might expect as input (for instance)

>>
>> Could you use one of the XML extensions to build a DOM of the snippet?
>> I've
>> not used them much myself, but I'm guessing they could handle most of the
>> tag stripping and matching...

indeed I am leaning towards XML extension and/or Tidy with regard to finding
some kind of solution.

> 
> I'm sure Tidy could be employed to do this job. Grab your target length
> of text, backtrack until you find < or >. If it's a < then chop that bit
> off. Then give it to Tidy to fix the HTML. That should close off any
> open tags and give you a properly formed snippet.
> 
> Or you could implement the same functionality yourself quite easily, and
> it doesn't need to be well-formed HTML but you would need to check for
> tags that don't need closing (img, br, etc).

Stut, I going to go out on a limb and say 'bullshit' to those comments,
no personal offence meant (I mostly value your input *alot*, but I guess we
can't agree all the time):

1. simply backtracking to a '<' or '>' doesn't account for unescaped output
within the content pieces/parts of the html, e.g.:

look this here character '<' ammounts to invalid html

2. backtracking in the manner you describe does account for a large ammount of
hmtl at the beginning of the string - remember that the aim of the game is
to truncate the user visible content of the html string in question
(the comment below would be required to be part of the output - think html 
comment
spam, which is quite effective and some clients state as a requirement):

look at this

you say 'you could implement the same functionality yourself quite easily' - if
that was true then why does nobody have a readymade solution - it's not as if 
the
requirement is 'way out there' as far as web development goes. I don't think 
creating routines
for doing advanced manipulation of XML/HTML strings 'properly' is something 
very simple,
something that can be atested to by the relative complexity of libtidy and 
libxml2.

I not looking for a hack job here, I need something that can be relied on to 
output
html strings that will not break the validity (& layout) of a page regardless 
of the
quality of input.

the more I think about it the more I inclined to think that Tidy is about to 
become
a close friend. :-)

> 
> -Stut
> 

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



RE: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Edward Kay
> -Original Message-
> From: Tijnema [mailto:[EMAIL PROTECTED]
> Sent: 18 June 2007 14:25
> To: Colin Guthrie
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Edinburgh, Scotland: PHP Developer Position
>
>
> On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Don't want to spam the list, but figured after the London Salaries topic
> > recently, that I'd post this!
> >
> > We're needing a PHP/MySQL developer, preferably with experience of
> > general server admin too.
> >
> > The details can be found here if anyone is interested:
> >
> http://www.tribalogic.net/tribalogic/jobs/graduate-php-developer-n
eeded.html
>
> Col
>
>
> Well, I have a lot experience with PHP, HTML and MySQL. Also some
> experience with Unix system administration.  I'm 15 years old, so
> could I apply for the job? :)
>
> Tijnema

But the advert is for a GRADUATE developer ;) Whilst your messages to this
list show you know a lot about PHP, I doubt you've managed to fit a degree
in yet :)

Edward

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



[PHP] Re: Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Colin Guthrie
Tijnema wrote:
> Well, I have a lot experience with PHP, HTML and MySQL. Also some
> experience with Unix system administration.  I'm 15 years old, so
> could I apply for the job? :)

We can offer a competitive package that involves free milk and cookies,
a nap time in the afternoon and a note to get you out of gym class. :p

Unfortunately, we would be looking for someone who is a little older,
certainly they would need to be over 16 in order to be even *allowed* to
work! We are really looking for someone who has come through university,
but open to anyone who cares to contact us!

All that said, we may be hiring again in a years time so when you get to
16 drop us a line ;)

Col

PS free milk and cookies and an afternoon nap actually sounds quite good
now I come to think about it.. :p

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



Re: [PHP] generating an html intro text ...

2007-06-18 Thread Stut

Edward Kay wrote:



-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: 18 June 2007 13:18
To: tedd
Cc: [php] PHP General List
Subject: Re: [PHP] generating an html intro text ...


tedd wrote:

At 11:39 AM +0200 6/14/07, Jochem Maas wrote:

original string:


...

The problem as I see it is covering all the possibilities that may occur
even if the text is well formed. Like what if someone introduces a span
that sets a color for a paragraph, such as:

Dolore magna aliquam erat volutpat ut wisi enim
ad minim veniam quis nostrud. Consectetuer adipiscing elit sed diam
nonummy nibh euismod tincidunt ut laoreet exerci tation ullamcorper
suscipit lobortis! Decima eodem modo typi qui nunc nobis videntur
parum clari fiant sollemnes in.

And the  tag as well as the  tag is outside the 256 limit?

You would have to search out and pull in all closing tags.

So, I guess an algorithm could be:

roughly speaking yes this is what is would do, except:


First, grab 256 characters -- The string. If The string is shorter, then
quit.

the algo should only be counting 'content characters', i.e.
anything that is
html markup should not go towards the string length count,
additionally html entities
such as '&' should be considered as a single character.


Second, determine what tags are not closed.

Third, create closing tags and add them to the end of The string (in
proper order).

Fourth, then remove the same number of non-html characters from the end
of The string.

what the code should do (mmore or less) is quite clear - writing something
flexible & robust to actually do it (and do it fast) is quite
another matter.

I have been looking at Edward Vermillon's code but I suspect that
what he sent
me is not quite what I'm looking for for a number of reasons:

1. it deals primarily with custom bbcode like markup
2. I have a couple of doubts about the handling of html entities
3. performance

that said I still have to look at it in depth before making any real
conclusions as to it's viability (and or the possiblity to rework the
code to fit my needs).

I'm also looking at an alternative where by I go through the
string and truncate it at the character (or characters that
represent an html entity) that reresents the Nth 'content character'
and then feeding the truncated string to the Tidy extension and let it
figure out the html cleaning part ... does anyone have experience
using tidy
to clean (make valid) html snippets using Tidy, that they would
like to share?



A few thoughts I've had on this problem:

Assuming it is well formed HTML, you could use a stack. Parse the string
putting all opening tags on the stack and then removing them when the close
tag is found. This will leave you with all the un-closed tags and in the
correct order.

Remember that some tags can be self closing ( etc).

Could you use one of the XML extensions to build a DOM of the snippet? I've
not used them much myself, but I'm guessing they could handle most of the
tag stripping and matching...


I'm sure Tidy could be employed to do this job. Grab your target length 
of text, backtrack until you find < or >. If it's a < then chop that bit 
off. Then give it to Tidy to fix the HTML. That should close off any 
open tags and give you a properly formed snippet.


Or you could implement the same functionality yourself quite easily, and 
it doesn't need to be well-formed HTML but you would need to check for 
tags that don't need closing (img, br, etc).


-Stut

--
http://stut.net/

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



Re: [PHP] Edinburgh, Scotland: PHP Developer Position

2007-06-18 Thread Tijnema

On 6/18/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:

Hi,

Don't want to spam the list, but figured after the London Salaries topic
recently, that I'd post this!

We're needing a PHP/MySQL developer, preferably with experience of
general server admin too.

The details can be found here if anyone is interested:
http://www.tribalogic.net/tribalogic/jobs/graduate-php-developer-needed.html

Col



Well, I have a lot experience with PHP, HTML and MySQL. Also some
experience with Unix system administration.  I'm 15 years old, so
could I apply for the job? :)

Tijnema

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



RE: [PHP] generating an html intro text ...

2007-06-18 Thread Edward Kay


> -Original Message-
> From: Jochem Maas [mailto:[EMAIL PROTECTED]
> Sent: 18 June 2007 13:18
> To: tedd
> Cc: [php] PHP General List
> Subject: Re: [PHP] generating an html intro text ...
>
>
> tedd wrote:
> > At 11:39 AM +0200 6/14/07, Jochem Maas wrote:
> >> original string:
> >>
>
> ...
> >
> > The problem as I see it is covering all the possibilities that may occur
> > even if the text is well formed. Like what if someone introduces a span
> > that sets a color for a paragraph, such as:
> >
> > Dolore magna aliquam erat volutpat ut wisi enim
> > ad minim veniam quis nostrud. Consectetuer adipiscing elit sed diam
> > nonummy nibh euismod tincidunt ut laoreet exerci tation ullamcorper
> > suscipit lobortis! Decima eodem modo typi qui nunc nobis videntur
> > parum clari fiant sollemnes in.
> >
> > And the  tag as well as the  tag is outside the 256 limit?
> >
> > You would have to search out and pull in all closing tags.
> >
> > So, I guess an algorithm could be:
>
> roughly speaking yes this is what is would do, except:
>
> >
> > First, grab 256 characters -- The string. If The string is shorter, then
> > quit.
>
> the algo should only be counting 'content characters', i.e.
> anything that is
> html markup should not go towards the string length count,
> additionally html entities
> such as '&' should be considered as a single character.
>
> >
> > Second, determine what tags are not closed.
> >
> > Third, create closing tags and add them to the end of The string (in
> > proper order).
> >
> > Fourth, then remove the same number of non-html characters from the end
> > of The string.
>
> what the code should do (mmore or less) is quite clear - writing something
> flexible & robust to actually do it (and do it fast) is quite
> another matter.
>
> I have been looking at Edward Vermillon's code but I suspect that
> what he sent
> me is not quite what I'm looking for for a number of reasons:
>
> 1. it deals primarily with custom bbcode like markup
> 2. I have a couple of doubts about the handling of html entities
> 3. performance
>
> that said I still have to look at it in depth before making any real
> conclusions as to it's viability (and or the possiblity to rework the
> code to fit my needs).
>
> I'm also looking at an alternative where by I go through the
> string and truncate it at the character (or characters that
> represent an html entity) that reresents the Nth 'content character'
> and then feeding the truncated string to the Tidy extension and let it
> figure out the html cleaning part ... does anyone have experience
> using tidy
> to clean (make valid) html snippets using Tidy, that they would
> like to share?
>

A few thoughts I've had on this problem:

Assuming it is well formed HTML, you could use a stack. Parse the string
putting all opening tags on the stack and then removing them when the close
tag is found. This will leave you with all the un-closed tags and in the
correct order.

Remember that some tags can be self closing ( etc).

Could you use one of the XML extensions to build a DOM of the snippet? I've
not used them much myself, but I'm guessing they could handle most of the
tag stripping and matching...

HTH,
Edward

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



[PHP] Re: Controlling project version

2007-06-18 Thread Colin Guthrie
Jochem Maas wrote:
> Colin Guthrie wrote:
>> One other good thing about Subversion is the flexibility of it's hooks.
>> You can setup scripts to automatically deploy your changes to a live
>> environment. It's ace!
> 
> 2 points I'd like to make:
> 
> 1. I'd be very wary of using an auto deployment script that is triggered
> upon check in unless the deployment was only to test system. I think that
> deployment to a production env should have at least one step that requires
> human intervention - at the very least you have someone to blame if the shit 
> hits
> the fan.**

Yeah I should have put a few caveats in there really, seeing as I don't
actually do this myself! For what it's worth if I really were to
implement this it would only be for a branch where only certain
developers have access to. The trunk would be for active dev, it could
then be frozen and tested, then merged to the deployment branch!

> 2. CVS has wrapper/hook scripts that can also do tasks like this - although I
> gather that SVN's implementation is friendly & more manageable.

Yeah, I certainly like it better. I've not looked at CVS hooks for years
but I'm sure I remember the SVN ones being more flexible...

> ** 'shit hits the fan' reminds me of something I saw in a LIDL supermarket -
> they had a ripoff version of 'PomBaer' crisps (potato chips) which was called
> 'Bears Hit' ... I kid you not! now you too can say with confidence, 'I feel
> like eating some bear shit' :->

I don't think I could ever say that with confidence!

Col

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



Re: [PHP] Session persistent objects

2007-06-18 Thread Stut

Please include the list when replying.

Markus Feier wrote:

I thought I read somewhere, there could be a problem storing objects in
sessions.

Do you mean
$_SESSION['objectid']=new classx...


I do indeed mean that. There are a few things you need to be aware of...

* When you call session_start() you must already have included the 
necessary that defines the classes that might have instances in the 
session, or have an __autoload function that can load them on demand.


* As always you cannot store resources in the session. To get around 
this for objects, implement __sleep and __wake methods to dispose of and 
recreate the resources. Check the manual for full details.


-Stut

--
http://stut.net/

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



Re: [PHP] Re: Controlling project version

2007-06-18 Thread Shafiq Rehman

Hello,

I use CVS in office and home

--
Shafiq Rehman (ZCE)
http://www.phpgurru.com | http://shafiq.pk
Cell: +92 300 423 9385


On 6/18/07, Jochem Maas <[EMAIL PROTECTED]> wrote:


Colin Guthrie wrote:
> Stut wrote:
>>> I don't like the branching in subversion, it's a lot easier to work
with
>>> in CVS.

...

>
> One other good thing about Subversion is the flexibility of it's hooks.
> You can setup scripts to automatically deploy your changes to a live
> environment. It's ace!

2 points I'd like to make:

1. I'd be very wary of using an auto deployment script that is triggered
upon check in unless the deployment was only to test system. I think that
deployment to a production env should have at least one step that requires
human intervention - at the very least you have someone to blame if the
shit hits
the fan.**

2. CVS has wrapper/hook scripts that can also do tasks like this -
although I
gather that SVN's implementation is friendly & more manageable.

>
> If you are using an interal Wiki, Ticket system I can thoroughly
> recommend Trac for this. It has excellent integration with Subversion.
>
> Hope that helps.
>

** 'shit hits the fan' reminds me of something I saw in a LIDL supermarket
-
they had a ripoff version of 'PomBaer' crisps (potato chips) which was
called
'Bears Hit' ... I kid you not! now you too can say with confidence, 'I
feel
like eating some bear shit' :->

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




Re: [PHP] Re: Controlling project version

2007-06-18 Thread Jochem Maas
Colin Guthrie wrote:
> Stut wrote:
>>> I don't like the branching in subversion, it's a lot easier to work with
>>> in CVS.

...

> 
> One other good thing about Subversion is the flexibility of it's hooks.
> You can setup scripts to automatically deploy your changes to a live
> environment. It's ace!

2 points I'd like to make:

1. I'd be very wary of using an auto deployment script that is triggered
upon check in unless the deployment was only to test system. I think that
deployment to a production env should have at least one step that requires
human intervention - at the very least you have someone to blame if the shit 
hits
the fan.**

2. CVS has wrapper/hook scripts that can also do tasks like this - although I
gather that SVN's implementation is friendly & more manageable.

> 
> If you are using an interal Wiki, Ticket system I can thoroughly
> recommend Trac for this. It has excellent integration with Subversion.
> 
> Hope that helps.
> 

** 'shit hits the fan' reminds me of something I saw in a LIDL supermarket -
they had a ripoff version of 'PomBaer' crisps (potato chips) which was called
'Bears Hit' ... I kid you not! now you too can say with confidence, 'I feel
like eating some bear shit' :->

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



Re: [PHP] Session persistent objects

2007-06-18 Thread Stut

Markus Feier wrote:

In a browser-application, whenever receiving a GET, php will have to
create all involves objects.

I wonder, if there is a way to keep php objects, including all actual
propertys,  during a whole session


Yeah, erm, store the in the session.

Too obvious?

-Stut

--
http://stut.net/

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



  1   2   >