How to add OAuth2 Server on a CakePHP 3 plugin - php

I am working on a plugin in CakePHP3 and I need to create a simply Oauth 2.0 Server API that allows to do a simple CRUD on the users' table and create sessions when needed.
I have done some research here in StackOverflow and it seems that the best choice would be
https://github.com/uafrica/oauth-server
Now, I have tried to make it work according to the doc in the repository but since it will be a plugin, not the core of the application I do not understand how it is supposed to work and which file I need to update.
Would somebody be so kind to give me the list of steps I need to follow and the actual files that need to be updated?
Many Thanks in advance

The uafrica/oauth-server project is woefully out of date. It requires v4.1 of league/oauth2-server, which is now currently at v7.2. Version 5 of that project was completely rewritten and is not backwards compatible with v4.x.
I don't think there's an out-of-the-box CakePHP 3 plugin that works with the current version of league/oauth2-server.
You'll have to either build your own plugin from scratch, or try to hack the uafrica/oauth-server project to get it work with league/oauth2-server.

Related

Social Engine Customization

We(small group) have a SocialEngine based project and we made lots and lots of changes in 4.6.0 version including core modules, now we struggle to update to 4.8.0 which is a pain in the ass so question:
Which logic to implement in new version of social engine where will be stored our modified code that will help for future update?
We are trying using Decorator Pattern, creating another folder(modules2) for example there creating clones of modules and using only modified files(which is currently unsuccessfully).
You can to compare your files with the latest upgrade package files with Softwares like WinMerge and copy new changes in SocialEngine core to your modified files. Don't forget the database queries in application/MODULE_NAME/settings/my-upgrade sql file of each module. It's gonna take time but I don't think there's any easier solutions.
See, thats where git or subversion comes handy , you exactly know where the code is changed .

Is it possible to put Laravel framework inside Yii?

I already built a web application using Yii and my client gave me a white labeled application that is built using Laravel 5. I wanted to convert the Laravel codes into Yii codes but it is very difficult, though it is possible(maybe), but it will take too long.
I was thinking that maybe it will be good if I install Laravel inside Yii framework. Is that possible? if not maybe you have suggestions?
Your help will be greatly appreciated!
Thanks! :)
Both frameworks depending on the database tables so you can integrate both solutions and make database bridge, But there is noway currently to make integration between the router in both framework.
This extension allows running Yii2 and Laravel applications simultaneously at the same project, facilitating graceful migration from Yii2 to Laravel.
This is what you need mate Link

Laravel 5 and Quickbooks

I'm trying to integrate the Quickbooks Online API into Laravel 5. I've got the code working outside of Laravel using the Consolibyte package. But its written in what I'll call a classic PHP style - meaning there are a number of REQUIRE_ONCE files etc. I'm sure I can crank through and integrate it all, but in the interest of saving time, I'm wondering if anyone else knows of a package for Laravel 5 which already does this?
Ultimately I need to be able to create Customers, Vendors and Invoices. Don't really need the rest of the functionality that the Consolibyte package uses (which is a great package by the way).
If you're using this code:
https://github.com/consolibyte/quickbooks-php
You only need to require one file. There's no real work required to get this working in Laravel. Just do this in your Laravel app:
require_once './QuickBooks.php';
And you're done.
For anyone else looking to solve this problem, this obscure blog post will save your life. It's a lot to post here, but he essentially uses the consolibyte/quickbooks-php, but wraps it up in creamy Laravel goodness so you can see the "under the hood" objects you need to set up so that you don't break the framework.
I followed the instructions, with some alterations for my app, and it authorized first try (Laravel 5.2).
It's not perfect, but it's as clean as you can get for Laravel right now.
Major props to both the article writer Pawan and the package author Keith Palmer Jr!
You can use this one instead its fully enabled to be installed by composer in Laravel or Yii2. I installed it in Yii2.
https://github.com/beanworks/quickbooks-online-v3-sdk install quickbooks from this url and then use the below url to implement oauth
https://github.com/IntuitDeveloper/oauth-php
You can easily make routes for oauth steps involved and there are samples in the later repo which can be used to learn how to post and query objects from quickbook.

Laravel 4 plug-in system

I looking for some plugin structure for Laravel based applications.
For example a forum software, a cms or a e-commerce application can benefit from a plugin structure.
My question is what is the best way to implement this plugin system so that third party plugins can extend the application. The main issue is that it should be dynamically extendible and users should be able to install these plugins easily without messing with the app code.
This question also extends to themes but thats another question. Any ideas?
Laravel is a framework, not a CMS like Wordpress or Joomla, so plugin system that fits everybody may be quite hard to create as Laravel can be used in many ways, but I can really see the benefit of easy packages in some contexts.
The Packagist has been already mentioned and it doesn't solve directly your problem but how about:
Find good usable packages from Packagist for the purposes you need
Define common plugin architecture (common API for binding things together, installer, package format, migration, updates etc) on top of Packagist packages
Create installer that fetches packages via Packagist/Composer and adds sets sane default settings and configuration for the packages and integrates them into the defined plugin architecture
Document and plan this really well and the others will soon follow
I'm a little confused about the question, but I believe what you are looking for is already implemented in Laravel 4. They are just called Packages, and can be found at http://www.packagist.org and easily installed and autoloaded into your application using Composer.

Will be there issues when upgrading from Kohana3?

I would like to know about the compatibility between upcoming versions of KO3. I have heard that once 3.1 comes in, it won't be easy to simply upgrade to it from kohana 3.0 (Wordpress upgrade is pretty swift from 2 to version 3)
If I create my project in KO3 (currently using 3.0.6.2), what are the chances that my project will be easily upgradable to 3.1 or above versions without breaking anything ?
Please answer if you are a real pro on KO3 or part of the development team.. This is important.
Major versions (eg: 3.0 to 3.1) may change the API. Currently, the biggest API change will be splitting the Request class into Request and Response, as well as changes to Request that allow external routing. This also implies that the Remote class will be significantly modified to removed completely in favor of external requests and responses.
You can keep track of the changes scheduled for 3.1 by following the 3.1 roadmap.
I'd just like to point out that wordpress is an entirely different system, it's basically an application written on their own framework whereas kohana is just the framework and you supply the application.
If the wordpress core framework changes then they also change their application to account for those modifications. Sometimes plugins aren't compatible across upgrades so the plugin author has to release an update which makes it compatible. All of this is hidden from the front end users, they don't need to be aware of how it works in order to use it.
Kohana on the other hand has no gui or front end, you're getting nitty gritty with the code. If an interface changes then you'll have to adapt your implementation to suit, there's no way around that.
And as antpaw said, unit tests are always useful for making sure things work as expected! For more info see the unittest repo
it highly depends on the features your have used. give it a try and watch your logs or even better: you run unittests. http://github.com/kohana/core/compare/3.1...master if i picked the right repository. this will help you to see the difference betwenn ko3.1 and ko3.0.7

Categories