Optain information in time-real using third part resources - php

This post is for optain information, i have this architecture:
Server software own----> API ----> Server provider
Actually i'm obtain information from server provider use an API, this information is obtained from our own software server, but this happen each hour because we use a cron job.
I wanna know if exist some technology where i can obtain the information more quickly where i don't need use a cron i mean, where for example: When heppen a change in Server provider i can know automatic this situation and i can get information.
I wanna know if "sockets web" is the tech that i need learn or if exist other way.
Repeat i don't want that yours say me how i can do it i want know what tech exist (using the architecture explained) that i can use.
Thank u a lot for the help.

Related

Push messages to android using PHP without GCM or FCM

I need some methods for pushing JSON messages to android application from the server using PHP but without GCM or FCM.
I don't want to use Google because it sometimes doesn't send messages or they arrive in late, and I need a reliable service.
My goal is to update some text views when something happens on the server, for example, a user subscribes for a live game, so other users see the number of players increased real-time.
Also, I'm a little ashamed, I'm not able to use other server languages except PHP, and even if I could, my hosting service is not able to install Node or other languages. Moreover, my hosting server doesn't support the composer, so I need to install libraries manually.
I try to use Pusher, and it works fine, but it costs too much if one day I reach a good number of players. Actually, my budget is 0 :(
I also heard about Socket.io but I don't know how to use it with PHP. If someone uses it with PHP I'm really happy to see a front-end and back-end simple examples.
Does anyone have a solution?
Your use case would be best served with something like Firebase Realtime Database or Cloud Firestore or if you want your own server stack, something like Parse.
Doing this will avoid the use of server side code. Also you can react to real time changes with all of the above. All these intrinsically do run over Sockets so instead of rolling out your own, i suggest you have a look at these and try to fit these for your use case.
Using notifications for this is kind of an overkill and may cause your app to get blacklisted for overly spamming users.

Create secure API communication

I am looking to build an API that I can deploy on my servers to monitor system load.
It will report to a central manager server that runs a client to display the information.
The issue I am struggling with is best to secure the API.
What I want is for the client to be the only software that can access the server and retrieve this information but I am unsure how to achieve this using PHP.
I also want the possibility of distributing the API and client for others to use on their servers so I don't want people to be able to access other people data if they are using the API also.
The client is also written in PHP using MySql and has a secure login.
This sounds like you're trying to solve the wrong problem.
I also want the possibility of distributing the API and client for others to use on their servers so I don't want people to be able to access other people data if they are using the API also.
The only right answer to this is authentication. You need to protect your API by giving each user access credentials known only to them.
Your API must never reveal any data that the client isn't allowed to see as per their authentication credentials. Trying to work around this danger by trying to somehow protect the client from prying eyes is not safe - somebody who has access to the client and can observe it running will be able to reverse engineer any traffic between it and the server given enough effort.
If the API is properly secured, it won't matter to you which client tool is used to access it. The requirement to limit API access to a certain program will go away.
if you use SSL, along with authentication (i use 3rd party auth google, fb, etc), create data /reports on the fly and have the data saved in a subdirectory OUTSIDE your web folder (instead of /var/www, /var/myStorage/currentSessionId/), then you basically guarantee the security that you want.
your php will only access a subdir that is named for the session it is running under.

Which is the best feasible solution for sharing the data from the database?

here is my scenario, i am building a web application using PHP and MySQL. basically it is a real estate application. where i would like to share the data among several other platforms and devices, here is i what i intend to do
a) building the web app to be used with the browser using PHP, MySQL, and AJAX. (this will be my server)
b) extend the support and build a desktop application using POKKI.
c) extend the support and build an application for Androids and iOS devices.
d) all data transaction for the app should take place from the web server.
e) basically it will be server client application . where the server will be my web server and the clients will be iOS app, Android App Pokki etc.
i am not a hardcore programmer, although it has been more then 1 year since i started using PHP, and i do understand it to my use. i would like to know the best feasible solution on how to share the data among the different clients(POKKI, iOS App, Android App).
i would like to know.
a) do i have to connect to database directly from the client and access the data? is it possible? is it bad if i go this way?
b) do i have to create a public class with api sign up process? what would be the real scenario if i would like it to make it cross platform.
A Humble request to all of you to guide me on how does this things works. any articles, resources, links that can prove useful to me will also be appreciated.
thank you.
I think you should create an API which allows you to access the database strictly as you want it. Look at the twitter API for example and see how it allows third parties to access their data using simple requests.
So your site uses the DB directly where as all other applications you want to make will use the API ( which runs on ur web server)
This would allow you with the flexibility to have control who gets access and who doesnt ( only your own apps or even third parties etc etc) and allows you to build kick-ass applications without putting your actual database at risk.
Hope this helps!
1 - you should not allow client to access data directly - bad.
2 - sign up are easy with open id, let google or any other openid provider handle authentication, you deal with your own clean code without worrying about auth.
http://code.google.com/apis/accounts/docs/OpenID.html
You can create xml api and share the data from your server.
On different type of client you can eaisly parse the xml data and process it or show it.
In xml API if you want the restrict access then your can provide the restriction.
Please let me know if you have any issue
Thanks and Regards,
Ankur K Singh
take a look into getfrapi.com for building API.

salesforce.com plugin for website

There is a company that uses salesforce software to keep track of all customers and the performance of the employees. I am building a points website, which is about the manager rewarding points to employees for a job well done. I want to integrate the info from salesforce software database about the employees and present it on my website so that the manager can see the number of deals closed by each employee and accordingly allocate points to that person. is there any kind of a plug-in or something like that? if not, how can i achieve this? My website is a cms, built on php.
Thanks.
The best way to handle this situation is to import the enterprise or partner WSDL into your PHP CMS. This will enable you to make webservice calls to Salesforce.com and access almost all of the data sitting on the Salesforce.com server.
It'll also enable you to write back to Salesforce.com servers. There is very good documentation and code samples out there try this link first:
http://wiki.developerforce.com/index.php/Web_Services_API#PHP
Hope this helps!
Check out the PHP Toolkit, which is a PHP wrapper around the salesforce API.
Be aware, there are some quirks and it's some bulky functionality. Salesforce limits the amount of hits you can have on the webservice, so you may need to do a cron-based "grab" of info and store to your site at various intervals. You'll get a rude awakening when you're testing and run out of connections for the day (not applicable to people who pay the premium level of Salesforce) It's also rather slow and has a propensity to timeout often....so be prepared to write code to handle the exceptions that will be caused.
Your server will need to have CURL installed and properly functioning.
Good luck!

how can i call from my website to mobile or landline phones. (in PHP,Flash, ..)

I wish to call from mywebsite to mobile phone, how do i implement in PHP or Flash.
Is it possible in PHP, flash, or any other technologies.
I'd take a look at Ribbit - http://www.ribbit.com/
I'm not sure exactly what your requirements are but they have an API that will let you make a call from Flash through their system.
They've got both PHP and Flash APIs - http://developer.ribbit.com/
=Ryan ryan#adobe.com
In order to place a call on a phone from a computer, you either need to:
have a duplex modem installed on the server
use a service with an API allowing to place calls
The first option in this case is impractical as it would only mean that you would only be able to place one call at the time. (Well, if you have X modems, each with its own line, you'll be able to place X simultaneous calls)
Therefore, you need to connect to a service providing an API to place calls. Such services isn't free and charge per call. Examples: Skype, Twilio.
I have no experience with the second option and therefore cannot give you further input on the subject. Do some research and choose a service which fits your needs.
Your best bet is to look at an API for VOIP. There is an API for Skype https://developer.skype.com/ which might be a good solution. Andrew is right about using a modem, it isn't going to scale very well.

Categories