Showing posts with label symfony. Show all posts
Showing posts with label symfony. Show all posts

Tuesday, April 6, 2010

Next Gen PHP frameworks

With the release of PHP 5.3, PHP released the most significant capabilities in years. Specifically the addition of Late Static Bindings, Lambda Functions and Closures, and Namespaces has changed everything. These new features open new doors for solutions previously impossible. As a result in recent months there has been a flood of new frameworks and libraries taking advantage of these new features. Effectively we are approaching the third wave of PHP frameworks.

The first wave included Seagull and Zoop Frameworks back before frameworks became a buzz word.

The second wave followed the massive buzz factory Ruby on Rails generated. CakePHP, Symfony, Zend and a slew of others followed. These frameworks were developed after PHP 5 became standard and took advantage of the new OO features provided.

This third wave is largely due to the release of PHP 5.3 and all the new languages features and structures that accompanied it.

The space is really heating up. Here’s what’s happening…

Zend Framework just announced a fork for ZF 2.0 strictly 5.3 and above.

The former lead developer of Cake PHP has started a new framework for 5.3 and above called Lithium.

Doctrine 2.0 is in the works and is 5.3+. It is a significant upgrade from the 1.0 branch and takes advantage of the features provided in PHP 5.3.

Zoop Framework has a stable but not feature complete 2.0 branch which is 5.3 and above.

Symfony just announced their 2.0 alpha release which you guessed it, only runs on 5.3 and above.

Fat-Free Framework is a brand new framework which, as the name indicates, is very VERY light. It is further along in development than all the other frameworks listed (read stable), but also far less ambitious in scope. If you are developing a small application FFF would be a solid choice, though I have doubts that without a lot of external development it would make sense for a large application.

While all these frameworks/libraries are rather early in their development process, many are quite usable and show really smart design. It’s great that the community has embraced this and is willing to re-engineer existing solutions to utilize the benefits of PHP 5.3.

Thursday, November 12, 2009

Doctrine 2.0.0-ALPHA3 Released

The third alpha version of Doctrine 2 released. This release contains over 60 fixes.
Highlights
  • Added functionality to convert a Doctrine 1 schema to Doctrine 2 to help users with upgrading.
  • Work on mapping drivers, exporter drivers and reverse engineering of database schemas.
  • Refactorings to reduce duplicated code and increase efficiency
  • Refactored cache drivers to allow more control over deleting, added namespacing to cache drivers and implemented clear-cache task.



http://www.doctrine-project.org/blog/doctrine-2-0-0-alpha3-released

Saturday, October 3, 2009

Symfony sfGuard Part1

Symfony Version 1.2
sfGuard (Identity management plugin) Version 3.1.3


sfGuard is a Symfony plugin that implements a user management and login system for an application. It supports both groups and individual users.

Installation

symfony plugin:install sfGuardPlugin

symfony propel:build-model
symfony propel:build-sql
symfony propel:build-forms
symfony propel:build-filters


after this please notice that the following tables get created

sf_guard_group
sf_guard_group_permission
sf_guard_permission
sf_guard_remember_key
sf_guard_user
sf_guard_user_group
sf_guard_user_permission



Now enable the modules in settings.yml (this is an optional step) according to the requirement
For eg:

The frontend application may need only sfGuardAuth (only login may be needed to be controled)
The backend may need sfGuardUser, sfGuardGroup, sfGuardPermission (the backend may need to administer groups, permissions and users)

all:
.settings:
enabled_modules: [default, sfGuardGroup, sfGuardUser, sfGuardPermission]

Then clear the cache by
symfony cc

There is an optional feature which u can enable - the remember me filter


Now how we can secure the application

Enable the module sfGuardAuth in settings.yml

all:
.settings:
enabled_modules: [..., sfGuardAuth]

Change the default login and secure modules in settings.yml

login_module: sfGuardAuth
login_action: signin
secure_module: sfGuardAuth
secure_action: secure

Change the parent class in myUser.class.php (app/module/myUser.class.php)

class myUser extends sfGuardSecurityUser
{
}


Now in security.yml add the following asper requirements

is_secure: on

This can be added in a application level or a module level or a page level.

for eg:

if we want to secure the whole application then we can add
default:
is_secure: on
in the security.yml of app/config directory

if we want to secure only a module
all:
is_secure: on
add this to the security.yml in the modules directory

If we need to secure a single file in the app then add the pagename

pagename:
is_secure: off



















Tuesday, September 29, 2009

Symfony 1.2 User sessions and sfGuard

Symfony automatically manages user sessions and is able to keep persistent data between requests for users. It uses the built-in PHP session-handling mechanisms and enhances them to make them more configurable and easier to use.

Symfony's session-handling feature completely masks the client and server storage of the session IDs to the developer. However, if you want to modify the default behaviors of the session-management mechanisms, it is still possible. This is mostly for advanced users.

On the client side, sessions are handled by cookies. The symfony session cookie is called symfony, but you can change its name by editing the factories.yml configuration file, as shown


all:   
  storage:     
    class: sfSessionStorage    
    param:       
      session_name: my_cookie_name

in factories.yml


On the server side, symfony stores user sessions in files by default.

Session expiration occurs automatically after 30 minutes. This default setting can be modified for each environment in the same factories.yml configuration file, but this time in the user factory, as shown

all:   
  user:    
    class:       myUser     
    param:       
      timeout:   1800   # Session life in sec