Jump to content

Overwhelmed With Zend


crwork

Recommended Posts

Learning the MVC framework was painful for me. Eventually, I began to understand it when I built my own site using CodeIgniter. I felt like I understood MVC enough at least on a rudimentary level.

 

But wow, my current project uses elements of Zend and I am totally overwhelmed. It looks like another language to me and the documentation online isn't nearly as clear as for CodeIgniter. I'm sure plenty of people use it and love it, but to me it seems like it's adding another layer of complexity I don't have time to learn. Oh well, job security for a lot of people I guess. :)

 

In any case, just on a basic level, I'm having some trouble finding decent documentation for newbs. I don't need to have a thorough command of Zend to get through my project, but it would be helpful to at least know a few things. If anyone can explain just a few tidbits, I'd appreciate it:

 

1) The Zend Registry: Are these considered session variables? The app I have uses this to set many variables, but if I dump $_SESSION there's nothing there. Are they stored in cookies?

 

2) User Authentication: My app has a function called "gettheUser" that contains this command:

 

$user = Zend_Auth::getInstance()->getIdentity();

 

Since no parameters are being used, how does Zend know where to get the user's identity? Is there a database behind the scenes that automatically handles this?

 

Thanks and apologies for my "duh"-ness.

Edited by crwork
Link to comment
Share on other sites

1) Variables stored in Zend Registry are not persistent throughout HTTP requests. They are not stored in $_SESSION or cookies, it's more of a singletonish pattern.

2) You authenticate the user with Zend_Auth. There's different storage mechanisms, but the default is using $_SESSION or Zend_Auth_Storage_Session. If you don't know if the user has an identity yet, you should probably be using Zend_Auth::getInstance()->hasIdentity() before trying to get the actual user identity.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.