Posts

Showing posts from July, 2018

Migrate to php7 in Mac os Sierra with Apache Configurations

Image
Mac os Sierra defult comes with Apache as well as php 5.. Fi you want to start apache with defult settings The following articles gives short as well as comprehesive guideline. https://jason.pureconcepts.net/2016/09/install-apache-php-mysql-mac-os-x-sierra/ https://medium.com/@JohnFoderaro/how-to-set-up-apache-in-macos-sierra-10-12-bca5a5dfffba However , I wanted to setup firebase integration with laravel and it requires php 7. ( kreait/firebase-php ^ 4.0 ) You can eassy install php 7 using homebrew. brew tap homebrew/dupes brew tap homebrew/versions brew tap homebrew/homebrew-php brew unlink php56 brew install php70 Thin you can check the version as follows . $ php --version But if you have enabled defult php in Mac Os , you will see  it will return 5.6 In order to chanage this you have to edit the httpd.conf file of apache.  Stop apache -    sudo apachectl stop move to etc/ apache2. -    cd /etc/apache2 backup httpd.con...

Firebase Cloud Functions Triggers with Two varibles

Image
 Although firebase functions document not mentioned about how many varible values can be exhist in firebase onWrite() tirgger , I have used it upto 2 levles without any issue.  For an exaplen in the blow code , I have consider the change in list under the userId ,, The value will be wrriten under the varible of user.  exports.testFunctionName = functions.database.ref('/user-list/{user}/{pushId}').onWrite(( change,context) => {             const original =  change.after.val();             var pushId=context.params.pushId;                 var userId=context.params.user; ...

Covert firebase to Node Express Rest API

Image
 Firbase hosting and functions provide nice solution to develop a REST api .The following video from firebase provide more infromation than our simple REST API. https://www.youtube.com/watch?v=LOeioOKUKI8 I thought of detail the process  in to more depth. First , you need to go to desired folder and install firebase tools. You should have npm for do that. Then create a firebase account and project with desired name. After that, you have to use the command firebase init. The online authentication will be proceed there after .You have to copy and paste the URL displayed in the console to the web browser. Then there we have to create the local project with firebase hosting and firebase functions. In the project you can see the functions folder ,which used to create the functions. In order to use the express, you need to use express npm packge. Move to functions folder and then run npm install express, then firebase-functions. If you are using firebase datab...