Flex Mobile PHP remote server - php

I am totally new to Flex mobile developing.
In FlashBuilder for PHP, you need to specify local PHP server.
My answer is, how to change it to remote server?
Because, i have a hosting, and I need to put files there, to make it public.

You never need a local server per say. Have you tried to look at the files that Flash Builder creates for you (if I remember correctly, in this case it creates a service-config.xml file)? There should be one that mentions ServiceObjects and an endpoint of localhost. You can change this to your remote location.
I personally don't like the xml approach to creating services since it doesn't give me the flexibility I want in the code. I much prefer having it in the code using the ServiceObject class and specifying the endpoint and destination there and using a delegate pattern to call my services. Something for you to look into :)

Related

Dummy CardDav server

I'm looking to build a dummy CardDav server that allows me to do the following:
- add a CardDav source on an iOS device
- the source will show up as a group on the native Contacts app
- no syncing actually takes takes place with the server (no contacts should be stored on the server or deleted from the device)
The purpose for all of this is that I'm looking to manage the source from an iOS app.
I deployed a Baikal CardDav server successfully and I tried to sniff out the requests that take place when registering a new source, unfortunately I'm quite stuck.
At the moment I have a php file that responds to a PROPFIND request and allow for the source to be validated, but it doesn't show up in the Contacts application.
Any tips would be appreciated in either writing a dummy CardDav server or crippling a functioning one in order to only provide the auth functionalities?
Not sure if i understood your question.
You may try Calendarserver at http://trac.calendarserver.org/wiki/docs-trunk . It is simple to install and setup and works without any quirks.
If you need the server to behave a certain way might be best to use a Carddav framework like SabreDav (for PHP) or milton.io (for java, my project). Then you can do all sorts of weird backend stuff
Milton actually comes with really simple example projects with in-memory data thats perfect for mucking about with

Authenticate a PC before running my website

I'm making an web application, it's a kind of online shop using PHP, jQuery, AJAX and JavaScript.
I want to launch my site on only one PC on local host. How should I set my site so that it only runs on my single PC?
Even if anybody copy my code files and database files to his/her own PC it should not run on their PC. How to do this?
The one way I know is by using the IP address. but I not quite sure about this method works or not.
If someone gains access to your source code then there is nothing that you can do to stop them.
When hosting it on your own you can prevent external access but beyond that there is nothing you can do.
You can use an encoder script to encrypt your source code, and some of these come with an ability to lock down to MAC address. I think they are all commercial solutions, though; start with IonCube and SourceGuardian. Zend might have something as well.
I would imagine each of these solutions would have comprehensive tutorials on their respective sites. Your workflow is basically to check out a copy of your source code from version control, and encode that folder as part of your build process.
Technically, encrypted code can be reverse-engineered, since the encryption key is built into the code. However, it is a lot of work for someone to do so, and even if they decode it, they won't have your comments or your meaningful variable/method/class names.
Make sure no one gains access to that PC (where your application resides). Only in that case you can protect your application from being run by unauthorized person. Once you take this security measure then you can easily disable your application from being accessed from any other LAN computers by using your IP. This is how professional servers works so should you.
You can change the webserver binding to localhost 127.0.0.1 only.
Alternative way you can create a filter rule that the server only accepts remote from localhost/127.0.0.1
With apache you can do this by .htaccess or directory/server rules.
When you want to share that code, you need to encrypt it with zend-guard or equal tools. there is also some licence management inside it, where you can bind licences to machines.

Is it preferable to retrieve information directly from one site or through my web server using php?

I have an application that retrieves some info and give them to user from a certain public website. However, i am not sure whether i should let my app immediately connect to the target website or it should get the info through my web server using a simple PHP script (JSON).
Actually I am using Jsoup to get the information and I tried both and they worked perfectly ( immediate and PHP) using Jsoup. However, I have not published my app yet due to the confusion aforementioned.
Use the web service. If your client has logic to parse the HTML, it can break when the web page changes. The web service can absorb this change and make corrections, but your client cannot. Not unless you release another version of your app, and that can be a pain.

Cross Domain Folder Use

So I am developing some software in php and mysql. The clients web application is hosted on their server but basically I want an easy way to turn their site off if they don't pay. I wanted to be able to host a say config file on my server that has maybe an array of data that says how long their subscription is good for, what they have access to etc. I obviously don't want to save this information directly on their server because they could manipulate the config to have whatever they want. Their are a number of other things I would be using this for but for the most part these are the most important parts. Also if there is a better way I am always open to any suggestions.
Thanks in advance!

Zend_Cloud_Storage how to send files to browser?

I'd like to store my asset in the cloud. I thought Zend_Cloud_Storage may be the right library? For now they are saved locally using Zend_Cloud_StorageService_Adapter_Filesystem. Upload works so far.
What is the right way to send files from Zend_Cloud_StorageService_Adapter_Filesystem to the browser? I guess this is only possible by streaming them through php? If yes any code examples out there because I have problems getting it working with all the file header.
Using S3 I probably would make a redirect or directly link the files to the s3 bucket?
I'm pretty new to cloud storage so I really appreciate your help.
Kind regards, Manuel
The Zend Cloud services are fairly new and from my experience the documentation still needs a bit of work. Depending on the cloud service, you have either the choice of fetching your objects and delivering them to the user or in some cases you can give the user a direct URL to the asset (this largely depends on if you need to control access to the object).
To fetch an item programmatically, you should be able to get it to work with right header, for example:
$image = $storage->fetchItem("/my/remote/path/picture.jpg");
header("content-type: image/jpg");
echo file_get_contents($image);
In theory you can get the content type for the header from the metadata, but I'm not sure if it is consistent between adapters.
Linking directly depends on your Cloud. For the filesystem you should know the path to where your files are, so you can link from there if they are accessible. In Amazon, you can set the permissions to public when you upload the file - there is an example in the S3 doco here.
I'd recommend having a look at the Zend Service S3 doco, Zend Cloud is just a wrapper for it and in trying to be generic it looses a lot of functionality. if you work with it for any length of time I suspect you'll eventually end up doing calls straight to the service.
Good luck!

Categories