Note: Does anyone know how to add a code formatting block for BlogSpot?public function getPacmanGraphicByUserId() {$result = array();$user = loginManager::getUser();$graphics = contentModel::getListByUserId($user->user_id);foreach($graphics as $graphic) {if($graphic->type == contentModel::GRAPHIC_TYPE_PACMAN) {$result[] = $graphic;}}return $result;}
The design was heavily influenced by my experience with Symfony. I thought Symfony was robust and adaptive but overly verbose, especially at the Model layer. I emphasized making sure that the PHP naming conventions were easy enough for any programmer to read. While my code generators could whip up a fully-functional administration panel, it wasn't complex enough to reflect the business logic. My inability to address the problem with the Views layer proved politically venomous when additional PHP coders came into create reports, graphs, and tools. They rightfully complained about the clunky View implementation that damn-near got the entire Framework replaced. The Flex guys, on the other hand, found their interaction with the framework easy.
![]() | |
| Apache spawns feel left out of the childhood obesity craze. |
I was delving a little bit into Flex at the time and really wrapped by head around the bubble/target/capture method of handling events. PHP and its mighty serial processing swag couldn't swing such a concept, but I still did my best to emulate event handling. The simple act of defining new event(); (which was extendible) would register the event in a central eventManager queue. I wrapped the MVC phase transitions in a while loop that would only be true if the eventManager queue has events pending. Additionally, between each MVC phase, I would check the eventManager queue to see if there were pending events. One such event was the NavEvent. If a NavEvent was discovered, I would flush the output buffer and continue the loop form the top, essentially rebooting the framework without having to restart everything. This way, a page redirect would not make another request to the server and would have the added benefit of using the current PHP instance with all of its includes, classes, and connections already in memory. If a chain of ten NavEvents managed to sneak through, the whole loop broke off, returning a 500 error and emailing a dump/trace detailing everything.
I had found some fundamental code in the framework performing header redirects. I replaced them all with new NavEvents($uri) calls and, viola, server load dumped dramatically! I'm not sure if this approach would be good everywhere since the URI in the browser does not change to reflect that a redirect has occurred, but maybe someone somewhere likes that. (Rule 34?)
All of my engineering smarts were put into a pine box when I walked in one day and all of the furniture, cubicles, and hardware was packed up and shipped out of state. It was the beginning of the Great Recession and the investor's wife had divorced him. Convenient timing. It's very hard to show off your talents at subsequent job interviews when the place you put a year and a half into suddenly ceases to exist. Such is the life of chasing start-ups...

No comments:
Post a Comment