apprentice (77) [Avatar] Offline
#1
Hi Rob I upgraded my Zend library to 1.8.0 and the book's source codes don't work like they used to anymore.

C:Websitesplaceslibraryend

The upgrade made the database links to London Zoo not function anymore.

http://ch04.local/place/index/id/1
http://pastebin.com/m28bedd91



I could make it work again by removing 1.8.0 and replace it with version 1.7.1, that would definitely solve the problem. But I'd like to see this as an opportunity for simulating the scenario of upgrading Zend.



Unfortunately I always fail at following instructions no matter how well written they are, could you help me with my shortcomings?
http://akrabat.com/2009/04/30/zend_loaders-autoloader_deprecated-in-zend-framework-18/

* I disabled line 14 and 15.
* And replaced it with lines 18 - 22.
* Line 20, I don't really understand what I should replace 'App_' with?

C:Websitesplacesapplicationbootstrap.php
http://pastebin.com/m728a635f
apprentice (77) [Avatar] Offline
#2
Re: Chapter 4 - How do you upgrade from 1.7.1 to 1.8.0?
So I realised that there's more things in play before you can make the old 1.7.1 application work with 1.8.0. I'm comparing the Akrabat Album Tutorial with the book's Places application to understand what one will have to change to adapt to 1.8.0.

1.8.0 - Album Tutorial
* 1 - application.ini
* 2 - Bootstrap.php
* 3 - Albums.php
* 4 - .htaccess
* 5 - index.php

1.7.1 - Chapter 4 Places application
* 1 - config.ini
* 2 - bootstrap.php
* 3 - All the Models and Class files needs editing.
* 4 - .htaccess
* 5 - index.php

________________________________________________


1.7.1 - Chapter 4 Places application

* 1
I'm guessing I can leave config.ini as it is without editing anything?

* 2
Trying to adapt the bootstrap.php file to 1.8.0 is the most confusing for me right now.
Which parts of this file is no longer neccessary and which parts do I need to keep?

C:Websitesplacesapplicationootstrap.php
http://pastebin.com/m5b016921

How much of this Akrabat Albums tutorial can I copy into Places application?

CWebsitesakrabatapplicationBootstrap.php
http://pastebin.com/m2dd90dd5
akrabat (479) [Avatar] Offline
#3
Re: Chapter 4 - How do you upgrade from 1.7.1 to 1.8.0?
Don't forget that you don't have to use Zend_Application smilie

If I was doing it, I would start with a new zf create project and then add in the Places stuff from there.


Regards,

Rob...
apprentice (77) [Avatar] Offline
#4
Re: Chapter 4 - How do you upgrade from 1.7.1 to 1.8.0?
That's sounds doable, a lot of work but still doable if you have the patience. The book's source codes uses registry quite a lot.
Do I still use it like you describe in the book or do I have to do it in some new way since 1.8.0?

C:Websitesplacesapplicationootstrap.php
http://pastebin.com/m5b016921
__________________________________________________

// configure database and store to the registery

$db = Zend_Db::factory($config->db);
Zend_Db_Table_Abstract::setDefaultAdapter($db);
Zend_Registry::set('db', $db);
__________________________________________________




Can I just copy and paste the above registry code snippet into the new 1.8.0 Akrabat Tutorial Bootstrapper or is this done differently now since Zend did the upgrade?

CWebsitesakrabatapplicationBootstrap.php
http://pastebin.com/m2dd90dd5
akrabat (479) [Avatar] Offline
#5
Re: Chapter 4 - How do you upgrade from 1.7.1 to 1.8.0?
apprentice (77) [Avatar] Offline
#6
Re: Chapter 4 - How do you upgrade from 1.7.1 to 1.8.0?
.


I feel like Zend Framework as a whole makes more sense now, after having read the new 1.8.0 official Quickstart. Than when I read the official Quickstart a year earlier.
http://framework.zend.com/docs/quickstart/create-your-project

But it helps a lot if you have done the new 1.8.0 Akrabat tutorial before you head over to official Quickstart.
http://akrabat.com/zend-framework-tutorial/


Reading suggestion:

1. Akrabat 1.8.0 tutorial first.
2. Then official 1.8.0 Quickstart.


You could do it in the reverse order also, if you like to torture yourself. smilie
Zend Developers great coders but still dangerous<sub>18</sub> writers.

[pre]
18. Murphy's Law: "If there are two or more ways to do something, and one
of those ways can result in a catastrophe, then someone will do it."
[/pre]

.
jrsanfilippo (6) [Avatar] Offline
#7
Re: Chapter 4 - How do you upgrade from 1.7.1 to 1.8.0? - [SOLVED]
Hi,
Where you able to upgrade the entire Places app in 1.8.0? I am having trouble with the Acl. I am hoping that you successfully upgraded that as well. Please feel free to email me at jrsanfilippo@yahoo.com

Regards,
John
apprentice (77) [Avatar] Offline
#8
Re: Chapter 4 - How do you upgrade from 1.7.1 to 1.8.0? - [SOLVED]
Hi jrsanfilippo I didn't really bother with reverse engineering the Places application it felt like too much work for someone as inexperienced as me. Instead I took a detour to the so called "1.8.0 Quickstart guide from Zend" and studied their stuff which was a waste of time. smilie
http://framework.zend.com/docs/quickstart/introduction

They describe things like crap, and use a database that most newbies will never use, and they use a Data Mapper pattern which according to some old timers is over the top for simple storing of text and images. And the author of that guide never checked it for bugs and corrected things.

That guide is one big cake of:
[pre]
iterate this indefinitely {
Overcomplification on top of, Overcomplification on top of, Overcomplification
}
[/pre]

_____________________________________________________


Now I'm just basing all my studies and experiments on Rob's new 1.8.0 Akrabat tutorial, it's sleek and elegant.
http://akrabat.com/zend-framework-tutorial/

And use the ZFiA book as reference trying to put selected components described in the book into the Album app. I just use the old source code examples from Places app as a looksie. Building from scratch like Rob said earlier is easier I think.

_____________________________________________________


I've skimmed through the ACL chapter some months ago but didn't play with it in detail. So I can't help you with your ACL problems, sorry.
I've been stuck for months working with how to control the Database and Zend_Form parts. Those 2 take forever to master personally speaking smilie
jrsanfilippo (6) [Avatar] Offline
#9
Re: Chapter 4 - How do you upgrade from 1.7.1 to 1.8.0? - [SOLVED]
Thanks for the response. I was worried that no one would ... I do not feel so dumb now understanding that this is not as trivial to others.

Regards,
John