CodeIgniter -- Auth package suggestions? (changed from cakePHP)

Status
Not open for further replies.
See below:

Hi all,

Trying to pick up CakePHP and I've used PHP for quite a long time, but no frameworks at all. I've got a million wheels I reinvented myself. I have a few basic questions!

I have no telnet access to my shared host, I do all my learning on my personal shared host so I have no access to baking or anything automated. That leaves me in a black hole because most CakePHP tutorials (99%) only ever assume you have shell access and provides no alternative to the automation they use.

I want to use CakePHP more for the MVC structure than the automation, at least right now.

I'm looking at Auth and Acl. Every tutorial starts off the same, telnet in and start baking up the controllers, models, etc. Nobody's really explaining what magic happens if you can't telnet. Some tutorials or blog posts are better and give little hints of structure outside "set oven to 350 and bake", but there's no clear picture of a whole system top to bottom that I can find.

I'm confident a lot of this is because I only read the cakePHP manual top to bottom and it left me dry via expecting I'd have a strong grasp on MVC concepts. For instance, some tuts had the MySQL table structures I could copy into my db, but then didn't explain how to set up the Model file (it expected bake would auto-associate). Others would show a Model of their style but no database associated. I didn't have luck mixing the tutorials, stealing SQL structure from one and using it with Models from other tutorials.

In fact I'm still pretty confused on how Models somehow auto-associate with tables and how to even work with data in them haha. And I read the manual! I see $this->data all over the place, but nobody stopping to say "BTW $this->data represents your latest query" or whatever..

Anyone have a great online resource (I'm not book friendly typically) that can explain Acl and Auth?

As much as I understand is I need a aco, aro and aco_aro table to set up a hierarchy of acl permissions and I'd like to do it in crud and based on actions so I can be flexible and assign group permissions and also have per-user control. I know I need users and groups tables with the proper foreign keys to tie them together with Acl. What nobody is really putting forth is a great non-bake tutorial covering all of that.

Anyone a master of this stuff or have a good tutorial reference? TIA!

edit:

For example I'm using these tables for users and groups. These tables for aro/aco/join tables. (See I'm using multiple sites, nothing all in one place). This blog post for a User and Group Model. Any of those sources have varying ways to implement the controller. It all leaves me unaware of the best, or even a good implementation.
 
Having used it yourself, are there any obvious growth drawbacks or limits that the "magic" of the framework comes with that you've found irritating? Cake's drawback so far is really dodgy documentation and lack of complete usable examples for a beginner. It's also heavily dependent on shell access. Those two really stifle early adoption for me.

Anyone use Symfony? I saw it mentioned in this post.
 

blindwaves

Wise, Aged Ars Veteran
135
I have not really played with CakePHP, but I'm surprised that it needs shell access to set it up. The two frameworks I mention does not need shell to set up.

I haven't use CodeIgnitor for a while, but for documentation, CodeIgnitor is the one you want to look at. Kohana's documentation is a bit sparse. I haven't encountered any serious issues with either frameworks.
 

Xavin

Ars Legatus Legionis
30,828
Subscriptor++
I haven't done serious PHP in a while, but you really should switch to a host that gives you shell access. You can get them very cheap ~$5/month.

Personally I have tired of working around shared hosting's limitations and just got a VPS, which are also stupidly cheap compared to what they were a short while ago.

Having used it yourself, are there any obvious growth drawbacks or limits that the "magic" of the framework comes with that you've found irritating? Cake's drawback so far is really dodgy documentation and lack of complete usable examples for a beginner. It's also heavily dependent on shell access. Those two really stifle early adoption for me.
Unless you can't find another option that does what you want, I would stay away from frameworks with bad documentation or an inactive community. That's always a recipe for frustration.
 
Oh, my hosts (site5/hostmonster/etc) do support shell access but it's tedious. I need to fax them my license and wait for them to grant me access. Pretty silly. I'm in the process of doing that but I hate waiting around for nothing.

In cake it magically auto-associates models with tables and I think associating those two parts is a fundamental that should be documented so I can do it myself when cake can't. It does go over models and how to associate hasMany/etc relationships but doesn't explain what the guts of a model actually should be code-wise. It's a black hole.

I have a special hatrid for web-esque documentation. The kind that says the absolute minimum to cover a property or method, has no samples and for every possible opportunity points to another page for more information. That's cake (and most of msdn). I honestly think some of the love for PHP came from its extensive documentation, comments and large effort towards providing self contained working samples.

If anyone has any other preferred frameworks let 'em fly! I haven't seen the latest PHP framework request post in at least 4 days anyhow ;).
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
blindwaves":i9a0683e said:
Erm, well, not really saying this framework is superior or anything, but CodeIgnitor is a popular one that you can take a look at.

Myself, I'm using Kohana. It's a fork of CodeIgnitor, but it is strictly PHP5.
CodeIgniter is awesome. Kohana is only worth it if your time has no value. With no documentation to speak of, it is arguably worse than CakePHP. And CakePHP is pretty poor.

I started my senior project with CodeIgniter, and I'm glad I did. It's about eight thousand lines of my own code (probably fifty thousand all told, when everything's done) and it was close to the sweet spot as far as features versus complexity.
 
I take it you advocate CodeIgniter as well?

One thing I'm going to eventually do in the next 3-4 months is help a friend convert his old perl site into PHP. It has several different services that do varying tasks like parse huge logs, manage streaming dataa, provide an admin, etc.. I'm considering moving him to some kind of PHP framework.

Offhand, I would guess that there's little to no integration between php and perl, but am I wrong on that? And would you all use CodeIgniter for something like that, tieing several different services together to provide varying access level views (anon/user/admin/superadmin/etc)?
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
ominous":c2qden87 said:
I take it you advocate CodeIgniter as well?

One thing I'm going to eventually do in the next 3-4 months is help a friend convert his old perl site into PHP. It has several different services that do varying tasks like parse huge logs, manage streaming dataa, provide an admin, etc.. I'm considering moving him to some kind of PHP framework.

Offhand, I would guess that there's little to no integration between php and perl, but am I wrong on that? And would you all use CodeIgniter for something like that, tieing several different services together to provide varying access level views (anon/user/admin/superadmin/etc)?
I'm no expert with CI (although I am pretty good).
Keep in mind that it is a fairly low-level framework. There are larger ones, such as Zend et al., which offer stuff like auth and ACLs built-in, but CodeIgniter does not: it's essentially limited to the MVC system, database wrappers (actually its one big failing, I'd prefer an ORM like Doctrine built-in), and so on. I implemented my own authentication system because my project has requirements that are very different from most people's (if you've ever used Drupal--picture Organic Groups, on a vastly larger scale), but there are numerous user-built authentication libraries that are pretty good and easy to drop in. (I built mine in about four hours, and can prove its security fairly rigorously. It's not hard.)

Like most frameworks, however, CodeIgniter does assume that you are a fairly skilled developer already, and a lot of it is geared toward somebody who can hit the ground running.
 
I'm pretty weak on patterns but I've been dabbling in code for over a decade, ever since TRS-80. I never got to the hardcore parts of any language, just enough to get what I needed done. Websites I build are generally small and I've only made a handful of RIAs (Flash-based) and small c# apps. No large-scale app development at all. I figured these frameworks should be pretty easy to pick up as long as I know OO.

I don't mind writing my own ACL but Cake supports it built-in and doesn't document it UNLESS you use the auto-magical shell-based scripts to generate it and that's where I'm stuck.

Thanks for info that CI doesn't support ACL/Auth out of the box, that's a consideration.

I always liken PHP to scripting anyhow, not real app programming. It just feels dirty and simple so I never really desired to learn top tier best practices or enterprise patterns. And the flash apps I make have tons of code (15k-20k lines in some) but they're also so small in scope they don't really require it either. But it's time to grow up for me..
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
Internal ACL/auth shouldn't be a consideration. Wiring in Tank Auth or whatever takes maybe twenty minutes? At most? It's not a big deal. And it teaches you a good bit about how CodeIgniter works inside, before you start writing harder code. CodeIgniter works on the principle that it should make as few assumptions about your user-facing logic as possible. Not all web apps require, or benefit from, an authentication system, so it's not included in core. (They violate this slightly by assuming the use of MVC, but for web apps, I can't think of a time where you don't want Controllers and Views--and they make Models optional.)

I have a fairly large amount of experience dealing with PHP, although not as much as a couple other regular posters here. I can say this with some conviction: CakePHP might support everything and the kitchen sink, but it's second only to Zend in how utterly inflexible and cumbersome it is. It's a large system and isn't really very good at any of what it does. "It exists to be frustrating" does not, to me, feel particularly unfair.

ominous":36buug1o said:
I always liken PHP to scripting anyhow, not real app programming.
This is, to be entirely honest, 100% bullshit. There's nothing more "real" about a Flash app (rol) than, oh...Facebook.
 
Oh I imagine the amount of quick and dirty PHP code vastly outweighs large PHP endeavors, I take it you disagree? Now 5.3 supports namespaces, it's beginning to get practical.

And I never said I considered flash a real programming environment haha. Even moreso, I do mostly AS2 work still because a few of our extender tools rely on it. It is utter shit and it is by its own name, a scripting language (ActionScript). AS3 is a huge leap forward over 2 with the first quality debugger but out of the bag you still need to buy software to use it with something like a refactoring engine.

I'll take a look at CI, thanks a bunch for the tips!
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
ominous":3i9j15fr said:
Oh I imagine the amount of quick and dirty PHP code vastly outweighs large PHP endeavors, I take it you disagree? Now 5.3 supports namespaces, it's beginning to get practical.
"Beginning to get practical"? I understand that you don't have a strong grasp of the topic, so I'm not going to go LH317 on your ass, but this is utter fucking horseshit.
 

Xavin

Ars Legatus Legionis
30,828
Subscriptor++
ominous":2h1ks2c9 said:
Oh I imagine the amount of quick and dirty PHP code vastly outweighs large PHP endeavors, I take it you disagree? Now 5.3 supports namespaces, it's beginning to get practical.
Crap code vastly outweighs good code in every single language out there. People have been writing good PHP programs for a long time now.
 
Which is why I didn't bother responding to Blacken00100. Crap code outweighing good code is a guarantee regardless the language but is an actual specialty in languages like PHP. That's not a pop-shot at PHP, which is uniquely designed for the untrained coder to just get the job done as much as the experienced coder to utilize. I merit it for that endeavor and approachability. But it suffers from this just the same when you're trying to find best practices.

Blacken00100, I'm not at all new to programming. From asm x86, c, c++, c#, java, etc I come to the web to try to help a friend who requires the medium of PHP/MySQL/Web. I'm familiar with plenty of app programming but not so much persistentless-web. I'm asking for a decent PHP framework to exist in to start off on the right food while learning the basics withing a month. I'm not asking for your ridiculous behavior of fuck-that mentality. That's not Ars. If you have nothing constructive to add or anything beyond profanity then kindly leave the conversation to those better equipped.
 

crag

Smack-Fu Master, in training
59
CodeIgnitor is where it's at. :) For me anyway.

Cake is huge. And the docs are shit. And didi I mention it's huge.

CodeIgnitor, on the other hand, is fast, small, efficient. It also doesn't force the MVC approach. You don't even have to use OP style for you coding. CodeIgnitor is perfectly happy if you want to use procedure style. You also don't need a command line (though it helps). It's easy to learn and has excellent documentation and community.

And of course, it FREE. lol

You should check it out.
 
I did download it last night and ripped through the first 2 sections. This thing is pretty thin, you're right. It doesn't do much at all in the way of enforcing or automation. It even said Models are optional haha, you can just use controllers and views. At that point I'm thinking where is the framework here? It really just seems like a bunch of directories and suggested places to stick code I otherwise would do anyhow.

I'm brandy brandy new to it so read that with a grain of salt. I installed it on my server and I started with it by looking for an auth package and found Tank Auth. Seems to extend or be based on DX Auth. Anyone familiar with Tank Auth? I uploaded it and rerouted to the controller to start and I get a login prompt right off the bat so obviously it works haha.

Thanks for the advice on CI!

If there's a better auth package someone really likes with CI please let me know!
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
You're really going to go down this road, aren't you?

ominous":976xqwu0 said:
Which is why I didn't bother responding to Blacken00100. Crap code outweighing good code is a guarantee regardless the language but is an actual specialty in languages like PHP.
That's also horseshit. Bad code is no more a "specialty" in PHP than good code. If you're a C or C++ programmer and you've ever worked on a codebase of nontrivial size, you should know how preposterous the claim that bad code is a "specialty" of any one given language or a language with a certain set of features or traits. Bad developers exist. Lol boo hoo. It has nothing to do with the toolchain except for its popularity; when 90% of everything is crap, you get a lot more crap when the set is large.

"Hurr finally beginning to get practical" is complete and total nonsense--as demonstrated by massive, well-behaved, secure PHP projects such as Drupal and high-use web services using a lot of PHP such as Facebook (which uses other code behind the scenes for performance, not due to correctness issues)--and you were called out for your claim being complete and total nonsense. Don't spew that sort of thing and then try to hide behind "oh, that isn't Ars" when you are corrected. Because there's nothing about telling you you're wrong that "isn't Ars" just because you don't like it. And if you want to trot out all your experience and get all high and mighty, especially don't try to get offended when you're called out for saying something completely and utterly inane.

(So this is how LH317 feels. Interesting. Also, paging vherrera0079, vherrera0079 to the thread...)




Now, re: Tank Auth. Tank Auth is a fork of DXAuth and is significantly more featureful, and should work out better for you. The documentation on the CI wiki is a little sparse, but the code itself is straightforward and its exposed interface is relatively simple. There are other options out there, but none are significantly different from Tank Auth. I wrote my own for my latest project not due to concerns of code quality, but more because my requirements differed significantly.
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
ominous":2vlbnef1 said:
Now 5.3 supports namespaces, it's beginning to get practical.

...

Crap code outweighing good code is a guarantee regardless the language but is an actual specialty in languages like PHP.

Did you not notice that this is what I said was horseshit? Here, look at it again:

ominous":2vlbnef1 said:
Now 5.3 supports namespaces, it's beginning to get practical.

...

Crap code outweighing good code is a guarantee regardless the language but is an actual specialty in languages like PHP.

And one more time!

ominous":2vlbnef1 said:
Now 5.3 supports namespaces, it's beginning to get practical. (Lie: it's been used in well-designed, well-behaved web applications since at least 2002 and probably earlier.)

...

Crap code outweighing good code is a guarantee regardless the language but is an actual specialty in languages like PHP. (Lie: it has nothing to do with the language or even the framework around it.)

You're going on about things you don't know about, you got called out, and you're pissy about it. This is a good time to go knock off and come back with an attitude that is less dismissively full of shit about something you don't actually know. Thanks. :)
 
Status
Not open for further replies.