MH’s dev efforts

June 29, 2008

Scaffolding – maintenance release

Filed under: Kohana, programming — Tags: , , , — mhordecki @ 9:27 pm

Just a maintenance release – Kohana has grown a bit, yet Scaffolding’s been untouched. I’ve tested it with revision 2935 and everything’s just fine. And there’s neat bonus – better navigation :) Scaffolding is usually used within an admin panel, so now it can be aware of it – just pass additional parameters to it’s constructor, and you’ll see a beautiful link to your parent panel. Check out sample implementantion (controllers/scaffolding.php) for details.

As always, unpack an archive directly to your modules/ directory. Then be sure to unlock it in your config. You will also need Auth enabled, but if you really don’t want so it’s trivial to delete certain lines in controllers/mycontroller.php.

Rapidshare link: http://rapidshare.com/files/125926351/scaffolding.tar.gz.html

As I saw Scaffolding has meet with warm reception :) Thanks for all your feedback! And, besides, do you have any feature requests?

Best regards,

MH

March 22, 2008

Scaffolding module v2

Filed under: Kohana, programming — Tags: , , , , , — mhordecki @ 9:40 pm

New version: http://mhordecki.wordpress.com/2008/06/29/scaffolding-maintenance-release/

Hello there. At the moment, as you can see, I’m ditching build.py case I’m a bit busy with other projects.

When writing my another PHP project (powered by Kohana, of course), named Milion Kostek (http://www.milion.rubiks-cube.c0.pl, non-English), I realized that, in fact, I’ve got nothing but one free hosting account shared with my friend shipped with one MySQL database to share between us. It’s unevitable that, when multiple systems use one database, each one must use table prefixes to avoid naming collisions.

Unfortunately, Kohana framework has got some flaws in field of table prefixes. Of course, such thing as $db->select(’users.id’) works perfectly, but $db->groupby(’users.id’) does not. What’s more, when I need to use sql functions, like $db->select(”concat(tableA.X,  ‘glue’, tableB.Y), I’m simply forced to write SQL query by hand. Even if I add table prefix manually, it will all fail cause query builder’s select method explodes it’s parameter by ‘,’ , so my concat call would be torn apart).

It’s easy to predict that I’ve ended up in writing my own query builder ;) . I almost complete, yet documentation is missing. As soon as I write it I will upload it here.

Nevertheless, using my Query library I could enchant my Scaffolding module. Here are the main changes:

  • Full support for table prefixes (;) )
  • Key fields can be now sql expressions (like my favourite concat)
  • Pagination in managementpage
  • Lots of minor bugfixes

Hope it will be useful for someone :)

Download link: http://rapidshare.com/files/101560292/scaffolding.zip.html.

How to install:

  1. Just drop it in modules/ folder in your Kohana app
  2. Enable it in $config['modules'] in your config.php (thanks nevez :) )
  3. Go to yoursite.com/scaffolding .

February 10, 2008

Sphinx – official Python documentation tool

Filed under: Python, programming — Tags: , , , , — mhordecki @ 1:45 pm

EDIT: Sphinx’s gone public: http://sphinx.pocoo.org/

While searching for an ideal documentation tool for build.py, i’ve checked pydoc, epydoc and many many more. Two days ago, I’ve landed on Python development version documentation site (http://docs.python.org/dev). Engine has been totally reworked (besides, new look n’ feel is simply beautiful). Now, it sits on Sphinx, which is boosted reStructuredText engine with syntax highlighting, Table of Contents generation and a bunch of another useful gadgets.

I saw it nearly perfect for my purposes, as I don’t like docstrings and I’ve had some good experiences with text markup syntax (Markdown, particularly). The only problem is, Sphinx isn’t available as a standalone package – it’s bundled with main Python branch. Hence, there’s a solution how to incorporate Sphinx into your projects.

(more…)

February 7, 2008

Scaffolding module for Kohana PHP

Filed under: Kohana, programming — Tags: , , , , , — mhordecki @ 9:48 am

Edit: New version – check http://mhordecki.wordpress.com/2008/03/22/scaffolding-module-v2/

At the moment, build.py is undergoing some serious refactoring. In a meanwhile, I was (and I still am) engaged in small web application project. First started off with Django to code things quickly. Despite it’s beauty, running python scripts on Dreamhost is pain in the ass.

Therefore I switched to PHP. For a long time my beloved framework was CodeIgniter. And, guess what?, it got forked by community. The fork is called Kohana PHP. It benefits from PHP5 power and, comparing to CI, it’s completely community-driven.

It’s fast and tiny, almost perfect for my goals. I don’t want to learn big ones like Symphony or cakePHP. Kohana’s got as fast learning curve as Django. However, it’s stil new piece of software, it lacks then a few useful things. My first impression was: where’s that damn admin panel? Everyone who’s working with Django knows what I’m saying. Django’s got special admin module, which generates CRUD interface for every Model in an application. It’s simply blessing, cause I suppose no one likes doing this by himself.

There’s no such a feature in Kohana, so I decided to write it by myself. My Scaffolding Module uses Kohana extendability, reads metadata from database and loads every Model in existence under CRUD panel. It’s also easy to incorporate CRUD for single Models in your own admin panels (mere one-liner to type)

Scaffolding Module is only a draft of real software. It’s got basic functionality, basic manual covering it’s features, but it’s documented badly, probably got many bugs and so on. I will update it if I need additional features for my project. Nevertheless, I will be grateful to all usage feedbacks, feature requests and so on.

Installation: Unpack it straight into modules/ dir in your Kohana application.

Because of WordPress.com restrictions, I can’t upload it here. There are two ways to get it:

January 16, 2008

build.py 0.3 beta

Filed under: build.py — Tags: , , — mhordecki @ 1:12 pm

Despite being the beta version, is a lot more stable than 0.2. Link to the source is given below the post(unfortunately wordpress.com does not allow uploading text files). You can also download fresh svn by:

svn checkout -N https :/ /cubeassistant.googlecode.com/svn/trunk/

Then, grab build.py from checkouted directory. You can also see Buildfile for the usage example. Stay tuned, next goes the tutorial!

 build.py 0.3 beta

Known issues:

  • When using the same target twice or more times and then building object files are multiply linked (see ‘./build.py clean build’ )

TODO:

  • Windows support
  • Library presence check
  • Installation automation macros

January 15, 2008

build.py 0.2

Filed under: build.py — Tags: , — mhordecki @ 11:49 am

build.py has hit 0.2 yesterday. That’s still an experimental release, perhaps 0.3 will be ready to be published with docs and so on.

Blog at WordPress.com.