I have a fresh version of CI running and I've installed the codeigniter-oauth2 spark via bash on my Ubuntu instances on EC2.
I followed the directions of the documentation and created a controller called auth using the demo code.
I have looked in my sparks folder and all the correct files/folders are there (as well as the /0.4.0 folder).
I have added the Facebook
My autoloads file has this
$autoload['libraries'] = array('session','OAuth2');
Now when I open the page mydomain.com/auth/sessions/facebook I get the error
"Unable to load the requested class: oauth2"
I can't seem to find any other assistance online regarding this issue online. I don't think it's an issue of not having the right case as I have tried all different ways of writing it.
Any direction to fix this issues would be greatly appreciated.
Use lower case when loading libraries.
$autoload['libraries'] = array('session','oauth2');
$autoload['sparks'] = array('OAuth2/0.4.0');
Related
Here's the code, https://github.com/google/google-api-php-client/
Here's the file that's missing, https://github.com/google/google-api-php-client/blob/master/src/Google/autoload.php
I know it's possible to create this file with composer, but was just wondering if anyone has it available.
I'm also concerned that this alone might not make the software work, as I've tried to do it the manual way and the Class it can't reference is "GuzzleHttp\Collection" which is accessed in PHP with "use GuzzleHttp\Collection". I don't know how adding "autoload.php" will help referencing a file that's not part of the "google-api-php-client".
Does anyone actually have this software working in PHP, it says Beta?
I found it using Google Cache,
http://webcache.googleusercontent.com/search?q=cache:992oyuQ76a0J:https://github.com/google/google-api-php-client/blob/master/src/Google/autoload.php+&cd=1&hl=en&ct=clnk&gl=us
This file should be load from vendor directory
// include your composer dependencies
require_once 'vendor/autoload.php';
I started studying CodeIgniter Web Framework and I am trying to work with PHPStorm 8.0.3 on Kubuntu 14.04. When I unzip CodeIgniter downloaded archive to root Apache folder /var/www/html and go to
localhost/index.php
then it works okay and I see "Welcome to CodeIgniter!" page. Also I
can use
localhost/index.php/welcome/index
and see the same page as it should be.
When I created a new PHP project in PHPStorm and try
localhost:63342/codeignitor/index.php/
then I see welcome page, but if I use
localhost:63342/codeignitor/index.php/welcome/index
then I get 404 page. Also all my own controllers are not available and
cause 404.
I can call my own controller only if I make it default
$route['default_controller'] = 'mycontroller';
I think that this problem occurs because the URL contains name of my project /codeignitor/, but I'm not sure about it. So I need your advice how to set CodeIgniter environment in PHPStorm correctly to solve this problem. Thank you!
Codeigniter uses the URL to determine routing, therefore /codeigniter/index.php/welcome/index and /index.php/welcome/index are not equal paths. I would recommend using one or the other, and adjusting your /index.php and /config/routes.php to accommodate for your desired path.
References:
Codeigniter Subfolder
https://www.codeigniter.com/user_guide/general/urls.html
https://www.codeigniter.com/user_guide/general/routing.html
https://www.codeigniter.com/user_guide/general/environments.html
I am new to Symfony. I am trying to use a pre existing library that I have used for my Payment Gateway API, with Symfony (v2.3).
Before using Symfony I would have a composer.json file in the root directory and I would simply use PHP require 'vendor/Braintree.... However with Symfony I am having a really difficult time using the library for payment gateway API by importing it to my Controller.
Note: I am using an Entity in the same controller as follows, which has a similar directory structure and works great:
use Jets\JetsBundle\Entity\Company;
This is what I tried to use the payment gateway API:
use Jets\JetsBundle\Braintree\braintree\braintree_php\lib\Braintree;
and the Braintree.php contains:
namespace Widb\WidbBundle\Braintree\braintree\braintree_php\lib;
I keep getting the following error:
FatalErrorException: Error: Class 'Jets\JetsBundle\Controller\Braintree_Configuration' not found in C:\xampp\htdocs\www\symfony\src\Jets\JetsBundle\Controller\DefaultController.php line 239
And the DefaultController.php Line 239 contains:
Braintree_Configuration::environment('sandbox');
As a side note, I didn't do anything other than drag / drop the ready configured library directory from my old server to the Symfony directory on the new server. Am I missing some configuration script or cmd set up or something?
I appreciate any assistance in this regard. I will forever be grateful is someone can help me troubleshoot this.
Here is my DefaultController.php code:
http://pastebin.com/kwisEBzL
Many thanks in advance!
This Braintree project seems to be PSR-0, so you should be able to use it pretty easily.
Don't do this:
use Jets\JetsBundle\Braintree\braintree\braintree_php\lib\Braintree;
There is no such namespace.
Include the Braintree project using Composer (notice they have the PSR-0 autoloading config already: https://github.com/braintree/braintree_php/blob/master/composer.json).
EDIT: add this to your composer.json and don't forget to run composer update (or php composer.phar update)
Update 2: As pointed out in the comments, it is a good idea to use a stable tag/branch. That way, if there are breaking changes, you can make sure to fix them before updating. So always check the version of the library (2.23 may not be the latest version any more).
"require": {
...
"braintree/braintree_php": "~2.23"
},
The autoloader should pickup all of the classes if you use the global namespace (notice the leading slash):
\Braintree_Configuration::environment('sandbox');
Let me know if this works.
Side note, you should probably create a bundle that does the configuration for you in a centralized place.
You really missed out one of the first comments.. which was spot on and will most likely take away alot of headaches.
Follow the instructions given at https://github.com/cometcult/CometCultBraintreeBundle, this is a bundle that provides "Braintree". A bundle in this case actually is a "module" you can hook in, and configure by configuration files.
Relevant commands that are missing for handling composer:
http://getcomposer.org/doc/03-cli.md#install
http://getcomposer.org/doc/03-cli.md#require
As soon as you have finished it up you should take a look at the bottom two parts, besides conifgurating everything.
$factory = $this->get('comet_cult_braintree.factory');
$customerService = $factory->get('customer');
If you need more help let me know
I'm don't uderstand what you actually try to do in your DefaultController.php, but I have some assumptions.
UPD:
FIRST and SECOND point was deleted.
THIRD:
When you trying to make use Jets\JetsBundle\Braintree\braintree\braintree_php\lib\Braintree; you have load only class Braintree from file Braintree.php. Not whole file with another data like require_once instructions.
FOURTH:
/vendor directory of Symfony2 projects usually contains third-part libs. So you can put your lib here.
Hope some of this points helps you.
P.S. Sorry for poor English.
I've got a clean install of codeigniter running. I need to access a library file diretly, but i get Access forbidden all the time. Is there any way to fix this? can't find anything about this in the config files etc.
you should try using the codeigniter loader class, if i'm understanding the full question here, example below:
$this->load->library('email');
I decided instead of using the migration guide/shell for the upgrade from 1.3 to 2.0 of CakePHP to just go with a vanilla installation of it. For some reason, I'm getting this error:
Fatal error: Class 'Component' not found in /home/bob_cobb/public_html/mydomain.com/lib/Cake/Controller/Component/SessionComponent.php on line 32
When trying to access my website. I looked to see if SessionComponent.php even exists and it doesn't on my server, nor in the 2.0 repository. Do I need to create this file or something? (Edit: The file exists.)
its not about the sessioncomponent but the Component class itself:
App::uses('Component', 'Controller');
This declaration says where to find it. But cake doesnt seem to find it. so it is probably missing.
it should be in /Cake/Controller/
Actually, SessionComponent.php does exist, at least in the official 2.0.6 repository. Your download/upgrade was probably corrupted. Try adding the file to your server. If you're lucky, that's the only issue; more likely, though, you'll need to reupgrade.
I'm not sure where you're looking, but SessionComponent.php does actually exist in the 2.0.x repo:
https://github.com/cakephp/cakephp/blob/master/lib/Cake/Controller/Component/SessionComponent.php
You may want to re-download your whole /lib section if you're missing files.