php-general Digest 22 Dec 2005 08:32:56 -0000 Issue 3864
Topics (messages 227777 through 227791):
Re: HTML rendering extension?
227777 by: Richard Lynch
227785 by: M
227787 by: Marcus Bointon
227789 by: Marcus Bointon
unlink, symlink and caching
227778 by: jgmtfia Mr
227780 by: Curt Zirzow
227783 by: jgmtfia Mr
sorting dates with php
227779 by: Ross
227781 by: Jim Moseby
227782 by: André Medeiros
227786 by: Chris Lott
GD/Freetype text problems with bold or size < 8
227784 by: Jason Young
Re: Help Desk software
227788 by: Tim Boring
Connection: close Always?
227790 by: Michael B Allen
Re: Filtering URLs problem..
227791 by: Jochem Maas
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Wed, December 21, 2005 12:13 pm, Marcus Bointon wrote:
> Has anyone seen such a thing? I'm looking to be able to generate web
> page previews dynamically and automatically, so I need to render the
> page on the server. The most efficient way would be if there was a
> PHP HTML rendering extension - gecko or KHTML perhaps. HTML2PDF
> doesn't go nearly far enough. Alternatively something like a CLI
> option to firefox to run without X (i.e. no visible windows) and
> output to a file instead of a display device. The options here don't
> indicate that it can do that:
I've been told that there is a "webthumb" command line tool to do just
what you ask as a JPEG.
At least I *think* it was called "webthumb"...
Maybe from the GD folks???
It's out there somewhere, and I was going to look into it, but...
You'd feed it a URL and it gives you an image. You need X installed,
so it can run X in the background and render it.
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
Marcus Bointon wrote:
Has anyone seen such a thing? I'm looking to be able to generate web
page previews dynamically and automatically, so I need to render the
page on the server. The most efficient way would be if there was a PHP
HTML rendering extension - gecko or KHTML perhaps. HTML2PDF doesn't go
nearly far enough. Alternatively something like a CLI option to firefox
to run without X (i.e. no visible windows) and output to a file instead
of a display device. The options here don't indicate that it can do that:
http://kb.mozillazine.org/Command_line_arguments
Any other ideas?
Marcus
http://marginalhacks.com/Hacks/html2jpg/
--- End Message ---
--- Begin Message ---
On 21 Dec 2005, at 21:18, M wrote:
http://marginalhacks.com/Hacks/html2jpg/
That's the kind of marginal hack I was hoping to avoid ;^) However,
it did lead me to http://khtml2png.sourceforge.net/ which seems far
more like it. Now I just have to persuade it to compile.
Thanks.
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk
--- End Message ---
--- Begin Message ---
On 21 Dec 2005, at 18:17, Richard Lynch wrote:
At least I *think* it was called "webthumb"...
Maybe from the GD folks???
It's out there somewhere, and I was going to look into it, but...
You'd feed it a URL and it gives you an image. You need X installed,
so it can run X in the background and render it.
It is indeed called webthumb: http://www.boutell.com/webthumb/
After installing firefox on my server, tweaking webthumb to use
firefox instead of Mozilla, a bit of messing with xauth settings, and
I've got it working! It seems like a more polished alternative to
html2jpg. It uses Xvfb for a local display so you don't need a real
one, and it doesn't interfere with remote X sessions, though firefox
complains if you try to run it on both X displays at once. Now I just
need to go find a borderless chrome package for ff...
khtml2jpg is definitely a more advanced solution as it contains its
own browser and is thus not limited by screen size - you could grab a
page 10,000 pixels tall if you wanted to - and it can monitor browser
state e.g. so it can know when all images are loaded instead of just
waiting for a bit. Flipside - it's not working for me...
Thanks very much for the tip, very glad to have finally found a
solution.
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk
--- End Message ---
--- Begin Message ---
I have a directory with the files:
/config/A
/config/B
and
/config/C is a symlink to /config/A.
Via php I unlink /config/C:
$FILE = '/config/C';
while(file_exists($FILE)){
unlink($FILE);
clearstatcache();
}
When run, the first time through the loop $FILE is removed from disk
as it should.
The loop then continues forever with file_exists() returning true, but
unlink() returns false with the error message "Warning:
unlink(/config1/C) [function.unlink]: No such file or directory in
/www/script.php on line 10"
If I do this:
$FILE = '/config/C';
unlink($FILE);
cleanstatcache();
symlink('/config/B', '/config/C');
I get the error message:
Warning: symlink() [function.symlink]: File exists in /www/script.php
on line 11
However the link had been deleted.
The symlink /config/C is read via file_get_contents() before the
unlink and relink is performed.
I have also done the following:
$FILE = '/config/C';
unlink($FILE);
`ln -s /config/B /config/C`
Which works as expected, the old link is replaced with the new link,
however any attempt to open and read from the new link returns the
contents of the old file.
How would I be able to get the expected behavior from PHP. I expect
that the problem has something to do with the symlinks being used.
Any assistance is appreciated.
PHP Version: 5.1.0
Server API: Apache 2.0 Handler
PHP API: 20041225
PHP Extension: 20050922
Zend Extension: 220051025
Apache Version: Apache/2.0.52 (Unix) PHP/5.1.0
Apache API Version: 20020903
--- End Message ---
--- Begin Message ---
On Wed, Dec 21, 2005 at 11:27:23AM -0700, jgmtfia Mr wrote:
> I have a directory with the files:
> /config/A
> /config/B
> and
> /config/C is a symlink to /config/A.
>
> Via php I unlink /config/C:
>
> $FILE = '/config/C';
> while(file_exists($FILE)){
> unlink($FILE);
> clearstatcache();
> }
>
> When run, the first time through the loop $FILE is removed from disk
> as it should.
>
> The loop then continues forever with file_exists() returning true, but
> unlink() returns false with the error message "Warning:
> unlink(/config1/C) [function.unlink]: No such file or directory in
> /www/script.php on line 10"
This might be an issue with the OS or Filessystem. The code
works just fine for me, i dont even need the clearstatcache().
Curt.
--
cat .signature: No such file or directory
--- End Message ---
--- Begin Message ---
> > The loop then continues forever with file_exists() returning true, but
> > unlink() returns false with the error message "Warning:
> > unlink(/config1/C) [function.unlink]: No such file or directory in
> > /www/script.php on line 10"
>
> This might be an issue with the OS or Filessystem. The code
> works just fine for me, i dont even need the clearstatcache().
Thank you for checking on this.
I am using debain stable with a 2.6.14.3 kernel. The filesystem in
question is ext2 on a 48 MB ramdisk.
I also did the following on another machine using ext2 on a harddisk
with command line php.
<?php
/*
-rw-r--r-- 1 user user 0 Dec 21 12:41 A
-rw-r--r-- 1 user user 0 Dec 21 12:41 B
lrwxr-xr-x 1 user user 1 Dec 21 12:43 C -> A
-rw-r--r-- 1 user user 91 Dec 21 12:41 test.php
*/
$FILE = 'C';
while(file_exists($FILE)){
echo "$FILE exists\n";
echo `ls -l C`;
if(!unlink($FILE)){
echo "Unable to delete $FILE\n";
echo `ls -l C`;
}else{
echo "Deleted $FILE\n";
}
echo "====\n";
}
/*
Output:
>php5 ./test.php
C exists
lrwxr-xr-x 1 user user 1 Dec 21 12:59 C -> A
Deleted C
====
C exists
ls: C: No such file or directory
Warning: unlink(C): No such file or directory in
/home/user/x/test.php on line 14
Unable to delete C
ls: C: No such file or directory
====
C exists
ls: C: No such file or directory
Warning: unlink(C): No such file or directory in
/home/user/x/test.php on line 14
Unable to delete C
ls: C: No such file or directory
====
*/
?>
This shows that apache is not responsible for the problem.
Note also that if I delete A and C within the loop the code works as
expected and the loop only executes once. So file_exists() is seeing
"A" when I tell it to delete "C" and unlink is seeing "C" as it
should.
Any ideas where to start to look for the cause of the problem?
--- End Message ---
--- Begin Message ---
Hi,
Have a load of dates in the format DD/MM/YY. Thet are stored as a VARCHAR on
a mysql DB.
I need a way to sort them into order(most recent first)
Using the QUERY $query = "SELECT doc_date FROM papers ORDER BY doc_date
DESC";
this just arranges them by day. e.g
30/12/2005
30/11/2005
22/12/2005
19/12/2005
17/12/2005
12/12/2005
10/12/2005
06/12/2007
06/09/2002
05/12/2005
05/09/2005
Now I have tried to use strtotime() but I find this needs a timezone (GMT)
to work and I don't know if the server supports it. Also I find strototime()
and mktime() very confusing and a things go wrong of you work in GMT because
we also have Brittish Summer Time where the clocks get put back/forward at
certain time of the year.
Is there a simple function like sort() that could do it??
R.
--- End Message ---
--- Begin Message ---
> Have a load of dates in the format DD/MM/YY. Thet are stored
> as a VARCHAR on
> a mysql DB.
>
> I need a way to sort them into order(most recent first)
>
>
> Using the QUERY $query = "SELECT doc_date FROM papers ORDER
> BY doc_date
> DESC";
>
> this just arranges them by day. e.g
>
>
> 30/12/2005
> 30/11/2005
> 22/12/2005
> 19/12/2005
> 17/12/2005
> 12/12/2005
> 10/12/2005
> 06/12/2007
> 06/09/2002
> 05/12/2005
> 05/09/2005
>
>
>
> Now I have tried to use strtotime() but I find this needs a
> timezone (GMT)
> to work and I don't know if the server supports it. Also I
> find strototime()
> and mktime() very confusing and a things go wrong of you work
> in GMT because
> we also have Brittish Summer Time where the clocks get put
> back/forward at
> certain time of the year.
>
> Is there a simple function like sort() that could do it??
>
Hi!
Its a real shame your dates aren't stored in a DATE type field instead of
VARCHAR, because you can just sort them in your query with "order by DATE".
If its possible, you would really benefit by converting them and storing
them in the proper DATE type field.
That being said, I suppose you could "explode()" them into an array then
figure out how to sort them from there.
JM
--- End Message ---
--- Begin Message ---
You COULD sort them if the date was stored backwards, ie. Year/Month/Day
On 12/21/05, Jim Moseby <[EMAIL PROTECTED]> wrote:
> > Have a load of dates in the format DD/MM/YY. Thet are stored
> > as a VARCHAR on
> > a mysql DB.
> >
> > I need a way to sort them into order(most recent first)
> >
> >
> > Using the QUERY $query = "SELECT doc_date FROM papers ORDER
> > BY doc_date
> > DESC";
> >
> > this just arranges them by day. e.g
> >
> >
> > 30/12/2005
> > 30/11/2005
> > 22/12/2005
> > 19/12/2005
> > 17/12/2005
> > 12/12/2005
> > 10/12/2005
> > 06/12/2007
> > 06/09/2002
> > 05/12/2005
> > 05/09/2005
> >
> >
> >
> > Now I have tried to use strtotime() but I find this needs a
> > timezone (GMT)
> > to work and I don't know if the server supports it. Also I
> > find strototime()
> > and mktime() very confusing and a things go wrong of you work
> > in GMT because
> > we also have Brittish Summer Time where the clocks get put
> > back/forward at
> > certain time of the year.
> >
> > Is there a simple function like sort() that could do it??
> >
>
> Hi!
>
> Its a real shame your dates aren't stored in a DATE type field instead of
> VARCHAR, because you can just sort them in your query with "order by DATE".
> If its possible, you would really benefit by converting them and storing
> them in the proper DATE type field.
>
> That being said, I suppose you could "explode()" them into an array then
> figure out how to sort them from there.
>
> JM
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On 12/21/05, Ross <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Have a load of dates in the format DD/MM/YY. Thet are stored as a VARCHAR on
> a mysql DB.
Couldn't you use cast() to cast the values first? Something like (untested):
SELECT CAST(doc_date AS DATE) FROM papers ORDER BY doc_date DESC
c
--- End Message ---
--- Begin Message ---
Currently, I'm running PHP 5.0.4 (only because it's the only one I can
get to work on my FC4 x64 install!), but for some reason, using pixel
sizes under 8, or using bold fonts, makes the text look horrible.
My old host (1&1 in case anyone else has them..) had this working well,
but I have no idea what their settings were.
I've heard that editing the gd.h file to change the resolution from 96
to 72 helps, but I'm assuming I'd have to recompile something for that
to take effect, and I can't find a PHP-GD Source RPM for my arch.
What must I do to get everything smooth again?
Fedora Core 4, x64
PHP 5.0.4
PHP-GD module (separate RPM install)
Freetype 2.1
gd-2.0.33
Thank you.
--- End Message ---
--- Begin Message ---
On Wed, 2005-12-21 at 09:17 -0800, Daniel Lahey wrote:
> I found one set of links that might prove helpful: http://
> www.helpdesk.com/software-helpdesk.htm A lot of the software doubles
> as asset management software or comes bundled with such a module.
> There are a yitload of links on that page. I'm only on the Bs. Good
> luck.
We use EnterTrack (http://www.entertrack.org) in my company. We've been
using it for about 2 years and are pretty happy with it. I've also done
some customization to our EnterTrack installation in order to integrate
it with our company intranet. It's focus is on tracking/archiving
issues, so it doesn't have any functionality for asset management. But
it does have a pretty flexible group/permissions system that allows you
to set up multiple groups and provides various levels of access to
users.
At one time, I evaluated phpMyInventory for asset management. There is
the free version (http://phpmyinventory.sourceforge.net/index.php) and
there is also a commercial version. We ended up going with Network
Inventory Analyzer from Alloy
(http://www.alloy-software.com/nin/pro.html). It's a commercial
package, but it was inexpensive (~$1000 for 150 nodes) and met our
needs.
Hope that helps!
Tim
--- End Message ---
--- Begin Message ---
Why does PHP always close the connection with Connection: close? I'm
using PHP 4.3.11 w/ Firefox 1.0.4. Requests are HTTP/1.1 and Connection:
keep-alive is requested.
Mike
--- End Message ---
--- Begin Message ---
Anders Norrbring wrote:
I'm writing a filter/parsing function for texts entered by users, and
I've run into a problem...
What I'm trying to do is to parse URLs of different sorts, ftp, http,
mms, irc etc and format them as links, that part was real easy..
The hard part is when a user has already entered a complete link..
In short:
http://www.server.tld/page.html
should be converted to:
<a
href='http://www.server.tld/page.html'>http://www.server.tld/page.html</a>
That part works fine, but if the user enters:
<a href='http://www.server.tld/page.html'>click here</a>
it all becomes a mess... Can somebody please make a suggestion on this?
regular expressions - in particular a 'negative look behind' assertion.
here is a page that [trys to] explain it:
http://www.mircscripts.org/showdoc.php?type=tutorial&id=2409
google given loads of hits for 'negative look behind', hopefully you
get somewhere - me I have too little time to right now to go into
examples. good luck
--- End Message ---