connect Braintree php sdk with yii - php

How can connect Braintree php sdk with yii.I have placed my all sdk files in component folder and calling main file in controller like:
include Yii::app()->basePath.'/components/braintree/lib/Braintree.php';
But this shows error to me include(Braintree_Configuration.php): failed to open stream: No such file or directory.Can anyone help me?

Standard practise to include third party library in Yii (1.x) is to put the code under protected/vendors directory, i.e. protected/vendors/braintree.
Then include this file in your code like this.
Yii::import('application.vendors.*');
require_once('braintree/lib/Braintree.php');
Make sure you have provided read permissions for braintree folder.

Related

Verify email using mailgun api in codeigniter

I used the code in This link
It's showing the error :
"require(vendor/autoload.php): failed to open stream: No such file or directory"
How can I include the autoload.php file? I couldn't find it in mailgun sdk. And should I really use composer (Which I found in many sites to install composer)? I am using Codeigniter framework.
Please help.Can you please tell me how to use this code in CodeIgniter.
Answer is simple; you don't have vendor folder. Click here to learn how to download composer to your server. Then click here to get started.
Once you installed composer, you should add required packages in composer.json and run composer.
Also you don't need to use require. Open application/config/config.php file and find $config['composer_autoload'] variable. Type 'vendor/autoload.php' instead of FALSE.

Install google api php client on Cent OS in php.ini using include_path

I am trying to install and use google-api-php-client in wordpress and my php applications.
I have requested my administrator manager to install it. They have included the following script to php.ini file.
include_path=".;/usr/local/src/google-api-php-client/src"
Now I want to include and use google api in my wordpress application. I created a file called google.php in wordpress root to test this out, In my research I have found now I need to just include this bit of code in php file and everything will be up and running.
require 'Google/Client.php';
require 'vendor/autoload.php';
At the End I get an error like this:
Fatal error: require(): Failed opening required 'Google/Client.php' (include_path='.;/usr/local/src/google-api-php-client/src') in
Could you help me fix this???
You just need to include the autoload.php file. This file takes care of loading the other classes including Google/Client.php. See this link: https://github.com/google/google-api-php-client

How to create path for restservice in codeigniter(rest_controller)

I am trying to create a studentdb in restful service in codeigniter(rest_controller). I had copied files like
Rest_contoller.php in libraries
Format.php in libraries
Rest.php in config and
rest_controller_lang.php in languages-english
when i am trying to check or load file getting error like
{"status":false,"error":"Unknown method"}
I think i forget to do something regarding the path creation. Can someone check it out please?

Yii CDN Asset Management

I am trying to use this extension https://github.com/2amigos/yii-cdn-asset-management-library in order to publish my assets to Amazon S3.
I installed it using Composer and I can confirm that the files are there. According to the documentation, the next step is to modify my Yii configuration file (I modified main.php and console.php) and put the necessary information in the components section. I already did that.
In order to publish the assets, I needed to run the following code:
./yiic S3 --manager=cdnManager publish --userVersionCache=1
However, yiic cannot seem to locate the S3Command.php file. I get no such file or directory errors because of that. Any thoughts on how to proceed?

Problem including a gigya sdk in a cakephp application

I am trying to include gigya php sdk in my application. The file is under /app/vendors/GSSDK.php I included it in my controller as
App::import('Vendor', 'GSSDK');
And in my view
$request = new GSRequest($apiKey,$secretKey,$method);
I get a error missing class GSRequest. I am facing problems including the php sdk.
Make sure you include vendor files into the correct directory /vendors/ or /app/vendors both should work. Try including with different styles as sugguested by book cakephp and remember CASE does matter.

Categories