8.10.2011

Apple OSX Lion Search Domains FIX

So I finally broke down and installed OSX Lion. Not a lot to hoot about though I like the OpenGL performance and the new Mail app. We'll see how long I am satisfied, but for $30 I am not complaining too much.

A huge problem I ran into was DNS resolution. At my work we use a lot of internal subdomains for our systems. I usually work in 1 and sometimes in the second. Here's an example:

loc1.example.com
loc2.example.com

I usually work in loc1, so I set up the following search domains:

loc1.example.com
example.com

This means if I am looking for host1 it will try host1.loc1.example.com then host1.example.com. This works as expected. The problem is that I used to be able to look up host1.loc2 and it would do the right thing. This is not the case in OSX Lion. My guess is that it wouldn't append the search domain if the host your specified had a dot (.) in it.

Doing a google search lots of people have ran into the same problem, but the solutions all required a reboot. The best description was on this post on MacRumors. This got me there but I didn't want to reboot, so I tried to load up launchctl and restart com.apple.mDNSResponder with no luck. So I goofed around for a bit and found the following to work (after implementing the fix in the MacRumors post above -- go there first!):


$ sudo launchctl
launchd% unload /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
launchd% load /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

then check with:
ps aux | grep -i mdns
_mdnsresponder  2560   0.3  0.0  2481092   2832   ??  Ss    9:20PM   0:00.04 /usr/sbin/mDNSResponder -launchd -AlwaysAppendSearchDomains


Vola! Now all my DNS resolution works! Hope this helps anyone else having issues.

4.21.2011

Short update...

I'm tired. I am so tired of things coming so close to what I want but being unable to deliver on the basics. Now, I am at an impasse; I can either continue to use a software that is under a license I can't release my changed under (because I disgaree with the GPLv3) or write my own. These are my absolute must-haves from a web framework, which I have yet to find:


  • PHP 5.3
    • Namespaced (yes, I want my own class named "core" or "request")
    • Can be used with SPL autoloader
  • Sensible routing like F3 (which is all I use F3 for right now)
    • Don't load every class I put into the route definitions (F3::map() I'm talking to you)
      • If you must, make it a debug setting I can turn off. I don't need every mapped class autoloaded just to check if my map isn't sane. That can be done in QA/debugging/etc
  • Let me use Smarty 3
    • It's an awesome library, still needs namespacing per SPL
This Just In: HOLY GOD!
And as I write these complaints... I find Respect -- my prayers may have been answered. Testing will commence tonight!

2.09.2011

Fat-Free Framework for PHP


One thing I enjoy is when a technology just works. I personally find that most PHP frameworks try and extend themselves too far into complete solutions, trying to solve the problems few people have at the expense of complexity. This is why I have written my own frameworks over and over. Each time iterating over the model and trying to improve the performance and sensibility of the system. Even though I am pretty proud of my efforts, late last year I stumbled onto a framework that really caught my attention, the PHP Fat-Free Framework. It has the elements of simplicity I feel really allow a developer to push out code quickly. It's very well thought out and feels very tornado-like in it's design style. One problem I have always had with PHP frameworks were their lack of a good routing solution.

I like python, however, one issue I have with the general attitude of pythons core development is it's inability to accept that it too has flaws, even with some of it's core libraries. These are often dismissed when discussed as something you just need to work around and I find it hard to swallow the pill that just because it's more structured than PHP, the problems with the core (anyone who has used datetime and had to deal with timezones and mongodb cannot say there are no flaws in python) are not acknowledged well enough, or even documented well enough, to make coding as pleasant as I feel it could be. That being said, I did enjoy using twisted as a web framework. It had the simplicity in it's design I was looking for. It also is very powerful, and is probably the default framework I will go with for any python-based project I work on.

With all that in mind, I am a PHP developer, and I found Fat-Free to be a breath of fresh air. I finally feel I don't need to write a new framework and really have a place to begin all my future projects. Fat-Free PHP 5.3+, which is what I try to write everything in now. I like namespaces, even if the syntax is a little annoying, I understand the intention and the reasons we have to go with ye olde backspace. I also feel that web page rendering and routing fits very well with OOP and having a stronger OOP core in 5.3 is key.

Fat-Free, to me, feels very similar to tornado in it's framework design. You define your routing in the main file and it's all handled by included classes. The automatic importing of your classes is very easy to understand, and the routing is extremely simple yet powerful. The ORM tools provided are at least good enough to do anything you really need to, however, if it's not to your liking you just don't use it. I love that about F3. Nothing but the core is required. I like Smarty, especially V3, and I use it whenever I can. Even though the built-in templating supports a lot of the same features, I can do everything I need to do in Smarty, and I am more comfortable with extending it and it's syntax. As with the ORM libraries, you simply don't use f3 and you're off and running with whatever you want to use for rendering your pages.

So check it out. I would like to see your feedback and hear your feelings on the overall state of PHP frameworks.