Category: Linux

How to declare dependencies and use composer in php

Using Composer: We will now use Composer to install the dependencies of the project. To use Composer in your project, you’ll need one file: composer.json. In this file you will describe the dependencies of your project. So let’s create the file: [code]vim composer.json[/code] Declaring Dependencies: Once you created a composer.json file within your project which …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/05/how-to-declare-dependencies-and-use-composer-in-php/

How To Install and Use Composer on Ubuntu

Introduction Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you. Dependency management Composer is not a package manager. Yes, it deals with “packages” or libraries, but it manages them on a per-project basis, installing …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/04/how-to-install-and-use-composer-on-ubuntu/

Rails 3 GEM to handling where the error has occurred

It’s Better Errors GEM. It will handle the error and we can see exactly where the error has occurred in development machine. GITHUB : https://github.com/charliesome/better_errors Steps to configure in our rails3 application 1.  Install the  gem install airbrake -v ‘3.1.8’ 2. In your Gemfile add group :development do gem “better_errors” end If you would like …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/03/rails-3-better-errors-gem-handling-where-the-error-has-occurred/

How to download file from remote URL in PHP

There are many ways in PHP to download file from the remote server. We can use php functions like copy, file_get_content, fopen, fsockopen & Curl to download the remote files. For your reference here I have explained about copy, fopen and Curl method, I have choosen these methods based on simplify and easily everyone can …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/03/how-to-download-file-from-remote-url-in-php/

Use Number() instead of parseInt() in javascript

Recently I came across the issue in converting string to integer in Javascript(JS). I was used parseInt() method to convert string value into integer value. unfortunately, I was faced issue in chrome browser but all other browsers like firefox, ie and safari are worked fine. Its too hard time for me to find out the …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/01/use-number-instead-of-parseint-in-javascript/

Serailization & Unserialization in PHP

Serialization which help us to store or transport PHP data structure such as an array or object. All the storage meduim or database can store String type. It will generates a storable representation of a value. This is useful for storing or passing PHP values around without losing their type and structure. Essentially, it takes a …

Continue reading

Permanent link to this article: https://blog.openshell.in/2014/01/serailization-unserialization-in-php/

Stripe Payment Gateway Implementation

Stripe Payment Gateway Implementation: Steps to Implement: Download the stripe package(stripe). Extract that into the web accessible folder. Create an account in stripe using this url: https://manage.stripe.com/login After Created the account get the test secret key and test publishable key from your stripe account using this url: https://manage.stripe.com/account/apikeys Now in config.php file change the “testSecretKey” …

Continue reading

Permanent link to this article: https://blog.openshell.in/2013/10/stripe-payment-gateway-implementation/

YII Upload the file to FTP server

The below function used to upload the local file to remote directory. [php] /** * Upload the file in ftp directory * @param string $localFilePath * @param string $remoteFilePath . * @return boolean */ public function CopyFileToFtpBucketDir($localFilePath, $remoteFilePath) { <strong><em>//Credential are configured in main.php</em></strong> $ftpSource = Yii::app()-&gt;params[‘ftpSource’]; $ftpUserName = Yii::app()-&gt;params[‘ftpUserName’]; $ftpPassword = Yii::app()-&gt;params[‘ftpPassword’]; <em><strong>// set …

Continue reading

Permanent link to this article: https://blog.openshell.in/2013/10/yii-upload-the-file-to-ftp-server/

How to retrieve the last record in each group using mysql

In single SQL query itself we can retrieve the last record in each group. It will help us to perform action better, faster and simpler. In this post I will explain about you how to do it. Here is my table structure for your reference. [sql] desc post_status; +—————-+————-+——+—–+———+—————-+ | Field | Type | Null …

Continue reading

Permanent link to this article: https://blog.openshell.in/2013/10/how-to-retrieve-the-last-record-in-each-group-using-mysql/

How to reset a Magento password using Mysql Server

If you are unable to log in to your magento application? Follow the below steps to reset your magento store password from Mysql server. Step1: Select your database from the Mysqlserver. Step2: Find admin_user table from the selected database. Step3: In that table, edit the user which you want to reset their admin password. Step4: For security …

Continue reading

Permanent link to this article: https://blog.openshell.in/2013/09/how-to-reset-a-magento-password-using-mysql-server/