
I made some new custom AMFPHP Service classes for the GeSHi – Generic Syntax Highlighter & Google Analytics API.
Which is very nice, because now I can do superclean datahandling in my Flex Backend application. You can already have a look at the first result in an animated PieChart component on the dashboard page. It’s showing the most frequently visited pages in my flex application for a custom daterange. (Thanks to the use of the Flex BrowserManager Object & the Google Analytics Event tracking)
I also added another section called “Code Snippets” to my portfolio. Collecting my most frequently used snippets/classes. Nicely formatted with the AS3 & MXML syntax highliter Service. It sends a plain String from my mysql DB trough the Custom made AMFPHP Geshi service. And what do we get back?
A new string but with CSS style class declarations. Throw the String now into a HTML Flex container attach a Flash supported CSS file to it… et Voilà. (I’ve also added image caching in my datagrid Traveling component. The flags were flashing all the time when you were scrolling up & down.)
< ?php require_once 'googleAPI.class.php'; require_once("vo/ReportRequest.php"); class GoogleAnalyticsService { public $gapi; public function GoogleAnalyticsService() { $this->gapi = new googleAPI('username@gmail.com','password',"youranalyticsaccountname"); } public function viewReport(ReportRequest $vo) { //max 10 metrics //and then max 7 dimensions //"2009-05-01","2009-05-06" $reportData = $this->gapi->viewReport($vo->startDate, $vo->endDate, "ga:uniquePageviews", "ga:pageTitle,ga:pagePath"); return $reportData; } } ?>
< ?php require_once("vo/Code.php"); require ("geshi.php"); class GeshiService { public function GeshiService() { } public function parseCode(Code $code) { $geshi = new GeSHi($code->code, $code->type); $geshi->set_header_type(GESHI_HEADER_PRE_VALID); $geshi->enable_classes(); $code->parsedHtmlCode = $geshi->parse_code(); return $code; } } ?>

Awesome work! Question, are you going to make the geshi service publicly available? I’m very interested in it.
Greets from Switzerland,
Sandro
I think you mean the geshi.php? That you can download from the Geshi website. The AMFPHP service is up here, doesn’t contain any groundbreaking stuff except calling the Geshi class.
Oh, what’s the vo/Code.php from then ? part of AMFPHP ?
No that’s just an object I’m using in my project. A simple personalized PHP object mapped onto my Flex Object. You don’t need to use that, you can always use just a string to pass trough the PHP function. If you read up on AMFPHP, Flex and classmapping. You’ll see what I did here with my Code Object. It’s very easy.