Is it possible to integrate Neil Crookes' search plugin to cakephp 2.0? - cakephp

I am trying to integrate Neil's search plugin http://www.neilcrookes.com/2009/11/21/cakephp-searchable-plugin to my application but I can't get it to work. Does it work with Cakephp 2.0 and how do I go about doing it?
Thanks,
Lyman

is CakeDCs search plugin not an option? its very sophisticated and works in 2.0.
Ah, I see. The functionality is completely different.
Well, I don't see any 2.0 implementations yet. But you can easily upgrade it using the UpgradeShell.
run "cake upgrade all -p Searchable"

I've made the necessary changes to Jose Gonzalez's fork of Searchable in order to get it compatible with CakePHP 2.0. You can get it here - https://github.com/sc0ttyd/searchable
Remember to check out the 2.0 branch for CakePHP 2.0 compatibility.

Related

Datatable Plugin for CakePHP 4

I have been upgrading my application from cakephp 3 to cakephp 4. I was using fheider/cakephp-datatables and I have come across ypnos-web/cakephp-datatables where both support cakephp 3.
I am currently looking for a cakephp-datatable plugin which supports cakephp 4.
If anybody has an idea, I would be happy.
Thanks in Advance.
Isn't the built-in pagination is what you are looking for ? you can do advanced dynamic database links with your HTML tables.
I successfully use ypnos-web/cakephp-datatables on CakePHP 4.2.7. It works very well for me.
You might have to play around a bit to get it working correctly. Read some of the issues (open and closed) on the ypnos-web/cakephp-datatables github repository and you can likely get it working.
Good Luck!

CakePHP LTS Version Strategy

The CakePHP community has frequent minor release cycles. Can anyone suggest a strategy for selecting an LTS version - specifically a minor version.
Or would the best strategy be to upgrade as frequently as the minor versions are released?
We can assume that the 2.x and 3.x branches get updates for the next few years (i'm not sure, but i think even 1.3 still get security updates if leaks are found)...
So your choice is between 2.x and 3.x where 3.x is cleaner/faster and easier extendible in form of 3th party libraries and 2.x is more wide spread(plugins, tutorials,... ). I would definitely recommend you to go with 3.x due to a higher php version(it's sooo much faster).
Cakephp releases in minor versions (3.0.x) are bug and security fixes. So if you select:
"require": {
"cakephp/cakephp": "3.0.*"
}
you should be just fine for the next few years.
If you than feel like a feature is missing which is present in a newer 3.x release you can always find a migration guide for the newest version in the cookbook: http://book.cakephp.org/3.0/en/appendices/3-0-migration-guide.html as you can see from 2.x to 3.x there are a lot of breaking changes and an update is most likely really time consuming.
In comparison a update from 2.x to 2.6 is less complex as there are primary smaller feature improvements, renaming of functions and stuff like that: http://book.cakephp.org/2.0/en/appendices/2-6-migration-guide.html
CakePHP 3.0.x is the most current branch of CakePHP and if you're starting out with Cake is the best place to start (CakePHP 2.6.x is still being supported for the foreseeable future, but will eventually get dropped).
The recommended way of installing CakePHP is using Composer. If you want to install the current stable release then you want the following in your composer.json file:-
"require": {
"cakephp/cakephp": "3.0.*"
}
This will insure that every time you do a composer update you'll only get bug fixes and minor changes that shouldn't break your app. Ideally you want to ensure your app is bug free so it is a good idea to periodically update Cake with these minor version changes.
When CakePHP 3.1.x is released in the future it is likely to introduce new features that have the potentially to break an app's existing functionality. In this case upgrading needs to be done with caution. You will easily be able to update by modifying your Composer requirement, but the app will need thorough testing. This can potentially be time consuming, so unless you really need the new features is unnecessary.
I would highly recommend CakePHP 3.x if you are starting a new project. However, I was just at the CakePHP Conference in New York and the CakePHP Core Developers indicated they would be supporting 2.x for 2-3 years. That time period greatly hinges upon the community to some degree, they are not just going to stop supporting 2.x. any time soon. They are actually going to backport some of the 3.x features into 2.x. They tentatively plan to Release CakePHP 2.7 and CakePHP 3.1 sometime this summer.
I would also ask have you been using 2.x and what is your comfort level with CakePHP? Depends on the size of the project. I haven't made the jump to 3.x yet, haven't had a new project to try it on yet. I have a ton of code for 2.x like bake scripts and plugins that I have customized, so for profitability on a project I still might consider using 2.x.
There will be some learning with CakePHP 3.x especially if you are coming from 2.x, the ORM is awesome, but it much different than 2.x. So you have to weigh your options. They mentioned tools for upgrading from 2.x to 3.x that might help if you start with 2.x and jump to 3.x later. I don't think at this point I would do that, that is more for people upgrading from 2.x to 3.x. that have existing 2.x projects. I would pick a version and run with it.
The the other answers suggest use composer to install CakePHP. I started using composer about 8 months ago with CakePHP 2.x and love it. With CakePHP 3.x, I recommend using composer, like this if it is installed globally: composer create-project --prefer-dist cakephp/app [app_name]

CakePHP 3 and ACL plug in

I am trying to make a simple ACL using CakePHP 3, and there are no tutorials for it in the cook book (only for cakephp 2 and now acl doesn't exist in cakephp3)
Question 1
I am trying to install the acl plugin from https://github.com/cakephp/acl, how may I do that?
Question 2
Is there any comprehensive and beginner friendly tutorial on how to make an ACL on CakePHP3? I've trying searching everywhere, but found nothing. If anyone could guide me on how to do a simple one it would be much appreciated.
Many thanks
USE cakephp-3acl-example project to creating permission and granding permission for users
https://github.com/mattmemmesheimer/cakephp-3-acl-example
Question 1 I am trying to install the acl plugin from https://github.com/cakephp/acl, how may I do that?
Like any other plugin? See the documentation.
The readme.md itself contains instructions as well but also a warning:
Note: This is a non-stable plugin for CakePHP 3.0 at this time. It is
currently under development and should be considered experimental.
Maybe try it and provide feedback to the developers?
Question 2 Is there any comprehensive and beginner friendly tutorial on how to make an ACL on CakePHP3? I've trying searching everywhere, but found nothing.
If anyone could guide me on how to do a simple one it would be much appreciated.
ACL is always the same, if you know how ACL works you can implement it in any language and framework. If you don't know how, read about how ACL in general works.
But a better idea might to simply use the plugin you already found and help testing and completing it if you encounter issues.
burzum is correct that the installation instructions and documentation are available at https://github.com/cakephp/acl .
I am cutting over from a 1.3 implementation so have not gone through setting up a new acl database.
I have not seen a comprehensive doc on how to setup ACL, the 'short' version I have in my notes is:
1) setup 'Auth' as per the blog example (yes Auth is not ACL but this is what I am using it for)
2) install ACL using composer
3) override 'isAuthorized' in AppController with a check like:
...
use Acl\Controller\Component\AclComponent;
use Cake\Controller\ComponentRegistry;
...
public function isAuthorized($user){
$Collection = new ComponentRegistry();
$acl= new AclComponent($Collection);
$username=$user['username'];
$controller=$this->request->controller;
$action=$this->request->action;
$check=$acl->check($user['username'],"$controller/$action");
return $check;
}
You can follow this plugin.
CakePhp3-AclManager
And the tutorial (step by step) here
If you don't know Japan language, use google translate.
Good luck.

Best way to implement oauth consumer in cakephp 2.0

What is best way to implement oauth consumer in cakephp. Should I write plugin based on oauth.php or is there any other solution?
It depends on what you're going to use OAuth for, but it'll probably be integrated in the application you're developing, so writing a plugin might be the least desirable way to tackle the problem.
There's a third-party Vendor/Component package by cakebaker for Cake, unfortunately it only supports 1.2/1.3 and the 2.0 branch isn't actively worked on at the moment, so it seems. No information on how well it will integrate with the current stable version of Cake.
CakeDC also hosts an OAuth library which might contain the functionality you're looking for. There's also a 2.0 branch which is actively maintained.

Kohana and extJS Project

Currently in the system analysis phase and I am looking at developing a system that uses Kohana for the backend and extjs to display and render my data. How feasible is this? Is it the right approach to start with? Any good tutorials would be welcome.
Thanks
You can definitely use Kohana with ExtJS in your project. Kohana is just a HMVC framework for PHP. The feasibility factor is up to you. How complex your application is? Do you really need ExtJS or Is jQuery UI feasible? etc. You might want to read this post from Kohana forum to decide yourself.
ExtJS community also have a Kohana module (Ext.Direct module). You can download and use it as well if you plan to use Ext.Direct.

Resources