Archive

Posts Tagged ‘PHP’

Finally : a new Crudder-release!

November 28th, 2009
Crudder in action

Crudder in action

It took a while.. a long while actually.. but I finally made a new release of Crudder. This new release 0.50 has a lot of new features and bugfixes, to name a few;

  • New Field-type: HTML-editor
  • New Field-type: File-upload
  • New Field-type: Enum
  • Export to CSV
  • Adding records from the many-2-many-editor
  • Bugfixes; language-support works better, datefield has been fixed, the many-2-many-editor should work better

Check out the DEMO or read more

buTTon CMS, CRUD, Javascript, OOP, PHP , , , , , , ,

Putting the Singleton-pattern to good use

May 3rd, 2009

I like the Singleton-pattern, it saves a lot of trouble on creating objects that you need throughout your code and need to keep their state. Though it’s very tempting, do not use the singleton too much; see here why.

There are some pretty good uses for a Singleton though; a registry and the database-connection;

Read more…

buTTon OOP, PHP , , , ,

Creating your own RPC-interface in PHP

April 17th, 2009

Last week I got a request to create some kind of RPC-server-client in PHP. The assignment was to create a flexible solution to allow remote updating several properties in a database. I’ve created interfaces like this before, but specifically for AJAX-calls to PHP-objects, not really for server-to-server-calls. This particular assignment also involved a PHP-client-object for other developers to implement in their website. The RPC-interface actually doesn’t really care if it’s used for real server-to-server calls or AJAX-calls. However; in this article I’ll focus on server-to-server communication, if designed well it shouldn’t take too much effort to make it AJAX-compatible.

Read more…

buTTon OOP, PHP , , , , ,

Securing PHP’s exec() on Windows

March 24th, 2009

Using php’s exec() function on Windows has a nasty side-effect; you’ll need to give execution-rights to IUSR on cmd.exe, this is pretty much a leak, and something you do not want to do.

I had a problem running executables (like identify.exe and convert.exe from ImageMagick) from php under windows using the exec() funciton. The solution provided by others was kind off stupid… Give full permisions on cmd.exe to IURS… Like you wanna do that…..
I wrote a exec() replacement function using the bypass_shell option proc_open has. It works great for me

Check out this article on bokko.nl to bypass using exec() on Windows

buTTon PHP , ,

AJP : Authenticated JSON Proxy

March 20th, 2009

Authenticated what?

The first hurdle most developers have to take when introduced to AJAX is S.O.P.
S.O.P stands for Same Origin Policy and basically means that you can only do AJAX-requests to the (sub)-domain the client is currently on. First thing I thought when I read about AJAX couple of years ago; ‘wow! cool! I can strip content from other sites and incorporate them in my websites’ .. and immediately I started hammering away on a RSS-reader which was supposed to grab news from a RSS-feed directly. My efforts failed. The RSS-feed was on another domain and S.O.P kicked in spoiling all the fun.
Read more…

buTTon Javascript, OOP, PHP, WPS , , , , , ,

Pending release of CRUDDER

March 4th, 2009

I’m currently still optimizing and debugging a fresh release of Crudder, e.t.a of this release will be somewhere around the midst of March.
Changes:

  • Updates without any affected_rows will not trigger an error anymore, SQL-errors are still caught though
  • MultiLinked fields _should_ work better on MSIE, but you never know; IE sucks at being any kind of predictable (and all other things a browser should do).
  • Language-settings of the interface-texts actually work
  • new feat: thouroughCheck; checks whether a table has non-nullable fields and will make those fields mandatory
  • new feat: exporting data to CSV (currently the output with default-settings is suitable for openOffice)
  • new feat: Advanced filtering / Querybuilder

buTTon CRUD, Content Publishing, Javascript, Open source, PHP , , ,

Announing Crudder

October 18th, 2008

I needed a simple, easy to implement and lightweight library to allow a customer to Create, Read, Update and Delete (CRUD) records in a databascrudder-a-lightweight-easy-to-implement-tool-to-create-read-update-and-delete-records-from-a-databasee. Nothing special here; i could have made a custom PHP-script for this, takes 2 to 3 hours of tedious and annoying work. Instead I googled for something that could do this with minimal configuration, has a small footprint and uses ajax. I ran into fullblown frameworks, with a lot of configuration, or small projects, written spaghetti-style, lot of them a PIA to implement without having to search/replace for paths & includes.

So; I decided to create something like this myself, without a large PHP-Framework, completely written OOP-style (including the Javascript) and when finished it should be able to run with approx. 4 lines of code (not counting the table-definition).

The idea is quite simple; the UI is generated from javascript, no PHP here, configuration is done by one XML file, which contains both controlling-values (theme, language, connectionstring) and the table-definition (which fields to display, what kind of editor to use).

What will you need to run Crudder?
- A LAMP-server (prolly work on IIS-PHP too)
- PHP compiled with DOM and XSL-t-extensions

What 3rdparty code will be used:
- Prototype.js
- ADODB5 (the lite-version will prolly work, I will test this)
- TinyMCE

Check out crudder.net

buTTon CRUD, Content Publishing, Javascript, Open source, Widgets , , , ,


Onze tip:SCDB.info – de meest actuele flitspalen in Europa voor uw GPS!