10 Replies Latest reply on Jan 24, 2010 8:44 PM by David_F57

    Services Placement in FB4

    Daniel Pride Level 1


      I am developing in Flashbuilder after working in Flex for a while.

      In Flex and Php I would put the connection data in an includes file and reference it in the phpcode

      In AmfPhp it was obvious where to put this, in the amfphp services folder

      Its not so obvious (at least to me so far) with Php objects since the log in is in each class

      the the file seems to be built into the swf (maybe?)


      I am developing in localhost but then I want to build the project and ftp it up to a Godaddy folder.

      The connection data is different after i do the build and ftp the result up to godaddy.

      The built folder only has the gateway php and the ZenPhp folder does not seem to have any connection references in it i can find????



      Dan Pride

        • 1. Re: Services Placement in FB4
          David_F57 Level 5

          Hi Dan,


          With the zend services (php files) they are usually located in a service folder that hangs from your project, in the current beta when you create a release build this folder is not included you need to manually move it to your server(thats step 1). I believe this has been fixed in internal FB builds. Unlike the old way of having endpoints setup in an xml file you now have to set pathing in both the amf config file and also in the fml file that is in your main projects .model folder. The endpoints are then compiled into your swf.


          If you have multiple php service files you could make your own connection parameter php file/class and then replace connection parameters with an include for each php service.


          Thats the simple explaination and there are several posts that have covered various local/remote issues with zend, do a search on 'zend'  to read those threads.


          At the moment I am working on a host where it will have a purpose built 'zend framework' virtual machine once I have everything up and running i'll post a step by step guide to moving from local development to remote release. Hopefully in about a weeks time.




          • 2. Re: Services Placement in FB4
            Daniel Pride Level 1

            >you now have to set pathing in both the amf config file and also in the fml file that is in your main projects .model folder. The endpoints are then >compiled into your swf.


            So thats

            bin-release/amf_config.ini  ??

            Also I do not seem to have a fml file ? What would the exact path be?


            Thanks for the help

            Dan Pride


            P.S. I just copied the Zendframework folder to my sites folder on Mac (localhost)

            and it all seemed to work really well for test running during development,.... or am I missing something.

            • 3. Re: Services Placement in FB4
              Daniel Pride Level 1

              Curious, are you still thinking that zen is 10 to 100 times slower than amfphp? If true is it possible to use amfphp with Flex4?


              The old non "cool objects" php did everything I needed, I just want the transfer speed.



              • 4. Re: Services Placement in FB4
                David_F57 Level 5



                When you create a php based project you usually have the project source in your workspace and the debug output in the www or htdoc folder. In the main project folder is a sub folder .model, in that folder is a file projectname.fml this is the one that provides the same sort of information you would have in the old amfphp services-config.xml, what I liked about the old way is I could set up both my local(testing/debugging) and remote endpoints in the services file then just tell my project which one I wanted to use when I compiled it for release.


                Anyway you can still do it the old way as long as you find an updated amfphp install which has the deprecated code fixed.


                I am still continueing to work with zend in the hope it gets better, and as I have said before I trust Adobe's decisions taking the zend path I just hope they start shaking a big stick at the zend boys and get them to lift their act. All we really need is for the datawizard templates to be opensourced then we can modify the php ones to work with amfphp for those that just want a small compact and fast php solution.



                these are the figures I produced last week when I was testing in antiicpation of a beta zendamf library that was allegedly going to give a 10 fold performance improvement, unfortunately I couldn't get the beta working.


                2,500 records from a client table, id,name,surname,DOB,address,timestamp- these figures are for local network and as the zend kept timing out on the remote server I couldn't get any figures.


                amfphp : 4.772
                zend with flex : 12.291
                zend latest stable : 12.678
                zend unstable : 12.663




                as per zend standards comments about this patch have been ignored.




                • 5. Re: Services Placement in FB4
                  Daniel Pride Level 1

                  This seems a real step backwards for amfphp so far.

                  There I just copy a file up and I am good to go.

                  The build using localhost and simply be copied up, config file different on the server and I am good to go

                  This seems like the stoneage.

                  If the path is set in the flexbuilder folders then will it build properly,since the info is now set for my server

                  if not how do I develop then copy it up a server later ?


                  There is no subfolder with "model" in the build folder so I assume you mean the flashbuilder folder and not the bin debug folder.

                  This is about ten folder paths down something like


                  Is that what you meant by subfolder?


                  This is really frustrating.

                  • 6. Re: Services Placement in FB4
                    Daniel Pride Level 1

                    I searched the entire hard drive on my Mac and found nothing like projectname.fml, xml or anything else

                    I have




                    Was this a typo or am I missing something. I have successfully run a build for localhost and still nothing but the above

                    I am on the beta2 build and have no upgraded to the nightly builds yet.


                    Dan Pride

                    • 7. Re: Services Placement in FB4
                      David_F57 Level 5

                      Hi Dan,


                      I have attached an image which shows the path to the fml file, basically I have a Flex development folder and that is broken up into work/nmespaces(folders) then the projects in those categories so my ZendTest project folder has a .model folder in it as it is a php based project.I assume that a mac as a similar structure. You don't see the fml files from inside your project.


                      when i wrote projectname.fml i should have typed <projectname> , if the project is ZendTest then the path to the model file is




                      As far as the current system for amf, its not that it is archaic its more a lack of automation/information for release builds. The core of the whole data generator/wizards is a great leap forward but like any new path there are hiccups.  I Expect that by release the php setup will be much smoother.


                      I really love that I don't need to write a lot of code in php or actionscript as flashbuilder takes care of most of that for me.


                      What we do need is a lite version of zendamf, not just stripping its useless folders out, but actually remove 'ALL' the unrealistic dependencies it has, I think even that step would improve its performance dramatically.


                      I get very frustrated at times with zendamf but I know that at some stage (hopefully not wishful thinking), it will get better. At that point developing php based RIA's will become a more pleasant experience and excede the desire to revert back to amfphp.





                      [note]. I will have a full zend tutorial done by Wednesday, also I have finally got a semi functional virtual machine set up on my host, hopefully over the next few days it will have a few apache/php/zend containers set up which I can let people access to do real remote testing (Server is in Sydney).

                      • 8. Re: Services Placement in FB4
                        Daniel Pride Level 1

                        I will have a full zend tutorial done by Wednesday,

                        Thanks, this will be most appreciated.


                        Reviewing the code of the automated generator is interesting, but it leaves a lot of questions. It looks like they are assuming a completely normalized table structure. (Not a bad thing but not always the case).


                        Looking at the generated code my first reaction is how in blazes I understand all thats going on so I can construct a simple query by name without the Id of the record.


                        Hopefully your tutorial will make this clear, my first attempts to do so ran into datatype issues (string instead of int).


                        It would be great to get an example of how to modify the generated super code to query by different datatypes.



                        Dan Pride


                        P.S. Would also be very interested in your thoughts on php vs Java as a back end. It seems like most of the market for flex skills is java oriented, and the added absurd amount of complexity of Zen (If I may say so) seems to make a retraining effort in Java seem not so daunting. I am  thinking seriously of jumping ship.

                        • 9. Re: Services Placement in FB4
                          Daniel Pride Level 1


                          I assumed as such...

                          My project is named Vehicles and I searched for Vehicles.fml, none on the hard drive anywhere. Its a Mac? beta 2 original release?




                          • 10. Re: Services Placement in FB4
                            David_F57 Level 5



                            Can't speak for mac's but the structure for projects I would assume is the same, as I am not sure of your timezone i will have my desktop open for the next hour so you can log if you want and I can show you the layout of a zend project.