SitePoint Sponsor |
|
User Tag List
Results 1 to 25 of 112
Thread: Zend Framework
Hybrid View
-
Mar 4, 2006, 13:44 #1
- Join Date
- May 2005
- Location
- Finland
- Posts
- 608
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Zend Framework
I thought a thread of its own would be in order.
Zend Framework Website Launches
We are glad to finally unveil the Zend Framework project. We have worked hard in the past few months with our partners and the community to get to this stage. We believe the Zend Framework can already be of great use to PHP developers, although we still have a lot of work ahead of us.
This site will be the home to project related information such as downloads, the manual, and project updates. We will also put up instructions next week for how to access the Subversion repository so that you can play around with code as it's being developed (for better or for worse).
The first preview release of the Zend Framework is available for download.- Zend
- Zend_Db
- Zend_Feed
- Zend_HttpClient
- Zend_InputFilter
- Zend_Json
- Zend_Log
- Zend_Mail
- Zend_Mime
- Zend_Pdf
- Zend_Search
- Zend_Service
- Zend_View
Check out some snippets from the included manual:
Zend_Db_DataObjectPHP Code:require_once('ZActiveRecord/ZActiveRecord.php');
// Create a ZDBAdapter for ZActiveRecordBase.
$db = new ZDBAdapterMySQL(array('host' => 'localhost',
'username' => 'user',
'password' => 'password',
'database' => 'test'));
ZActiveRecord::setDatabaseAdapter($db);
class Person extends Zend_Db_DataObject {}
/**
* Calling the save() method will successfully INSERT
* this $person into the database table.
*/
$person = new Person();
$person->nameFirst = 'Andi';
$person->nameLast = 'Gutmans';
$person->favoriteColor = 'blue';
$person->save();
PHP Code:require_once 'Zend/Db.php';
$params = array (
'adapter' => 'pdoMysql',
'host' => '127.0.0.1',
'username' => 'malory',
'password' => '******',
'dbname' => 'camelot'
);
$db = Zend_Db::factory($params);
$select = $db->select();
// $select is now a Zend_Db_Select_PdoMysql object
// SELECT *
// FROM round_table
// WHERE noble_title = "Sir"
// ORDER BY first_name
// LIMIT 10 OFFSET 20
//
// you can use an iterative style...
$select->from('round_table', '*');
$select->where('noble_title = ?', 'Sir');
$select->order('first_name');
$select->limit(10,20);
// ...or a "fluent" style:
$select->from('round_table', '*')
->where('noble_title = ?', 'Sir')
->order('first_name')
->limit(10,20);
// regardless, fetch the results
$sql = $select->__toString();
$result = $db->fetchAll($sql);
// alternatively, you can pass the $select object itself;
// Zend_Db_Adapter is smart enough to call __toString() on the
// Zend_Db_Select objects to get the query string.
$result = $db->fetchAll($select);
PHP Code:// Retrieve a value:
$phpNative = Zend_Json::decode($encodedValue);
// Encode it to return to the client:
$json = Zend_Json::encode($phpNative);
PHP Code:require_once 'Zend/Mail.php';
$mail = new Zend_Mail();
$mail->setBodyText('This is the text of the mail.');
$mail->setFrom('somebody@example.com', 'Some Sender');
$mail->addTo('somebody_else@example.com', 'Some Recipient');
$mail->setSubject('TestSubject');
$mail->send();
PHP Code:require_once 'Zend/Service/Rest.php';
try {
$rest = new Zend_Service_Rest();
$rest->setURI('http://example.org');
// Returns a Zend_HttpClient_Response Object
$response = $rest->restGet('/services/rest', 'foo=bar&baz=bat');
if ($response->isSuccessful()) {
echo $response->getBody();
} else {
echo '<p>An error occurred</p>';
}
} catch (Zend_Exception $e) {
echo '<p>An error occurred (' .$e->getMessage(). ')<p>';
}
-
Mar 4, 2006, 13:53 #2
- Join Date
- May 2005
- Location
- Finland
- Posts
- 608
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
My own thoughts? Interesting. Definitely interesting. Its previewness is rather evident, though. The manual says nothing of Controller, for instance, but the package is still provided with the framework download. There's Zend_Controller, Zend_Controller_Front, Zend_Controller_Dispatcher, Zend_Controller_Router...
-
Mar 4, 2006, 14:06 #3
Hmm...looks like nothing more but a bunch of PHP classes. :-P
-
Mar 4, 2006, 14:17 #4
- Join Date
- Oct 2004
- Location
- Worcester
- Posts
- 138
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I agree that it's interesting. Not sure what happened to "extreme simplicity" though as the front controller at least is pretty standard from what I can tell...
As I said on the other thread, I've played a bit with the Front Controller and it fits together fairly easily (I wrote up my first attempt at www.akrabat.com). The FC is setup by default so that you have a controller class with functions for each action. i.e. http://localhost/blog/view ends up at BlogController::view(). I haven't yet worked out how the Zend_View class fits in though...
It's not a lot different from the way I've been playing with a front controller recently. The question is what do I gain by using the ZF one rather than my own. It's not like there's so much code in a FC that maintenance will be a big issue...
As Selkirk noted, the active record is missing from the download which is a shame as I want to poke around that bit! It's a certainty that I'd rather use someone else's orm because there's more obviously upgrades and enhancements that can be shared.
-
Mar 4, 2006, 14:23 #5
- Join Date
- Sep 2003
- Location
- Glasgow
- Posts
- 1,690
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Ezku
I've only had a quick glance at a few classes so far. InputFilter seems to stack up every validation rule under the sun in separate methods of a single class. Perhaps it would be better to have a look at the Specification pattern, discrete Rule classes and policies.
(PS: Jason's Php Architect's Guide to Design Patterns has a section devoted to this for anyone interested in learning more).
-
Mar 4, 2006, 14:31 #6
ZSearch is quite good so far, indexed 5,200 documents, and seems to be searching fine, thou lacking a cache for the results, which would've been very useful.
-
Mar 4, 2006, 15:03 #7
Anyone else can't get the demos to work?
All web services demos:
Fatal error: Undefined class constant 'HOST_ALLOW_DNS'
Fatal error: Exception thrown without a stack frame in Unknown on line 0
-
Mar 4, 2006, 16:07 #8
- Join Date
- Jul 2002
- Location
- The Netherlands
- Posts
- 954
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by dreaz
In Zend/Uri/Http.php, on line 373, change Zend_InputFilter to Zend_Filter both times, so that the line becomes:
$allow = Zend_Filter::HOST_ALLOW_DNS | Zend_Filter::HOST_ALLOW_LOCAL;
But even so, after that I couldn't get the Zend_Feed object working. Gave me a few other errors.
So far I'm not really impressed with the framework, and it still feels very buggy to me. I couldn't get much working, and even the demos gave problems. But if they work out the problems, it looks to be a really good framework.Dennis Pallett - NoCertainty - My Personal Weblog
The Web Network: ASPit | PHPit | WebDev-Articles
Blogs: TalkFones | Holidayzer | PHPit Blog
-
Mar 4, 2006, 15:16 #9
- Join Date
- Jan 2003
- Posts
- 5,748
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Umm...
Had a look through the download earlier and there is one thing missing from it... Where are the unit tests?
-
Mar 4, 2006, 16:50 #10
Originally Posted by Dr Livingston
Must have slipped by." - Andi Gutmans on the framework mailinglist
-
Mar 4, 2006, 15:20 #11
Kinda disapointed that the put the ZendDBDataObject (thier AR implementation) in the Manual, but didn't put it in the .tar.gz file ;/. Other then that it looks quite nice, much better then your avarage pvp framework.
-
Mar 4, 2006, 15:23 #12
- Join Date
- Nov 2002
- Posts
- 841
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Andi responds about Zend_Db_DataObject on the mailing list:
This is actually some documentation that stuck around from our ActiveRecord implementation. We have currently decided to first focus on table and row gateway modules and re-evaluate whether we need an additional layer on top of that which would be Zend_Db_DataObject.
-
Mar 4, 2006, 16:11 #13
- Join Date
- Oct 2004
- Location
- Worcester
- Posts
- 138
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Update on Andi Gutmen's blog: http://andigutmans.blogspot.com/2006...rk-update.html
-
Mar 4, 2006, 16:35 #14
Originally Posted by akrabat
-
Mar 4, 2006, 17:24 #15
uh, why did they steal Apple's RSS icon? It's not even that they used Apple's icon as influence for theirs... they blatantly stole it (it matches pixel for pixel). It's not as if freely available to use RSS icons are difficult to come across or it's difficult to make you own.
Ok *maybe* that has nothing to do with the framework, but it gives a really bad impression when companies do things like that. I really lost quite a bit of respect for Zend what I saw that.
How is digital theft "in the true PHP spirit"?
On this framework, I'm not quite sure I see how it is any easier to use than existing, more developed PHP frameworks. Though it's only version 0.1.1, so I'll probably hold off too much experimentation and opinion formulation until its a bit more mature (at least version 1.0).
-
Mar 4, 2006, 17:54 #16
- Join Date
- Jan 2003
- Posts
- 5,748
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
> I'm not quite sure I see how it is any easier to use than existing, more developed PHP frameworks.
At the moment nope, I agree with you, but that isn't the issue, is it? What other PHP framework has the Zend name attached to it?
From a business point of view, considering that how far Zend has come, and importantly, where they're going, the framework in time will not so much carry it's self, but the brand will; That is how I look at it anyways.
Something else to do forget is the kind of influence that Zend can put across to get the right kind of people to develop and continue to develop the framework, when push comes to shove
There is power in influence as the saying goes. Individuals, businesses, even goverments have fallen simply because of influence.
-
Mar 5, 2006, 05:36 #17
- Join Date
- Mar 2004
- Location
- Grand Junction, CO
- Posts
- 292
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by Dr Livingston
-
Mar 4, 2006, 22:13 #18
- Join Date
- Apr 2002
- Posts
- 281
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
pretty good,
if anything it will attract developers from java and .net to php.
Will I use it? if I get bored one day yes, but I already have some of these classes done myself so I don't really feel like setting up the whole thing especially on a host.
-
Mar 5, 2006, 01:58 #19ncarlson.net - a programmer's dystopia
-
Mar 5, 2006, 02:52 #20
Originally Posted by optimus prime
-
Mar 5, 2006, 12:58 #21
- Join Date
- Mar 2004
- Location
- Shorewood, IL
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by thr
Without knowing who or what is backing CakePHP you are a little out of place with this comment.
Originally Posted by Dr Livingston
While I do not agree with using the POS comment above, I will take that wager with you, contact me and we will make one.
I can guarantee you that CakePHP will be around much longer then some here think. Our community grows daily as can be seen on the google groups site which as of this post is sitting around 1020 (http://groups.google.com/group/cake-php/about)
We will have our first stable release within the next week if we do not have anymore bug reports, then our roadmap takes us to 1.0.
And it is obvious people are downloading the framework (http://cakeforge.org/frs/?group_id=23&release_id=65)
Also many large corporations are adopting CakePHP as their PHP framework of choice. So you can attempt to push us aside all you want, but we will continue to support the community that has been supporting us.
No big hype with our project, we let it speak for itself.
-
Mar 5, 2006, 13:05 #22
Originally Posted by 1PhpNut
Originally Posted by 1PhpNut
-
Mar 5, 2006, 03:29 #23
- Join Date
- Oct 2004
- Location
- Worcester
- Posts
- 138
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by optimus prime
So far, I'm quite impressed with the way the mailing list is developing as it is looking like a community might develop nicely.
The decision to start with Table and Row Gateways is interesting as it leaves it open for putting in a more "complex" orm should you need it.
-
Mar 5, 2006, 03:36 #24
Originally Posted by akrabat
Originally Posted by akrabat
-
Mar 5, 2006, 02:06 #25
- Join Date
- Jan 2003
- Posts
- 5,748
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Wow...
That's very constructive of you to make that comment, not
I certainly can't comment on ZF as it's too early but I would wager a bet that for the long haul, Zends framework has more potential that Cake PHP has.
Bookmarks