On Tue, Oct 20, 2009 at 11:48 AM, Franco Ponticelli
<franco.p...@gmail.com> wrote:
Hello Group,
I've started using haxigniter and I wanted to share my first
impressions. Take them considering that I am still at the beginning of
learning it but I am not new to web development. So feel free to
ignore my thoughts if you don't like them ;)
Hello Franco, thank you very much for your valuable feedback. Haxigniter is definitely a work in progress, no official release has been made so this is just what is needed.
* Even if packaged as a haxelib, haxigniter doesn't fit the usual
philosphy for haxe libs. What I mean is that you cannot easily do -lib
haxigniter because you have to change files from the lib itself
(config, controllers ...). I understand that this is a totally
different approach (more symfony or ruby style for what I know) and I
am not saying it must be changed, I am just pointing it out
In the beginning, I basically took the best parts from Codeigniter, including the directory structure which works fine in a php application. I didn't care much that it's now a compiled, quite different environment. Still, the build tools and the dynamic nature of calling the controllers makes it a bit hard to create a pure library out of it. Suggestions are of course welcome if you see some way of doing it. (I can elaborate more on the issues if you like)
Also from an autocomplete point of view it
is annoying because you have a lot of duplicates available. In my
opinion those properties should be moved to an instance of a different
class accessed by the controller (so that only the properties are
visible) or removed entirely to favor public functions (getSomething
()). Obviously this is quiet specific to the controller situation and
it is not a policy I would use everywhere.
The Application class is holding all those properties, so removing the accessor methods and initializing them in the controller constructor could be the solution.
* Ereg2 extends Ereg with no real advantages. Using new Ereg2() is
exactly the same as new Ereg() so I find it a bit pointless. Since it
shares just one static method, I would make it an helper class (not
extending anything) ... something like EregTools using haxe convention
for this type of class)
I know, this was an early mistake that I didn't fix and forgot about. Having a single class in the haxigniter namespace is a bit annoying. I think I'll remove it altogether. Anyone using quoteMeta a lot? :)
* indexPath seems a little broken to me. It works under certain
circumstances but not always. In my dev setup I have mod_rewrite
active and the project is not directly on the root (it is in "/
igniter"). Without changing the code I have been able to make it work
using the convention /igniter/index.n/whatever but this is less than
ideal. To make it work I have splited indexPath in 2 vars: basePath (/
igniter/) and baseProcessor (index.n); for now it works but I am quite
sure I have other things broken that I will have to fix sooner or
later
It's very hard to detect the indexPath properly for all environments. It's not made easier by the fact that it's currently impossible to detect the web server document root on Neko. PHP has all sorts of useful stuff in the $_SERVER array that helps. Splitting the indexPath is a good idea, but it adds complexity. Can you send me a dump of your environment so I can take a look? Change the super(); call in application/Config.hx to super(true); to get the dump.
Again, thanks for your feedback. Anyone else got some comments about this?
/Andreas