circle.ch weblog by Urs Gehrig

 Search
A weblog about libre software, law, technology, politics and the like.
2010-03-11T20:02:10
Academic, Apache, Apple, Art, Best Of, Biotech, Civil Society, Content Management, Cooking, Copyright, Creative Commons, Crosspost, Culture, Database, Deutsch, DRM, Economy, Education, Event, Gadget, General, Geodata, Government, Health, Howto, Humor, Innovation, Intellectual Property, Java, Language, LaTeX, Law, Linux, Media, Moblog, Mozilla, Music, Office, Open Content, Open Source, P2P, PHP, Podcast, Politics, Privacy, Projects, Random Thought, Rant, Science, Search, Social Network, Software, Sport, Talks, Technology, Technology Transfer, Travelling, Weblog, Wiki, Wireless and Mobile, XML

01. June 2007

Liip is hiring - again, again, more and more
@ 14:55:21

Watch out Liip AG on www.liip.ch - they are hiring Flash/Java Multimedia Developers, JavaScript Developers, PHP/XSLT Web Developers and offer Interns in Web Development and Publishing [1]. They are going to become real big. And they have really interesting projects.

As a small sidenote - if you get hired by Liip, just mention to them to send that iPod to Basel ;)

[1] http://blog.liip.ch/archive/2007/05/23/liip-is-hiring-yet-again.html

Comments (0) Permalink del.icio.us

02. March 2007

adfinis is hiring
@ 21:37:33

adfinis GmbH in Bern is looking for a web developer
Zur Unterstützung unseres jungen Teams bei Neuprojekten und Wartung/Erweiterung von bestehenden Lösungen suchen wir per sofort eine/n PHP Entwickler/in mit Pensum nach Vereinbarung, ca. 80-100%.
More details can be found on their blog [1].

[1] http://www.adfinis.com/node/177

Comments (0) Permalink del.icio.us

12. July 2006

zlyfe - Blogs, Bilder, Community et.al.
@ 13:46:33

Der Slogan tönt so:
zlyfe is the place where you can tell others about the most memorable, astonishing, or funniest moments in your life.
Grundsätzlich kann man das und vieles mehr auch auf anderen Plattformen. zlyfe [1] pflegt aber einen besonderen Bezug zur Schweiz - sprich - die Technologie kommt aus Bern [2].

[1] http://www.zlyfe.net
[2] http://www.adfinis.com/node/176

Comments (0) Permalink del.icio.us

01. September 2005

Open Office Dokument des Hanbuchs zu PHP und MySQL
@ 21:08:31

Zu meiner letztlich publizierten PDF Version meines Einführungsscripts zu PHP und MySQL [1] aus dem Jahr 2003 ist nun auch das Open Office Dokument hinzugekommen und steht zum Download bereit. Allfällige Rückmeldungen oder Ergänzungen nehme ich gerne entgegen. Korrekturen etc. können aber auch direkt im Wiki eingetragen werden.

[1] http://circle.ch/wiki/?page=HandbuchPHP

Comments (0) Permalink del.icio.us

30. August 2005

Freetag - a tagging and folksonomy system
@ 23:08:58

Or more detailed:
Freetag [1] is a module that implements a simple, fairly robust beginning of a tagging and folksonomy system. It works with PHP4 and MySQL 3.23 so far, and i imagine that if it gets popular, it should be easy to port to additional databases and/or languages.
Maybe a way to build up its own tagging repository. Acutally I haven't tried, but according to the docs it is promising. As to feed the database, one could use his own tags or category names first.

There are probably at least two ways to tag a blog post. Either tags selected by hand at the time of writing or as a self-tagging system (algorithm), that takes e.g. the content of a blog post, analyzes it and applys the tags to the post.

Some more thoughts on tagging and retagging at overstated.net [2].

[1] http://getluky.net/freetag/
[2] http://overstated.net/04/10/09-migrating-to-delicious

Comments (0) Permalink del.icio.us

29. August 2005

Get Tags with Yahoo! Term Extraction
@ 21:54:35

This is a start:
The Term Extraction service provides a list of significant words or phrases extracted from a larger content.
It can be implemented by making use of the Yahoo! API [1]. One might then need to sort out the result set a bit and use them as "tags". Since this blog has no cache and the API only lets me have a limited number [2] of requests a day, I will not dive into it yet ;) For those using PHP, there is a so called yahoolib availabe.

[1] http://developer.yahoo.net/search/content/V1/termExtraction.html
[2] http://developer.yahoo.net/search/rate.html
[3] http://sourceforge.net/projects/yahoolib

Comments (0) Permalink del.icio.us

28. August 2005

Related posts on b2/cafelog
@ 23:46:54

To get the related posts, there was only to apply the FULLTEXT feature to the the b2posts table.
ALTER TABLE b2posts ADD FULLTEXT post_related ( post_title, post_content )
A typical SQL query looks like:
SELECT ID, post_title, post_content,
MATCH ( post_title, post_content )
AGAINST ( 'make zip files' ) AS score
FROM b2posts
WHERE MATCH ( post_title, post_content )
AGAINST ( 'make zip files') AND ( ID != '910' )
ORDER BY score DESC
LIMIT 5
The you only need to handle the results and format it with a little bit of HTML. Thats it.

Comments (0) Permalink del.icio.us

An unexpected T_PAAMAYIM_NEKUDOTAYIM
@ 22:58:57

It is said, that this PHP parse error is pointing out, that there is a problem with two colons [1]. Further it is said, that this is Hebrew. Programming can make fun.

[1] http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php

QR Code for your mobile phone.
Comments (0) Permalink del.icio.us

TagCloud to analyze my blog
@ 18:21:50

TagCloud (beta) is an automated Folksonomy tool. It analyzes RSS feeds and comes up with a cloud of related items [1]. Even though items like "http" and "htm" do not make that much sense, it might e.g. help giving an idea on what topics certain blog is talking about.

I guess either with MySQL FULLTEXT search [2] or Bayesian classification [3] one could handle out something similar on his own blog.

[1] http://www.tagcloud.com/User/index.php?TC_Cloud_ID=5920
[2] http://dev.mysql.com/doc/mysql/en/fulltext-search.html
[3] http://www.xhtml.net/php/PHPNaiveBayesianFilter

Comments (2) Permalink del.icio.us

03. August 2005

PHP Developers for blog.ch
@ 10:55:09

blog.ch is seeking PHP developers to turn the projectlist into reality [1]. Matthias has some good ideas and is eager to fulfil them.

[1] http://blog.ch/blog/?p=148

Comments (0) Permalink del.icio.us

18. July 2005

Einführung in PHP
@ 23:44:42

Im Jahr 2003 verfasste ich für Unterrichtszwecke eine Einführung in PHP. Das Dokument steht nun unter HandbuchPHP zum Download zur Verfügung [1]. Nebst PHP wird auch MySQL und Apache HTTPD, mehrheitlich für Windows, thematisiert. Das Dokument ist unter einer Creative Commons Lizenz lizenziert. Anregungen, Änderungen und Aktualisierungen sind natürlich willkommen.

[1] http://www.circle.ch/wiki/HandbuchPHP

QR Code for your mobile phone.
Comments (1) Permalink del.icio.us

08. June 2005

Not 1, 2, 3, 4, 5, 6, 7, 8, 9 but 10 years of PHP
@ 21:52:46

[via chregu, 1] Just to have it said. It is said that PHP exists for 10 years today [2].

[1] http://blog.bitflux.ch/archive/2005/06/07/a-decade-of-php.html
[2] http://groups.google.ch/groups?selm=3r7pgp%24aa1%40ionews.io.org

Comments (0) Permalink del.icio.us

05. April 2005

Access to Desktop Search results
@ 22:16:07

Today I run across DNKA [1]:
DNKA is a search tool for remote computers. It acts as a web server by interacting as a layer between Google Desktop Search (GDS) and the user. It allows other users to search, view and download your files, emails, chats and web history.
Basically it is wonderful; you get a full search access to the indexed content of a remote computer. IMHO this application should be filed under "As long as You know what You are doing.". I tried it out in an intranet and got full access to the root drive C:\.

Then later on I found Baagle [2]. The principle is similar to the above but the tools are different. Baagle is a set of Perl scripts wrapped around the search engine Swish-e. Baagle provides a standalone webserver and an indexer. But compared to GDS it is up to you to configure and restrict the indexing to the data directories of your desire.

If you like to figure out a similar solution with PHP have a look at the earlier mentioned nanoweb or nanoserv webserver built with PHP [3] and a Swish-e wrapper written in PHP [4]. Once decided to go for Swish-e (on Windows) you need a couple of tools to handle various file mime types, among others pdftotext, ps2ascii, antiword and one that I found today to convert Excel files to text, called xlhtml. Just search.ch for them ;)

Well, now the only thing I could not find is a few lines of code to get a configurable search field to be integrated in the Windows task bar as we know it from GDS. Anyone up with a solution?

[1] http://dnka.com
[2] http://floatingsheep.com/baagle.html
[3] http://nanoweb.si.kz
[4] http://www.neokraft.net/articles/swish-e/

Comments (0) Permalink del.icio.us

23. March 2005

Multiuser Worpress evolved
@ 16:05:11

As talked about multiuser-Wordpress earlier, I was wondering what is going on with it. So here is a refresh pointing to some sites of interest:

- http://blogs.linux.ie/xeer/2005/03/15/wpmu-snapshot-2/
- http://blogs.linux.ie/download/wpmu/ChangeLog-wpmu.txt
- http://www.proyectoisla.com/planetawp/?cat=10
- http://incsub.org/blog/?p=266

Most coding seems to be done by donncha.

Comments (0) Permalink del.icio.us

15. March 2005

Maguma Open Studio
@ 22:12:13

Stumbled over that piece of information today:
A PHP IDE that includes features for class browsing, ftp support, snippets, debugging and project management. The Open Source version of Maguma Studio.
[1] http://sourceforge.net/projects/openstudio/

Comments (0) Permalink del.icio.us

10. February 2005

Bug #2415 - No UTF-8 decoding of header
@ 21:48:19

Bug #2415 "No UTF-8 decoding of header" [1] which I reported quite some time ago got reedited today. The problem is described even more complex. But jazfresh proposes some additional fixes.

[1] http://pear.php.net/bugs/bug.php?id=2415

Comments (0) Permalink del.icio.us

27. January 2005

ffmpeg - The upcoming tool for video conversion
@ 11:16:19

ffmpeg [1] is the tool I have used locally for some time now [1]. It allows conversions of various video formats and video to image conversions. Over the last few months I started a collection of links to some helpful articles and discussions [2]. Recently, there has been started the development of a PHP extension [3]. I could imagine, that ffmpeg would be quite an interesting PHP5 standard extension ;) I haven't checked the license for compatibility though.

Grabbing a frame out of a video is as simple as follows. It took me quite some time to figure out the appropriate options, since the web and the documentation did not yet satisfy my needs:
$ ffmpeg -i test.3gp -f singlejpeg -img jpeg -y test.jpg
Input #0, mov, from 'test.3gp':
Duration: 00:00:04.8, bitrate: 80 kb/s
Stream #0.0: Video: h263, 128x96, 10.00 fps
Stream #0.1: Audio: 0x726d6173, 8000 Hz, mono
Output #0, singlejpeg, to 'test.jpg':
Stream #0.0: Video: mjpeg, 128x96, 10.00 fps, q=2-31, 200 kb/s
Stream mapping:
Stream #0.0 -> #0.0
frame= 48 q=4.0 size= 117kB time=4.8 bitrate= 200.0kbits/s
I am sure this will boost video blogging enormously [4]. I first was heading for mplayer, but mplayer is IMHO kind of related to X and we do not really want X to be installed on a production server, do we?

Finally, I would like to talk about animated GIF files and provide an example. As with a combination of Imagemagick and ffmpeg, it is a matter of two command lines evtl. one (I am not a pipe specialist ;). As shown below, ffmpeg generates a set of 10 images and Imagemagick converts them to an animated GIF:
$ ffmpeg -i test.3gp -f image -img gif -t 1.0 test%03d.gif
Input #0, mov, from 'test.3gp':
Duration: 00:00:04.8, bitrate: 80 kb/s
Stream #0.0: Video: h263, 128x96, 10.00 fps
Stream #0.1: Audio: 0x726d6173, 8000 Hz, mono
Output #0, image, to 'test%03d.gif':
Stream #0.0: Video: rawvideo, pal8, 128x96, 10.00 fps, q=2-31, 200 kb/s
Stream mapping:
Stream #0.0 -> #0.0
frame= 10 q=0.0 size= 0kB time=1.0 bitrate= 0.0kbits/s

$ convert -delay 20 -loop 0 test*.gif animated.gif
Feeback always welcome ;)

[1] http://ffmpeg.sourceforge.net
[2] http://www.circle.ch/wiki/MpegToJpeg
[3] http://ffmpeg-php.sourceforge.net
[4] http://www.circle.ch/wiki/3gpVideo

Comments (6) Permalink del.icio.us

24. January 2005

s9y podcast plugin by Hannes
@ 11:09:31

Hannes [1] hacked a PodCasting plugin for s9y and has it up and running on his test blog [2]. There are on the other hand some good arguments, why PodCasting is not always cool [3].

[1] http://hannes.kaywa.com
[2] http://s9y.lebureau.mediagonal.ch/archives/200501.html
[3] http://blog.koehntopp.de/archives/649-Warum-podcasting-nervt.html

Comments (0) Permalink del.icio.us

30. December 2004

JPEG image problem with PHP GD
@ 23:15:04

I wrote a PHP script based on imagecopyresampled() to resize images coming from mobile phones. Some phone models seem to produce corrupt JPEG files. As on calling imagecreatefromjpeg() a message gets produced looking like: "Corrupt JPEG data: 164 extraneous bytes before marker 0xd9".

Imagemagick handles such problems in some - to me unknown - way and resizes the image properly, regardless of the problem pointed out. But there is currently only GD available and with that few lines of code I get a black resized thumbnail.

The message pointed out above gets printed out when calling imagecreatefromjpeg(). A random thought was to rewrite a function from scratch in PHP that creates a valid image resource [1] in spite of the corrupt JPEG format. But as we have 23p.m. now, I am just too tired now ;) So I am stuck. A corrupt image can be found here [2].

[1] http://lxr.php.net/source/php-src/ext/gd/libgd/gd_jpeg.c#238
[2] http://circle.ch/blog/media/bild015.jpg

Update: Problem-walk-around, as I got imagemagick support on the server ;)

Comments (2) Permalink del.icio.us

14. December 2004

PECL Bit Torrent
@ 09:42:14

Just came along http://pecl.php.net/File_Bittorrent ;)

Comments (0) Permalink del.icio.us

03. December 2004

Standalone PHP script viewer for Win32
@ 09:51:13

Daaron Dwyer writes:
You blogged about my ScriptViewer (PHP without a dedicated web server) app many many moons ago, and I have updated it recently.
Oh, I am a "moons away" blogger. So here we go [1].

[1] http://www.angorasoftware.com/scriptviewer.html

Comments (0) Permalink del.icio.us

25. November 2004

Atom enabled Weblog in PHP
@ 18:05:31

Yoan Blanc has worked out a fully functional Atom based weblog tool [1].
This project is a school essay about dealing with atom format, HTTP request and XSL transformation.
The code is available under the GPL license. Let's hope this will ignite some further implementations.

Yoan also has a short presentation available [2].

[1] http://atom.dosimple.ch
[2] http://atom.dosimple.ch/docs/pres/

Comments (0) Permalink del.icio.us

18. November 2004

Gmail photo album
@ 15:21:14

Yet another gmail [1] application, which is called goollery:
Goollery is a GMail based photo gallery. You can upload pictures from a website. The pictures will automatically be stored in your gmail accout.
Via David Duret [2]

[1] http://www.wirzm.ch/goollery/about/about.php
[2] http://pilgrim.maleo.net/archives/2004/11/18/gmail-antispam-en-ligne/

Comments (0) Permalink del.icio.us

07. November 2004

PHP5 on OSX
@ 21:46:29

Marc [1] is doing a great job to get PHP5 as easy as possible on OSX.

[1] http://www.entropy.ch/home/000012.html

Comments (0) Permalink del.icio.us

05. November 2004

Bitflux is hiring
@ 10:09:49

chregu [1] of Bitflux GmbH is looking for a developer with strong skills in XSLT and PHP. Bitflux has strong competences in realizing custom client projects while mostly using their own Bitflux CMS (BxCMS). An other interesting product is their Bitflux Editor, a Wysiwyg XML Editor. Most if not all of their tools are Open Source.

[1] http://blog.bitflux.ch/archive/work-at-bitflux.html

Comments (0) Permalink del.icio.us

20. October 2004

Cropping, rotating and resizing images in Wordpress
@ 12:42:41

Some month ago I implemented a PHP script [1] to handle images that I integrated into the "Manage" respectively "Edit" menu in Wordpress. The script allows images located in a certain directory to be rotated, resized and cropped. The cropping is based on a library provided by Walter Zorn, whom I mentioned earlier this year already. A PHP script building a cropping interface around that library can be found at amunts.com [3]. The script discussed here is an updated version (added cropping) of what I posted in March [4]. Use it or leave it! ;-)

[1] http://www.circle.ch/php/files/edit-images.phps
[2] http://www.walterzorn.com/dragdrop/dragdrop_e.htm
[3] http://php.amnuts.com/index.php?do=view&id=12
[4] http://www.circle.ch/blog/p1371.html

Comments (0) Permalink del.icio.us

19. October 2004

Outlook to iCal export
@ 10:17:27

phpicalendar [1] is a PHP tool that parses ics files. Norm Jones [2,3] wrote a script that converts Outlook calendar items to iCal files which are easy to spread among a group with phpicalendar:
The outlook2ical utility is a VB macro that can be used to export a set of appointments from an Outlook Calendar to the iCal format. The end result is a *.ics file. My motivation for developing this macro is that I am not happy with the "Save As Web Page" option in Outlook. The main problem is that it saves all appointments associated with an Outlook calendar. I would like to only export appointments of a selected category or categories. I also wanted to be able to view the exported calendar using PHP-iCalendar, which has a far superior appearance when viewed on the web.
[1] http://phpicalendar.sf.net
[2] http://www2.et.byu.edu/~njones/share/outlook2ical/
[3] http://phpicalendar.net/forums/viewtopic.php?t=492

Update: Have a look at other tools: http://circle.ch/wiki/CalendarTools

Comments (4) Permalink del.icio.us

18. October 2004

W3C link checker
@ 21:17:14

(Re)found a comfy tool to check an HTML file for valid links [1]. Thanks to W3C who offers it as an online service. I am wondering, if there is a comparable PHP implementation to work locally since I am not sure, if the PEAR HTTP_Client_LinkChecker is effectively is an equivalent or at least a starting point [2].

[1] http://validator.w3.org/checklink
[2] http://www.phpkitchen.com/viewableCode/linkchecker.phps

Comments (0) Permalink del.icio.us

17. October 2004

Rewrite of captcha-like feature
@ 20:31:27

The captcha-like [1] feature on behalf of the blog comments for this weblog has been rewritten. If it does not work for you as expected, please let me know. The feature is based on a completely homegrown implementation written in PHP and adopted to b2/cafelog. If you like something similar then you might like to have a look at the PEAR captcha package [2].

[1] http://en.wikipedia.org/wiki/Captcha
[2] http://pear.php.net/pepr/pepr-proposal-show.php?id=80

Comments (0) Permalink del.icio.us

12. September 2004

Gmail as a blog engine
@ 17:09:09

Jonathan Hernandez [1] wrote a PHP application that converts Gmail messages to blog entries, where the messages are signed with a star. Replies to conversations are converted to blog comments. The scripts are licensed under GPL. Some more Gmail related projects are linked in my wiki under GmailFS.

[1] http://ion.gluch.org.mx/files/Hacks/gallina/

Comments (2) Permalink del.icio.us

15. August 2004

Designing labels with SVG and convert them to PDF with PHP
@ 13:36:20

Alan Knowles [1] described the process of designing labels with SVG and the conversion to PDF with PHP last December. There he points to an SVG editor called Sodipodi [2]. Inkscape [3] is yet another SVG editor running on various platforms [3]. Designing labes with SVG seems a reasonable approach. As Alan states correctly, the
FPDF [http://fpdf.org ] is quite a nice library for creating PDFs, however, the thought of hardcoding up all the locations in PHP, for all the text on both applications horrified me.
That is how we implemented our label printing system for LOTS 2004. Positioning a few lines of text and an image is easily done with FDPF for "design once, use many" labels.

[1] http://blog.akbkhome.com/blog/archives/26_PHP_SVG_and_PDFs.html
[2] http://www.sodipodi.com
[3] http://www.circle.ch/blog/p1396.html

Comments (0) Permalink del.icio.us

09. August 2004

Minimalistic CMS
@ 14:40:13

Edit This Page PHP [1] is a PHP script that can be uploaded to any webhost that supports PHP. It allows for the HTML content of a page to be edited by a link on that page. Only two files are required: the core PHP script (editthispage.php) and a data file for each page. The core file can support as many pages as desired. Get more background information on that lightweight Wiki from Christopher Allen [2], one of its authors.

[1] http://editthispagephp.sourceforge.net
[2] http://www.lifewithalacrity.com/2003/12/editthispagephp.html

QR Code for your mobile phone.
Comments (0) Permalink del.icio.us

30. July 2004

Fulltext search in PHP files on Windows
@ 15:49:11

Mark [1] pointed out a way to let the standard Windows search engine search through php files; for those not using find, grep et. al. ;-)

[1] http://weblogtoolscollection.com/?p=464

Comments (0) Permalink del.icio.us

26. July 2004

PHP on Symbian?
@ 23:13:33

The question has been asked already [1] but what I can see has been left un-answered. Has there anyone some news on that topic?

[1] http://groups.google.ch/groups?selm=b4g8vt%24jbq%241%40FreeBSD.csie.NCTU.edu.tw

Comments (1) Permalink del.icio.us

07. July 2004

Livesearch - let's talk about usability
@ 21:27:17

With some Javascript and PHP Chregu Stocker implemented a feature to his blog search that I have only seen on the X1 search engine [1] for Windows so far; he calls it Livesearch [2]. While typing a word into the form field, a list of results refined by each letter gets displayed below. Really uebergeil.

[1] http://www.x1.com
[2] http://blog.bitflux.ch/p1736.html

Comments (0) Permalink del.icio.us

06. June 2004

Single-file PHP Auth class
@ 22:03:06

I got an email from Lucas Carlson, the author of PHP Auth [1], asking me to blog something about this class. The authentication class viewed from its usage looks quite similar to the PEAR Auth class. Lucas' class is focused on database containers as far as I can see. What I first saw at Paul M. Jones DB_Table class, is now also to be used in this class; defining a table directly in the PHP code. It looks kind of complex at first sight but is actually very simple to handle from my point of view.

http://phpauth.sourceforge.net

Comments (0) Permalink del.icio.us

02. June 2004

PEAR XML_FOAF package
@ 22:25:09

Daniel O'Conner [1] pointed out in a comment [2] on this blog, that PEAR now has a FOAF package to offer [3].

[1] http://my.opera.com/CloCkWeRX/journal/39
[2] http://www.circle.ch/blog/p909.html
[3] http://pear.php.net/package/XML_FOAF/

Comments (0) Permalink del.icio.us

19. May 2004

PHP Layers Menu - dynamic menu trees
@ 09:57:01

PHP Layers Menu [1] is a Javascript-based hierarchical dynamic menu system to rapidly choose among the items.It provides also JavaScript-based tree menus, whose nodes can be expanded and collapsed on sufficiently DOM-compliant browsers. Probably good news for those, seeking a navigation for a structured CMS.

[1] http://phplayersmenu.sourceforge.net

Update: Just found another DHTML menu on sourceforge: http://xmenu-xlayer.sourceforge.net

Comments (0) Permalink del.icio.us

10. May 2004

DB_Table - working differently with Tables and Forms
@ 17:15:22

I recently decided to dive into Paul M. Jones' DB_Table class [1] - now officially available through PEAR - to get a clear view on what this is about. The most odd thing for me was the fact, that you do no longer create tables directly e.g. MySQL but define colums, indexes and - pretty cool - selects in advance, which means, directly within your PHP script.

What it does; it creates a defined table at first run if there is no such table yet in the database. Paul explains in small steps how you could build a guestbook with it. One of the nice parts of DB_Table is the ready-to-use QuickForm configuration. While defining a column for the table you give additional QuickForm information to that regarding that certain field. Building forms is therefore quite easy.

ThanQ Paul for those contributions.

[1] http://wiki.ciaweb.net/yawiki/index.php?area=DB_Table

Comments (0) Permalink del.icio.us

27. March 2004

De- and encoding Base64, UUEncoding, XXEncoding and Yenc files with PHP
@ 13:55:07

Stéphane Degré and Renaud Hager [1] have implemented an encoder and decoder extension for PHP to handle Base64, UUEncoding, XXEncoding and Yenc encoding.

[1] http://php-attcodec.sourceforge.net

Comments (0) Permalink del.icio.us

24. March 2004

Apache2 with PHP5 CGI and PHP4 module on OS X
@ 15:15:30

Looking at the configuration now looks like it was a job at ease; but it took me some hours to work properly. PHP is now working in two versions in parallel on Apache2 on OS X 10.3.3. I will show you the configurations for the compilation first. Firstly, there is the configuration for PHP 4.3.4:
#:~/src/php-4.3.4 urs$ ./configure \
--disable-cgi \
--disable-pdo \
--enable-force-cgi-redirect \
--prefix=/usr/local/php \
--with-zlib \
--with-iconv=/sw/ \
--without-bundle-libxml \
--with-dom=/sw/ \
--with-libxml-dir=/sw/ \
--with-xsl=/sw/ \
--disable-pear \
--with-gd \
--with-freetype-dir=/sw/lib/freetype2/ \
--with-jpeg-dir=/sw/ \
--with-png-dir=/sw/ \
--enable-sockets \
--enable-pcntl \
--enable-shmop \
--enable-sysvshm \
--enable-sysvsem \
--with-mysql=/usr/local/mysql/ \
--enable-debug \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-config-file-path=/usr/local/php \
--with-config-file=/usr/local/php/php.ini
As below, this is what you can type to get PHP 5.0.0 RC1:
#:~/src/php-5.0.0RC1 urs$ ./configure \
--enable-force-cgi-redirect \
--prefix=/usr/local/php5-cgi \
--with-zlib \
--with-iconv=/sw/ \
--without-bundle-libxml \
--with-dom=/sw/ \
--with-libxml-dir=/sw/ \
--with-xsl=/sw/ \
--disable-pear \
--with-gd \
--with-freetype-dir=/sw/lib/freetype2/ \
--with-jpeg-dir=/sw/ \
--with-png-dir=/sw/ \
--with-mysql=/usr/local/mysql/ \
--enable-debug \
--with-config-file-path=/usr/local/php5-cgi \
--with-config-file=/usr/local/php5-cgi/php.ini
I have chose specific configuration paths for each version. As far as I can see, you need to give the path and the filename as well. Especially for the CGI version, you should specify the option --enable-force-cgi-redirect.

Now the tricky part was to get a working configuration for the virtual hosts. The idea behind is to have a PHP 4 module installed as default and a per-virtual-host-configuration for other versions of PHP; that might be PHP 5 or 3. So on port 86 php scripts will be processed by PHP 5.0.0 RC1.

Listen 86
<VirtualHost _default_:86>
ServerName localhost

ScriptAlias /php5 /usr/local/php5-cgi/bin/
<Directory /usr/local/php5-cgi/bin/>
Options +ExecCGI +FollowSymLinks
AllowOverride None
</Directory>

DocumentRoot /Library/Webserver/Documents/project-a
<Directory /Library/Webserver/Documents/project-a>
DirectoryIndex index.php
Options Includes Indexes FollowSymLinks MultiViews
AllowOverride None Options FileInfo
Action php5-cgi /php5/php
AddHandler php5-cgi .php .php5
</Directory>

ErrorLog logs/default_86-error_log
CustomLog logs/default_86-access_log combined
</VirtualHost>

<VirtualHost *>
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DocumentRoot /Library/Webserver/
<Directory /Library/Webserver/>
DirectoryIndex index.php
Options Includes Indexes FollowSymLinks MultiViews
AllowOverride None Options FileInfo
</Directory>
</VirtualHost>
I collected various links and jotted down some eventually interesting information in the (Wiki/PHP5).

Comments (2) Permalink del.icio.us

22. March 2004

Image cropping with PHP and Javascript
@ 11:39:51

Image Handler
By far, this is some of the most valuable javascript code I have seen for a while. Walter Zorn has written various libraries to drag & drop [1] layers and also to draw graphics [2] with javascript. At least the jsgraphics library is published under GPL; for the others I would propose to visit the website of Walter and ask himself regarding license question.

The image above show the result of an implementation of one library together with some PHP image handling which was done by Andrew Collington [3]. It was very easy to implement it into my Wordpress Image Handler.

[1] http://www.walterzorn.com/dragdrop/dragdrop_e.htm
[2] http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm
[3] http://www.zend.com/codex.php?id=1340&single=1

Comments (5) Permalink del.icio.us

21. March 2004

PHP5 CGI parallel to PHP4 module on Windows
@ 15:38:05

I was looking for a way to have both PHP4 and PHP5 running on Windows. So there was a bit of adaption of the note made by seric [1] to the Windows environment (Installation/PHP5). PHP4 still works as Apache module while PHP5 runs as CGI on a port-based virtual host:

Listen 83
<Virtualhost _default_:83>
ServerName localhost
ServerAdmin me@localhost
DirectoryIndex index.html index.php
ErrorLog logs/error.log
# http://httpd.apache.org/docs-2.1/mod/core.html.en#limit
<Location />
<Limit CONNECT>
Order allow,deny
Allow from all
</Limit>
</Location>
DocumentRoot "C:/www/project-a/"
ScriptAlias /cgi-bin/ "C:/php5/"
Action php5-script /cgi-bin/php-cgi.exe
AddHandler php5-script .php .html
</Virtualhost>
The downloaded PHP 5.0.0RC1 zip package has been unpacked to c:\php5. Then I renamed the php.ini-dist to php.ini and restarted Apache.

[1] http://seric.cowiki.org/17.html

Comments (0) Permalink del.icio.us

16. March 2004

Just no win-win situation
@ 21:24:46

Yesterday I moved a PHP project from Windows to OS X. For reasons of laziness I often code something like:
if (stristr(PHP_OS, "WIN")) {
echo "Do something Windows-related here...";
}
This worked usually perfect for scripts moved between Windows and Linux based systems. But one has to be more precise for scripts to run additionally on OS X. Since OS X comes with a PHP_OS string consisting of "Darwin". If you are wondering, why your scripts do not work on Mac try this:
if (stristr(PHP_OS, "Windows")) {
echo "Do something Windows-related here...";
}

Comments (0) Permalink del.icio.us

A Wiki Blog joint-venture by Elke
@ 00:23:27

Elke Engel [1] showed up a working demo [2] of an interoperable Wiki-Blog the other day. The system is based on the Kaywa blog and uses the PEAR class by Paul M. Jones [3] to handle the Wiki syntax. Good look with finishing up your thesis ;)

[1] http://purplegreen.abstrakt.ch/blog/archives/000214.html
[2] http://engelwiki.var.cc
[3] http://wiki.ciaweb.net/view.php?wiki=Text_Wiki

Comments (1) Permalink del.icio.us

14. March 2004

Image Handler for Wordpress
@ 17:05:58

Image Handler
The other day I was just fed up using the ftp client to clean up a mal-orientated image. So here is a basically stand-alone script [1] to treat (rotate, resize, delete) images used e.g. with Wordpress [2]. The PHP based script requires either the GD 2.0, Imagemagick or PHP ext/imagick to be installed. PEAR Image_Transform is an option as well, but not necessary. The script has been tested on Windows as on Debian. You can copy it to wp-admin and configure your base directory where you keep your images.

[1] http://www.circle.ch/php/files/edit-images.php.html
[2] http://www.wordpress.org

Comments (0) Permalink del.icio.us

11. March 2004

How to walk back N directories
@ 02:23:27

While scanning a directory tree I run into the following situation; Consider you have the following three paths:

- /home/project/user/www/ (web root folder )
- /home/project/user/www/images (folder for images )
- /home/project/user/www/include/dummy/script.php (script to handle images )

The problem was, that the function to scan the images folder (tree) in script.php did not handle absolute path properly (access rights?). So I was looking for a solution to give the relative path from the working directory of script.php back to the absolute path. The following few lines in PHP did it quite well:
$p1 = substr_count(realpath(ABSPATH), DIRECTORY_SEPARATOR);
$p2 = substr_count(realpath(dirname(__FILE__)), DIRECTORY_SEPARATOR);
for($j=0;$j< ($p2-$p1);$j++) $ret .= "../";
echo $relative_path = $ret . ltrim($image_base_dir, DIRECTORY_SEPARATOR);
A possible result would be "../../images", while $image_base_dir is set to "images". Eventually I missed a simple function this topic easier, if so, let me know ;-)

Comments (0) Permalink del.icio.us

06. March 2004

HTMLarea with enhanced Image Handler
@ 14:28:44

HTMLarea has an enhanced Image Handler written by Wei Zhuo [1]. It is based on PHP and uses GD or Imagemagick. It is not quite clear under which license the code is published; The HTMLarea itself is available under a BSD-like license.

The Image Handler allows to upload and treat images such as rotating, resizing etc. It runs as well under Mozilla as IE. A modified version is available for Coldfusion [2].

[1] http://www.zhuo.org/htmlarea/?view=flat
[2] http://huizen.ddsw.nl/bewoners/slopera/projects/projects.htm

Comments (0) Permalink del.icio.us

04. March 2004

Japha - expandable implementation of Java in PHP
@ 10:37:34

Java to be used within PHP often is painful. So, Japha [1] is an attempt to bring the main classes in the Java 1.4.1 (soon to be 1.4.2, time allowing) to PHP for use in everyday programs. Japha refers to PHP 5. This allows us to easily implement interface, abstract classes, and more inheritance capabilities, not to mention excellent error handling and the ability to better conform with user-created data types.

[1] http://japha.xzon.net

Comments (2) Permalink del.icio.us

foresite PRS - a GPL Project Reporting System
@ 09:53:42

foresite Systems [1] has released its first package under GPL. The foresite PRS is a PHP based Project Reporting System. On OS X you have to give as well to give some rights:
mojito:~/foresitePRS urs$ chmod 0777 config/prs.ini
mojito:~/foresitePRS urs$ chmod 0777 lang/lang_cache.txt
mojito:~/foresitePRS urs$ sudo find . -name "init.sql"
./config/init.sql
You will be pointed to an installation routine. The installation process indicated that the init.sql could not be found. If this is the case just upload the init.sql from the config/ folder with e.g. phpMyAdmin. Nice work of the foresite Programmers.

[1] http://foresite.ch/Download.html

Comments (1) Permalink del.icio.us

27. February 2004

[RT] Handling SQLite remote files with PHP
@ 10:38:28

First I have to clarify the [RT]; Bertrand Delacrétaz [1] mentioned at LOTS, that he indicates "random thoughts" in mailinglists as "[RT]". I like that idea, because the title to this blog post does not mean to be a new feature in the PECL sqlite extension but generally a random thought of mine. I started a new project on sourceforge called wikita [2]. It is a common playground for me to set up a simple wiki based on PEAR classes where ever possible. Since I have started the PEAR sqlite DB wrapper earlier, it needed some more testing. Wikita from that point of view is also a testbed for this wrapper.

Just the other day I checked in some code into the CVS of sourceforge. The code is not much more than a hack for now. Anyway. To come to the point of this post: SF does not yet support the sqlite extension. So the title here suggests that there could/should be a way to handle sqlite remote database files. PHP does allow to handle remote files but IMHO the sqlite extension does not. If this is secure or not is to discuss afterwards. PHP5 will generally offer sqlite support. Nevertheless I ask myself if there are any applications that would make sense to have sqlite databases handled remotely. Maybe for portable devices such as mobile phones or handhelds, if they ever offer PHP support (some actually _do_ offer already Python [3]). Since they offer limited storage space, it could be a solution. Contradictions, comments?

[1] http://codeconsult.ch/bertrand/
[2] http://sourceforge.net/projects/wikita
[3] http://www.mobilewhack.com/programming/python/python_on_nokia_screenshots.html

Comments (1) Permalink del.icio.us

26. February 2004

Sleepycat DB XML 1.2.1 with PHP API
@ 13:40:50

The new DB XML offers now a PHP API:
Sleepycat Software is pleased to announce the release of Berkeley DB XML
version 1.2.1! DB XML 1.2.1 is a maintenance/bug fix release.

New Features

A PHP API has been added to the distribution. This is a
preliminary release of this functionality. For details please
see the src/php4/README file contained in the distribution.

[1] http://www.merrells.com/john/dbxml/archives/cat_release_history.html#000229

QR Code for your mobile phone.
Related tags(s):
Comments (0) Permalink del.icio.us
Fatal error: Maximum execution time of 120 seconds exceeded in /home/circle.ch/htdocs/blog/b2comments.php on line 184