Re: [fw-general] File Upload

2007-02-22 Thread Romeo-Adrian Cioaba

following Michael's sugestion here is what we've come out with.

1. a simple form with a browse button in the template file:








where ___URL___ is your actions URL

2. Register the global $_FILES in the bootstrap


Zend::register('files',$_FILES);



3. the action in the controller:


$files = Zend::registry('files');

// set the path where the file will be uploaded
$target_path = "uploads/";

// get the filename
$pictureThumbnail = basename( $_FILES['pictn']['name']);

// do the magic
copy($files['pictn']['tmp_name'], $target_path . $pictureThumbnail."");



On 2/22/07, Craig Slusher <[EMAIL PROTECTED]> wrote:


Can you show us some code?

On 2/22/07, Romeo-Adrian Cioaba <[EMAIL PROTECTED]> wrote:
> hey,
>
> following that exact page i have tried to make a simple picture upload
> script but with no success.
>
> can someone point me in the right direction?
>
> thanks!
>
>
> On 2/22/07, Craig Slusher <[EMAIL PROTECTED]> wrote:
> > Section 13.2.4 File Uploads
> >
> http://framework.zend.com/manual/en/zend.http.client.advanced.html
> >
> > On 2/22/07, Romeo-Adrian Cioaba < [EMAIL PROTECTED]> wrote:
> > > i'm trying to figure out how to upload a file through Zend
Framework. If
> > > have tryed with no luck to upload using Zend_Http_Client.
> > >
> > > Can anyone give me a practical example?
> > >
> > > Thank You!
> >
> >
> > --
> > Craig Slusher
> > [EMAIL PROTECTED]
> >
>
>
>
> --
> Romeo-Adrian Cioaba
> Phone: +40724185358
> email: [EMAIL PROTECTED]
>
> Disclaimer
> The information in this e-mail is confidential and may be legally
> privileged. It is intended solely for the addressee.  Access to this
e-mail
> by anyone else is unauthorised.  If you are not the intended recipient
> please do not read, print, re-transmit, store, disclose, copy,
distribute or
> act in reliance on it or any attachments.  Instead please e-mail it back
to
> the sender and then immediately permanently delete it.  By opening any
> attachment to this e-mail you are expressly acknowledging that the
> attachment is subject to copyright, and you thereby undertake not to
alter,
> copy, disseminate, re-transmit, rely upon or use the attachment except
as
> expressly authorised by the sender.


--
Craig Slusher
[EMAIL PROTECTED]





--
Romeo-Adrian Cioaba
Phone: +40724185358
email: [EMAIL PROTECTED]

Disclaimer
The information in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee.  Access to this e-mail
by anyone else is unauthorised.  If you are not the intended recipient
please do not read, print, re-transmit, store, disclose, copy, distribute or
act in reliance on it or any attachments.  Instead please e-mail it back to
the sender and then immediately permanently delete it.  By opening any
attachment to this e-mail you are expressly acknowledging that the
attachment is subject to copyright, and you thereby undertake not to alter,
copy, disseminate, re-transmit, rely upon or use the attachment except as
expressly authorised by the sender.


RE: [fw-general] Post-1.0 release schedule

2007-02-22 Thread Bill Karwin
The objective of reaching 1.0 is so that we users of ZF can have some
assurance that interfaces are more stable than they were during preview
releases.  Therefore all component developers will need to pay attention
to backward-compatibility issues.

Regarding release schedule, we haven't decided that yet.  We've been
pushing very hard to reach version 1.0, so that we can get to the state
of stability that I describe above.  A lot of people have been waiting
for that milestone before adopting Zend Framework.

After release 1.0, I assume that releases will be either less frequent,
or else reduced in scope.  I would propose the plan that we continue to
make point-releases (1.0.1, 1.0.2, 1.0.3, etc.) approximately monthly,
but these will contain minor enhancements and bug fixes.  When new
components move from incubator to core, we would increment the "tenths"
number (1.1, 1.2, 1.3, etc.).  In general, I expect these releases to be
about once per quarter.

I think that this schedule is as aggressive as most corporate IT
environments could keep up with.

That doesn't mean we won't still be working hard -- there are a lot of
things we can do for ZF besides developing core technology.  There will
be a great need for writing devzone articles, tutorials, presentations,
sample applications, and other education resources.  These types of
resources are crucial for Zend Framework to gain adoption.

Regards,
Bill Karwin

> -Original Message-
> From: Kevin McArthur [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 22, 2007 10:41 AM
> To: [EMAIL PROTECTED]; fw-general@lists.zend.com
> Subject: Re: [fw-general] Post-1.0 release schedule
> 
> Further, will post 1.0 releases maintain a compatible 
> interface between major versions?
> 
> Kevin
> - Original Message -
> From: "Matthew Ratzloff" <[EMAIL PROTECTED]>
> To: 
> Sent: Thursday, February 22, 2007 11:38 AM
> Subject: [fw-general] Post-1.0 release schedule
> 
> 
> >I guess this is primarily a question for Bill.  Will the 
> post-1.0 release
> > schedule match the pace of the pre-1.0 release schedule?  
> Meaning, once
> > 1.0 is released, will we see 1.1 about a month later?  And 
> 1.2 about a
> > month after that?
> >
> > Just curious,
> >
> > -Matt
> > 
> 
> 


Re: [fw-general] 0.8 and isDispatched() non-object

2007-02-22 Thread Matthew Weier O'Phinney
-- Teemu Valimaki <[EMAIL PROTECTED]> wrote
(on Thursday, 22 February 2007, 08:52 PM +0200):
> great work with 0.8 release!
> 
> I just downloaded it, tried to migrate from 0.7 and now I get the  
> following fatal error "Call to a member function isDispatched() on a  
> non-object in /ZendFramework/library/Zend/Controller/Action.php on  
> line 390". I checked Action.php and there's no such function.
> 
> Documentation does not mention anything new from my bootstrap so could  
> someone give me a hint what could I be doing wrong.

That line reads:

if ($this->getRequest()->isDispatched()) {

My guess is that you're overriding the action controller constructor,
and not setting the request object. Try one of the following:

// to override __construct(), make sure you follow the __construct()
// signature and call the parent constructor:
public function __construct(
Zend_Controller_Request_Abstract $request, 
Zend_Controller_Response_Abstract $response, 
array $invokeArgs = array())
{
parent::construct($request, $response, $invokeArgs);

// do whatever else you need to do
}

// Or, simply rename your __construct() method to init(); init() is
// called by Zend_Controller_Action::__construct() as its last
// action.
public function init()
{
// do what you need to do for object initialization
}

Once one of the above are in place, you should be set.

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


[fw-general] 0.8 and isDispatched() non-object

2007-02-22 Thread Teemu Valimaki

Hi,

great work with 0.8 release!

I just downloaded it, tried to migrate from 0.7 and now I get the  
following fatal error "Call to a member function isDispatched() on a  
non-object in /ZendFramework/library/Zend/Controller/Action.php on  
line 390". I checked Action.php and there's no such function.


Documentation does not mention anything new from my bootstrap so could  
someone give me a hint what could I be doing wrong.


Cheers

--
Teemu Valimaki <[EMAIL PROTECTED]>


Re: [fw-general] File Upload

2007-02-22 Thread Craig Slusher

Can you show us some code?

On 2/22/07, Romeo-Adrian Cioaba <[EMAIL PROTECTED]> wrote:

hey,

following that exact page i have tried to make a simple picture upload
script but with no success.

can someone point me in the right direction?

thanks!


On 2/22/07, Craig Slusher <[EMAIL PROTECTED]> wrote:
> Section 13.2.4 File Uploads
>
http://framework.zend.com/manual/en/zend.http.client.advanced.html
>
> On 2/22/07, Romeo-Adrian Cioaba < [EMAIL PROTECTED]> wrote:
> > i'm trying to figure out how to upload a file through Zend Framework. If
> > have tryed with no luck to upload using Zend_Http_Client.
> >
> > Can anyone give me a practical example?
> >
> > Thank You!
>
>
> --
> Craig Slusher
> [EMAIL PROTECTED]
>



--
Romeo-Adrian Cioaba
Phone: +40724185358
email: [EMAIL PROTECTED]

Disclaimer
The information in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee.  Access to this e-mail
by anyone else is unauthorised.  If you are not the intended recipient
please do not read, print, re-transmit, store, disclose, copy, distribute or
act in reliance on it or any attachments.  Instead please e-mail it back to
the sender and then immediately permanently delete it.  By opening any
attachment to this e-mail you are expressly acknowledging that the
attachment is subject to copyright, and you thereby undertake not to alter,
copy, disseminate, re-transmit, rely upon or use the attachment except as
expressly authorised by the sender.



--
Craig Slusher
[EMAIL PROTECTED]


Re: [fw-general] File Upload

2007-02-22 Thread Michael Baerwolf

I just register the global $_FILES and then call it in the controller
In the bootstrap
Zend::register('files',$_FILES);

Then an action in my image controller

 $files = Zend::registry('files');
 copy($files['image_name']['tmp_name'],		  	 
"/home/users/".$username."/images/".$form_params['image_name']."");


Mike



Romeo-Adrian Cioaba wrote:

hey,

following that exact page i have tried to make a simple picture upload 
script but with no success.


can someone point me in the right direction?

thanks!

On 2/22/07, *Craig Slusher* <[EMAIL PROTECTED] > 
wrote:


Section 13.2.4 File Uploads
http://framework.zend.com/manual/en/zend.http.client.advanced.html

On 2/22/07, Romeo-Adrian Cioaba < [EMAIL PROTECTED]
> wrote:
 > i'm trying to figure out how to upload a file through Zend
Framework. If
 > have tryed with no luck to upload using Zend_Http_Client.
 >
 > Can anyone give me a practical example?
 >
 > Thank You!


--
Craig Slusher
[EMAIL PROTECTED] 




--
Romeo-Adrian Cioaba
Phone: +40724185358
email: [EMAIL PROTECTED] 

Disclaimer
The information in this e-mail is confidential and may be legally 
privileged. It is intended solely for the addressee.  Access to this 
e-mail by anyone else is unauthorised.  If you are not the intended 
recipient please do not read, print, re-transmit, store, disclose, copy, 
distribute or act in reliance on it or any attachments.  Instead please 
e-mail it back to the sender and then immediately permanently delete 
it.  By opening any attachment to this e-mail you are expressly 
acknowledging that the attachment is subject to copyright, and you 
thereby undertake not to alter, copy, disseminate, re-transmit, rely 
upon or use the attachment except as expressly authorised by the sender.


Re: [fw-general] making Zend::loadClass() interface aware

2007-02-22 Thread Matthew Ratzloff
Sounds good to me.

-Matt

> I proposed the following improvement today:
>
> http://framework.zend.com/issues/browse/ZF-937
>
> Basically, I propose having Zend::loadClass() test first with
> class_exists() and then with interface_exists().
>
> The rationale I have for this is that when using Zend::loadClass() with
> spl_autoload() recently, I hit a snag when some parsed code had a
> typehint referencing an interface that had not yet been loaded. Because
> Zend::loadClass() does not load interfaces currently, spl_autoload()
> failed, and a fatal error was raised.
>
> Interestingly, a classfile the class require_once()'d later loaded the
> interface file, but because spl_autoload() tried to load the interface
> before that action occurred, the failure occurred.
>
> The proposed fix is very simple, and makes loadClass() more flexible.
> However, we have already once deprecated loadInterface(), and want to
> hear from you to determine if there are any other concerns with adding
> this functionality.
>
> --
> Matthew Weier O'Phinney
> PHP Developer| [EMAIL PROTECTED]
> Zend - The PHP Company   | http://www.zend.com/
>




Re: [fw-general] Post-1.0 release schedule

2007-02-22 Thread Kevin McArthur
Further, will post 1.0 releases maintain a compatible interface between 
major versions?


Kevin
- Original Message - 
From: "Matthew Ratzloff" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, February 22, 2007 11:38 AM
Subject: [fw-general] Post-1.0 release schedule



I guess this is primarily a question for Bill.  Will the post-1.0 release
schedule match the pace of the pre-1.0 release schedule?  Meaning, once
1.0 is released, will we see 1.1 about a month later?  And 1.2 about a
month after that?

Just curious,

-Matt





[fw-general] Post-1.0 release schedule

2007-02-22 Thread Matthew Ratzloff
I guess this is primarily a question for Bill.  Will the post-1.0 release
schedule match the pace of the pre-1.0 release schedule?  Meaning, once
1.0 is released, will we see 1.1 about a month later?  And 1.2 about a
month after that?

Just curious,

-Matt



Re: [fw-general] File Upload

2007-02-22 Thread Romeo-Adrian Cioaba

hey,

following that exact page i have tried to make a simple picture upload
script but with no success.

can someone point me in the right direction?

thanks!

On 2/22/07, Craig Slusher <[EMAIL PROTECTED]> wrote:


Section 13.2.4 File Uploads
http://framework.zend.com/manual/en/zend.http.client.advanced.html

On 2/22/07, Romeo-Adrian Cioaba <[EMAIL PROTECTED]> wrote:
> i'm trying to figure out how to upload a file through Zend Framework. If
> have tryed with no luck to upload using Zend_Http_Client.
>
> Can anyone give me a practical example?
>
> Thank You!


--
Craig Slusher
[EMAIL PROTECTED]





--
Romeo-Adrian Cioaba
Phone: +40724185358
email: [EMAIL PROTECTED]

Disclaimer
The information in this e-mail is confidential and may be legally
privileged. It is intended solely for the addressee.  Access to this e-mail
by anyone else is unauthorised.  If you are not the intended recipient
please do not read, print, re-transmit, store, disclose, copy, distribute or
act in reliance on it or any attachments.  Instead please e-mail it back to
the sender and then immediately permanently delete it.  By opening any
attachment to this e-mail you are expressly acknowledging that the
attachment is subject to copyright, and you thereby undertake not to alter,
copy, disseminate, re-transmit, rely upon or use the attachment except as
expressly authorised by the sender.


Re: [fw-general] Proposal: Zend_Service_Yadis

2007-02-22 Thread Pádraic Brady
Hi Bill,

I figured breaking it down made huge sense since not all the components 
required to consume an OpenID service are specific to OpenID. Yadis is used 
across a few identity services, several other components are the foundation of 
general use Cryptographic algorithms, etc. So I'll go one by one in the 
proposals. That's still quite a few proposals adding up so hopefully that's not 
too much of a problem and I'll hit the mailing list with them in turn besides 
for advice ;).

Post 1.0 is fine - I know everyone has their work cut out to get the framework 
feature complete for a beta and RC cycle.

In the meantime! I have edited my previous list-posted proposal and added it to 
the Wiki as "Zend_Service_Yadis" so its there for future consideration and 
public comment - direct link: 
http://framework.zend.com/wiki/pages/viewpage.action?pageId=20369

As I noted before it's focused on consuming a URL which meets the main 
specification. Of course in real life a Yadis ID can be anything so long it 
resolves to a URI. Not sure where the Framework currently stands in terms of 
IRI support in particular given its reaching common use (not to mention XRIs 
and i-names which every decentralised authentication service seems fanatical 
about).

Anyways, here I stop rambling...;)

Regards,
Pádraic


 
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com


- Original Message 
From: Bill Karwin <[EMAIL PROTECTED]>
To: Pádraic Brady <[EMAIL PROTECTED]>; Zend Framework General 

Cc: Zend Framework Auth <[EMAIL PROTECTED]>
Sent: Wednesday, February 21, 2007 5:51:55 PM
Subject: RE: [fw-general] Proposal: Zend_Service_Yadis




 
 









Hi Pádraic, 
 

  
 

Yes I think it’s a great idea to submit this via our
proposal process.  I remember processing your CLA, so you should have posting
privileges on the wiki site.  Let me know if you have any problems posting a
proposal.
 

  
 

Our next milestone is ZF 0.9, which we will consider a beta
and therefore feature-complete for ZF 1.0.  That means that any components that
will be in ZF 1.0 should be in the core by March 15.  There will be life after
ZF 1.0, of course.  We welcome proposals for components that will be introduced
in future releases.
 

  
 

I think it’s good to break this down into several proposals
as you describe.  That way we can keep the scope of each proposal limited, and 
each
component can be finished in a finite amount of time.  :-)
 

  
 

Regards,
 

Bill Karwin
 

  
 












From: Pádraic Brady
[mailto:[EMAIL PROTECTED] 

Sent: Wednesday, February 21, 2007
9:42 AM

To: Zend Framework General

Cc: Zend Framework Auth

Subject: [fw-general] Proposal:
Zend_Service_Yadis
 




  
 



Hi all, (again!)



Ok, since I'm aware that OpenID is likely not suitable as a single proposal
(refer to my earlier fw-auth emails) I'm going to select subparts that are
requirements and see what folk think. Assuming there are no immediate
rejections I will then submit these as formal Proposals on the Wiki, and
hopefully receive Laboratory access in due course. I recognise that these are
likely outside the scope of 1.0, and just note the end goal (while supporting
other generic use cases) is to implement Zend_Auth adapters (Consumers) for
both OpenID and the simpler Typekey. I do have a CLA in place in case that
crops up ;).



This initial proposal is for Zend_Service_Yadis. I figured just adding the
draft would fill the blanks better than my rambling at length (I did that on my
blog instead!). You can read the blog entries over on 
http://blog.astrumfutura.com
if the Yadis 1.0 specification is too much.
 
















 

Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 

Re: [fw-general] File Upload

2007-02-22 Thread Craig Slusher

Section 13.2.4 File Uploads
http://framework.zend.com/manual/en/zend.http.client.advanced.html

On 2/22/07, Romeo-Adrian Cioaba <[EMAIL PROTECTED]> wrote:

i'm trying to figure out how to upload a file through Zend Framework. If
have tryed with no luck to upload using Zend_Http_Client.

Can anyone give me a practical example?

Thank You!



--
Craig Slusher
[EMAIL PROTECTED]


[fw-general] File Upload

2007-02-22 Thread Romeo-Adrian Cioaba

i'm trying to figure out how to upload a file through Zend Framework. If
have tryed with no luck to upload using Zend_Http_Client.

Can anyone give me a practical example?

Thank You!


RE: [fw-general] Zend_Locale

2007-02-22 Thread Ian Warner


-Original Message-
From: Thomas Weidner [mailto:[EMAIL PROTECTED] 
Sent: 22 February 2007 14:20
To: Ian Warner; fw-general@lists.zend.com
Subject: Re: [fw-general] Zend_Locale

> My question though pointed at the fact that I have these three digit
> elements mixed in within the 2 char country codes, with no discernable way
> to sort what countries belong to what 3 digit group.

To be clear:
The functions name is getRegionList()

A region is not a country... a region can also include several countries.
The original term is "territory".

So all returned values are regions... countries are only the 2 lettered 
ones.

>> Yes I suppose this is the confusion - why does Region include countries
then?

Also there is not always a relation between Region and Country.
f.e. Czechoslovakia - region 200 is wether a country nor a region which 
includes several countries.
It is standalone.

>> But the United Kingdom is in the same boat then and thus breaks this
above rule also. I simply thought Czechoslovakia was a dead entity also?

And the 3 digit codes are also no continents.
Or do you believe that "Caribbean" (029) is a continent ??? :-))

>> No I don't believe this, but then I don't know where you are breaking
down this region then - it does not seem logical that you are not
implementing the real world, with your structure you could add in 'South
West Europe' as a region, it may do some good but having real world elements
that can be listed and sorted by makes more sense for this method and the
class in general.

> Wouldn't it be better to create a separate method that returned these like
> getContinentList()
>
> It returned:
>
> [002] => Africa
> [003] => North America
> [005] => South America
> [009] => Oceania
> [00?] => Europe

Nice feature but not possible...
Is Northern America or Eastern Asia a continent ??

> I only copy and pasted - why is it not possible please?

Also several 3 digit territories also contain other 3 digit territories...
f.e. 001 contains 150 (world -> europe)
150 contains 151 (europe -> eastern europe)
151 contains PL (eastern europe -> poland)

There is no good way to seperate between continents and non continents.
Also 2 digit regions can contain other regions...
f.e. QO contains BV

>> Again having real world entries would be a better start I.e. I could
offer a multi drop down with continents then countries - surely this is more
appropriate for this method

> And then we marked the relation in the country array as below:
> And also that I wanted the option to have the countries use there ISO 3 
> char
> elements i.e.
>
> United Kingdom GB GBR
>
> The 3 char in my experience is always better to use, also maybe the dial
> code is a nice option.
>
> So array may be [GB] => array(00?(Europe), United Kingdom, GBR, 44)

We can only work with informations which we have.
We only have the ISO abbreviation codes for all regions, this means
3 digit and 2 char.

We do not have the informations for country dialing code (44) or 3 letter 
abbreviations (GBR) nor
2 letter non standard abbreviations (UK).

It would be no good way to have multidimensional arrays.
For simplification and easy handling the returned values are always plain 
arrays.

> Again very new so would like to here from people who can comment on these
> ideas, or indeed use this package to create simple hier selects for
> continent, country, town etc selections.

Territory select :

$data = $locale->getRegionList();

foreach ($data as $key -> $territory) {
if (is_int($key)) {
print "\nMultiple:$territory";
}
}

foreach ($data as $key -> $territory) {
if (!is_int($key)) {
print "\nSingle:$territory";
}
}

To clearify things:
This data is avaiable through the localization library which was included 
within the framework.

Therefor we can f.e. display the name of countries in every language. But 
the negative thing is that we can only display and return data which is 
avaiable through the library.

For now the zend framework is the only one which gives the possibility to 
have such data simply avaiable within one single function.

>> Ahh ok - should have stated that at the start :) So you are working with
a fixed file, it does however seem to me that this file has some issues
regarding ease of use. I understand I can do the loops above and have
already implemented these - but what would be better is if I can extract the
information from the class while it loops over this file, you will increase
performance and ease of use for developers.

>> Thanks for your help I understand now - and it is probably better if I
compile my own country lists which is a shame.
 
Btw:
This discussion is very close to I18N problems / components.
You should reply to fw-i18n instead of fw-general for all i18n components to

keep fw-general clean for non specific problems :)

Greetings
Thomas
I18N Team Leader




Re: [fw-general] Zend_Locale

2007-02-22 Thread Thomas Weidner

My question though pointed at the fact that I have these three digit
elements mixed in within the 2 char country codes, with no discernable way
to sort what countries belong to what 3 digit group.


To be clear:
The functions name is getRegionList()

A region is not a country... a region can also include several countries.
The original term is "territory".

So all returned values are regions... countries are only the 2 lettered 
ones.


Also threre is not always a relation between Region and Country.
f.e. Czechoslovakia - region 200 is wether a country nor a region which 
includes several countries.

It is standalone.

And the 3 digit codes are also no continents.
Or do you believe that "Caribbean" (029) is a continent ??? :-))


Wouldn't it be better to create a separate method that returned these like
getContinentList()

It returned:

[002] => Africa
[003] => North America
[005] => South America
[009] => Oceania
[00?] => Europe


Nice feature but not possible...
Is Northern America or Eastern Asia a continent ??

Also several 3 digit territories also contain other 3 digit territories...
f.e. 001 contains 150 (world -> europe)
150 contains 151 (europe -> eastern europe)
151 contains PL (eastern europe -> poland)

There is no good way to seperate between continents and non continents.
Also 2 digit regions can contain other regions...
f.e. QO contains BV


And then we marked the relation in the country array as below:
And also that I wanted the option to have the countries use there ISO 3 
char

elements i.e.

United Kingdom GB GBR

The 3 char in my experience is always better to use, also maybe the dial
code is a nice option.

So array may be [GB] => array(00?(Europe), United Kingdom, GBR, 44)


We can only work with informations which we have.
We only have the ISO abbreviation codes for all regions, this means
3 digit and 2 char.

We do not have the informations for country dialing code (44) or 3 letter 
abbreviations (GBR) nor

2 letter non standard abbreviations (UK).

It would be no good way to have multidimensional arrays.
For simplification and easy handling the returned values are always plain 
arrays.



Again very new so would like to here from people who can comment on these
ideas, or indeed use this package to create simple hier selects for
continent, country, town etc selections.


Territory select :

$data = $locale->getRegionList();

foreach ($data as $key -> $territory) {
   if (is_int($key)) {
   print "\nMultiple:$territory";
   }
}

foreach ($data as $key -> $territory) {
   if (!is_int($key)) {
   print "\nSingle:$territory";
   }
}

To clearify things:
This data is avaiable through the localization library which was included 
within the framework.


Therefor we can f.e. display the name of countries in every language. But 
the negative thing is that we can only display and return data which is 
avaiable through the library.


For now the zend framework is the only one which gives the possibility to 
have such data simply avaiable within one single function.


Btw:
This discussion is very close to I18N problems / components.
You should reply to fw-i18n instead of fw-general for all i18n components to 
keep fw-general clean for non specific problems :)


Greetings
Thomas
I18N Team Leader



Re: [fw-general] Zend Framework 0.8 / lifting code freeze

2007-02-22 Thread Nico Edtinger

[22.02.2007 02:53] Bill Karwin wrote:

I'm not sure what this implies for Zend Framework in relation to
Zawinski's Law of Software Development
 ,

but it's pretty cool!  ;-).


It says "Those programs which cannot so expand are replaced by ones  
which can."


Guess that means ZF is here to stay =)


RE: [fw-general] Zend_Locale

2007-02-22 Thread Ian Warner
Thomas

Thank you, I will try out the Zend Translate.

My question though pointed at the fact that I have these three digit
elements mixed in within the 2 char country codes, with no discernable way
to sort what countries belong to what 3 digit group.

Wouldn't it be better to create a separate method that returned these like
getContinentList()

It returned:

[002] => Africa
[003] => North America
[005] => South America
[009] => Oceania
[00?] => Europe

And then we marked the relation in the country array as below:

And also that I wanted the option to have the countries use there ISO 3 char
elements i.e.

United Kingdom GB GBR

The 3 char in my experience is always better to use, also maybe the dial
code is a nice option.

So array may be [GB] => array(00?(Europe), United Kingdom, GBR, 44)

So these ideas do I put them in a ticket or do they get discussed here
first?

Again very new so would like to here from people who can comment on these
ideas, or indeed use this package to create simple hier selects for
continent, country, town etc selections.

Cheers

Ian

-Original Message-
From: Thomas Weidner [mailto:[EMAIL PROTECTED] 
Sent: 21 February 2007 20:20
To: Ian Warner; fw-general@lists.zend.com
Subject: Re: [fw-general] Zend_Locale

Hy Ian,

>  $locale = new Zend_Locale('en_GB');
>  $country_array = $locale->getRegionList();

> This provides some functionality
> However within the initial array there is continental data
> [001] => World
> [002] => Africa
> [003] => North America
> [005] => South America
> [009] => Oceania
>
> It would be nice to delimit on countries or continents etc. And also to
> state whether the array should be ISO 2 char or 3 char, and maybe some 
> flags
> to sort this array - either by country code or country.

Related to ISO:

The ISO Standard defines for regions 2 chars and 3 digit abbreviations for 
all region strings.
But the definition is quite simple...
3 digits represent regions which consist of several countries.
2 chars represent regions where the region is identic with only one country.

So if you are only in need of the countries you will have to strip all 3 
digit arraykeys.

As you will get an array returned the sorting is no problem.
Just sort your array the way you want.
I think it should be no problem to sort your array by key or value... it 
would be no simplification to have an additionaly parameter for sorting as 
there already exist several standard php functions for array handling.

> Anyway very new to Zend if I am missing something then I apologise - but
> just trying to get my head around this method, is this work in progress?

Zend_Locale is finished... actualy there are no opened issues or new feature

requests.

Btw: You will not have to translate your country with gettext... Zend_Locale

already supports all information in all languages natively.
And you may want to use Zend_Translate instead of php's gettext... it does 
not need the extension installed, is threadsave and reads directly from the 
compressed mo file.

Greetings
Thomas
I18N Team Leader