RE: [fw-general] authentication and the EventManager: best place to testif user is logged in

2015-07-16 Thread Daniel Latter
>From my perspective this is the most common approach we take to handle this 
>scenario. I would say you should prob define your callback method as a class 
>method defined on the Module class, but that's purely subjective otherwise I 
>see nothing wrong with this approach.

 Another main point is you should always try to write loosely coupled and 
dependant free code, this way it doesn't matter which framework you use. 

A framework is just a framework - tools to help you. Its much more important to 
understand software engineering as a whole, rather than learn a framework.

Best,
Daniel

-Original Message-
From: "David Mintz" 
Sent: ‎16/‎07/‎2015 23:06
To: "lists lists" 
Subject: [fw-general] authentication and the EventManager: best place to testif 
user is logged in

I am just getting started with ZF2 (now that people are talking about ZF3
(-: ) and wondering what the recommended practice is in the following case.
I have a module where I want to require the user be logged in to access any
controller/action under this module, otherwise redirect to a login page (in
another module).

I have experimented with attaching a listener to the 'dispatch' event in my
Module.php's onBootstrap method. Something like :

public function onBootstrap(MvcEvent $e)
{
   /* ...*/

   $eventManager->attach('dispatch', function() use ($e,
$authenticated) {

if (! $authenticated) {
$target = $e->getTarget();
if ($target instanceof
\Zend\Mvc\Controller\AbstractActionController) {
if ( 0 === strpos(get_class($target),'MyModule')) {
$target->redirect()->toRoute('login');
}
}
}

Is this basically the right approach? Or is there a better way to go at
this?

Thanks.

-- 
David Mintz
http://davidmintz.org/
Human needs before private profit:
http://socialequality.com/


Re: [fw-general] Re: ZF2 Import and validate external pictures from URLs?

2015-05-26 Thread Daniel Latter
Hi,

My assumption is that you want to upload a file, perform validation on it,
then upload to another server?

So the first step is to get the file, via the validators you mentioned.

After that you have the file on disk, validated.

Now all that is left to do is put/upload/copy/post the file to the server
you want.

Does that help :)




On 26 May 2015 at 21:09, cmple  wrote:

> Hi latterd,
> for my existing image upload validation I'm using multiple zf validators
> with custom error messages:
>
> array('Extension', true, array(
> 'extension' => explode(',', $this->config->valid_upload_types),
> 'messages' => array(
> 'fileExtensionFalse' => 'Invalid picture type'
> )
> )),
> array('IsImage', true, array(
> 'magicFile' => false,
> )),
> array('Size', true, array(
> 'max' => $this->config->max_upload_size,
> 'messages' => array(
> 'fileSizeTooBig' => 'Picture size is too big'
> ),
> )),
> array('ImageSize', true,
> array(
> 'minwidth' => $minSize->minwidth,
> 'minheight' => $minSize->minheight,
> 'maxwidth' => $this->config->max_width,
> 'maxheight' => $this->config->max_height,
> 'messages' => array(
> 'fileImageSizeHeightTooBig' => 'Picture height is
> too big',
> 'fileImageSizeWidthTooBig' => 'Picture width is
> too big',
> ),
> ),
> ),
>
> are you suggesting that there is no way around this but only to create
> custom validations such as the use of the getimagesize() function?
>
> also is it possible to use getimagesize() before uploading the image to the
> server (even to the /tmp folder)?
>
> Thank You!
> Roman.
>
>
>
> latterd wrote
> > Hi,
> >
> > You can find out file information using:
> > http://php.net/manual/en/function.finfo-file.php
> >
> > Also, a common way is to use getimagesize() function, if it throws an
> > error
> > or returns false its not an image.
> >
> > I think it is a 2 step process, first you get the image from the url,
> > validate etc.
> >
> > Then upload/send to your server.
> >
> >
> >
> > On 26 May 2015 at 17:05, cmple <
>
> > roman.vidyayev@
>
> > > wrote:
> >
> >> Hey Alejandro,
> >> Thanks for your reply!
> >> I have one more question, how can I apply the file Validation without
> >> using
> >> the global $_FILES[] variable?
> >>
> >> for example:
> >> $validator = new Validator\IsImage();
> >> $valid = $validator->isValid();
> >>
> >> Thanks!
> >> Roman.
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://zend-framework-community.634137.n4.nabble.com/ZF2-Import-and-validate-external-pictures-from-URLs-tp4662542p4662545.html
> >> Sent from the Zend Framework mailing list archive at Nabble.com.
> >>
> >> --
> >> List:
>
> > fw-general@.zend
>
> >> Info: http://framework.zend.com/archives
> >> Unsubscribe:
>
> > fw-general-unsubscribe@.zend
>
> >>
> >>
> >>
>
>
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/ZF2-Import-and-validate-external-pictures-from-URLs-tp4662542p4662547.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


Re: [fw-general] Re: ZF2 Import and validate external pictures from URLs?

2015-05-26 Thread Daniel Latter
Hi,

You can find out file information using:
http://php.net/manual/en/function.finfo-file.php

Also, a common way is to use getimagesize() function, if it throws an error
or returns false its not an image.

I think it is a 2 step process, first you get the image from the url,
validate etc.

Then upload/send to your server.



On 26 May 2015 at 17:05, cmple  wrote:

> Hey Alejandro,
> Thanks for your reply!
> I have one more question, how can I apply the file Validation without using
> the global $_FILES[] variable?
>
> for example:
> $validator = new Validator\IsImage();
> $valid = $validator->isValid();
>
> Thanks!
> Roman.
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/ZF2-Import-and-validate-external-pictures-from-URLs-tp4662542p4662545.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


Re: [fw-general] Validating route params are loading entities from route params

2015-05-22 Thread Daniel Latter
Hi Greg,

You could register a preDispatch event in your module's module.php.

For example, we use a preDispatch event to check if a user is logged in
when accessing certain pages.

You could easily check for a valid "TopEvent" from inside your preDispatch
method, and redirect accordingly.

For example:

https://gist.github.com/rettal/4a6e9ae973ed09fae382

The example above checks if logged in, but can easily be adapted to suit
your needs I think,

Daniel.




On 22 May 2015 at 13:35, Greg Frith  wrote:

> Hi all,
>
> I'm developing a ZF2 site which has a booking process for events.  The
> booking process part of the site has consistent URLs like:
>
> http://mysite.com/book/TopEvent/availability
> http://mysite.com/book/TopEvent/seats
> http://mysite.com/book/TopEvent/payment
> http://mysite.com/book/TopEvent/confirm
>
> I have an event entity stored in a relational database, that amongst other
> things has a 'url_name' field which is used to reference the event in urls,
> a bit nicer than using plain old ids.  So in the above URL examples, the
> 'url_name' is TopEvent.
>
> I have a controller names BookingController which has all the actions for
> the above sample URLs, for example seatsAction.  Currently, at the start of
> each action I'm having to pull the 'url_name' parameter from the params,
> and search for the event by url_name in my database.  If no event is found,
> I return 404.  I have a controller plugin to help with this, and the code
> looks something like:
>
> public function seatsAction()
> {
> // Check we have valid event
> if (!$event = $this->SIL()->getEventFromRoute()) {
> $this->logger->err("On seats page with no valid event, returning 404");
> $this->getResponse()->setStatusCode(404);
> return;
> }
> ….
>
>
> If I have 8 actions in my booking controller, this gets a bit repetitive.
> Essentially, I'd like a way to return a 404 on all routes/action where the
> event cannot be found.
>
> And finally to the crux of my mail, I'd like some advice on the best way
> to do this?
>
> Perhaps I should be listening for some event within my controller
> (dispatch?) and doing my check here (can I return 404 from this).
>
> Or should I override the parent controllers onDispatch event?
>
> Or, could I take this further and create a custom router that validates
> this part of the URL against the database?  If I went down this route,
> could that custom router also load the entity for use within that request?
>
> Any advise greatly appreciated.
>
> Cheers,
> Greg.
>
> :wq


Re: [fw-general] Best practices for managing ZF2 modules and dependencies

2015-03-13 Thread Daniel Latter
Take a look at https://github.com/composer/satis I use it at my work to
manage self contained modules, etc...

On Fri, 13 Mar 2015 22:24 Andy Baird  wrote:

> After doing some more searching I came upon this:
>
> https://getcomposer.org/doc/faqs/how-do-i-install-a-
> package-to-a-custom-path-for-my-framework.md
>
> I ended up implementing this and it worked perfectly having my package use
> composer/install with the "zend-module" type.
>
> Thanks for the help all!
>
> On Wed, Mar 11, 2015 at 11:09 PM, Andy Baird  wrote:
>
> > Hi everyone,
> >
> > Thank you all for the fantastic advice. I am now working on implementing
> a
> > solution that uses --prefer-source and I'm running into two problems that
> > Google didn't solve.
> >
> > I apologize as these are more composer specific than Zend, but it sounds
> > like several members may have experience with this already.
> >
> >- Is there a way to set --prefer-source on a per package basis? I
> >found the config stub option for composer.json, but that seems to
> affect
> >all packages.
> >- Like the first question, is there a way to set a specific directory
> >for the checkout of specific packages? For example, I'd love to clone
> the
> >custom modules into the module directory instead of /vendor. Again I
> see
> >how I can set this globally, but I'm unsure if this can be done on a
> per
> >package basis.
> >
> > Thanks,
> >
> > -Andy
> >
> >
> > On Thu, Feb 12, 2015 at 1:10 AM, Michael Gooden <
> > mich...@bluepointevents.com> wrote:
> >
> >> Hi,
> >>
> >> You could also take the approach similiar to Zend Framework 2 itself,
> >> wherein all the code lies in a single repository, with a master
> >> composer.json that does a "replace self.version" for all your modules.
> You
> >> use this during development with --prefer-source, which should make it
> easy
> >> to develop the code.
> >>
> >> In parallel, you maintain composer.json files within each module path
> >> that describe the dependencies of that specific modules. For production
> >> deployment, you use the script that ZF2 uses, to break the main repo
> into
> >> individual composer repositories.
> >>
> >> I must say, Vincent's approach does seem more structured than this.
> YMMV.
> >>
> >> ​
> >> Kind Regards,
> >>
> >> *Michael Gooden*
> >> CEO
> >>
> >> ​
> >> ​​*Blue Point Events (Pty) Ltd*
> >>
> >> Jutland Crescent, St Georges Park, Port Elizabeth, 6001
> >>
> >> PO Box 63941, Greenacres, Port Elizabeth, 6057
> >>
> >> M: +27 76 489 1764 | F: +27 86 551 2556
> >>
> >> mich...@bluepointevents.com
> >>
> >> Skype: michael.bluepointweb​
> >>
> >> *NOTICE OF CONFIDENTIALITY*
> >> The preceding e-mail message (including any attachments) contains
> >> information that may be confidential, may be protected by the
> >> attorney-client or other applicable privileges, or may constitute
> >> non-public information. It is intended to be conveyed only to the
> >> designated recipient(s) named above. If you are not an intended
> recipient
> >> of this message, please notify the sender by replying to this message
> and
> >> then delete all copies of it from your computer system. Any use,
> >> dissemination, distribution, or reproduction of this message by
> unintended
> >> recipients is not authorized and may be unlawful.
> >>
> >> On 12 February 2015 at 02:48, Vincent Caggiari <
> gdc.assista...@gmail.com>
> >> wrote:
> >>
> >>> Hello,
> >>>
> >>> We tried exactly the same thing (same modules for different clients)
> but
> >>> things got so complicated to manage that we stopped to build websites
> >>> this
> >>> way.
> >>> Why it became so complicated :
> >>>
> >>>- Same code base for different clients doesn't allow you to
> customize
> >>>them so when a client has a specific use case/need, you can't do it
> >>> (and
> >>>don't tell me that you will create a new module for this client
> which
> >>> will
> >>>override the first one for the parts you need to customize because
> >>> you will
> >>>have 2 modules doing the same thing and when you will have to do
> some
> >>>changes, you will not remember in which one to look).
> >>>- You MUST have one repository per module, it's easier to manage and
> >>> see
> >>>what your developers are doing. If you need to update only one
> module
> >>> (i.e
> >>>patch), you can then update your project easily with only the change
> >>> you
> >>>need (so you don't pull changes made on another module which can
> >>> introduce
> >>>bugs for a specific client or some merging headache).
> >>>
> >>>
> >>> At this time, we have one repository per module. Each module for each
> >>> client is forked from our "module" core codebase so when a change is
> made
> >>> for a client and can be used by another (generic change), you update
> your
> >>> client module, then make a pull request to the "module" core codebase
> >>> which
> >>> is then approved and incorporated.
> >>> Then, when you need to work on another client

Re: [fw-general] Zend\Di\Di configuration array?

2014-01-10 Thread Daniel Latter
Just raided my favourites:

https://github.com/rwilson04/zf2-dependency-injection

https://github.com/ralphschindler/Zend_DI-Examples

http://ocramius.github.io/blog/zend-framework-2-controllers-and-dependency-injection-with-zend-di/

On 10 Jan 2014 19:31, "Philip G"  wrote:

> That's the thing, I don't know what's correct. And I'm already spending
> more time than I should be trying to decipher Zend\Di to determine if it
> fully suits my needs.
>
> ---
> Philip
> g...@gpcentre.net
> http://www.gpcentre.net/
>
>
> On Fri, Jan 10, 2014 at 11:14 AM, Frank Brückner
> wrote:
>
> > Please report the problems on the bug tracker.
> >
> > https://github.com/zendframework/zf2-documentation/issues
> >
> > Thanks!
> >
> >
> > Kind regards,
> > Frank
> >
> > Am 10.01.2014, 20:07 Uhr, schrieb Philip G :
> >
> >
> >  Is there any better Zend\Di\Di configuration array in the wild? The one
> on
> >> the docs page is wrong: the hierarchy is completely incorrect, and it's
> >> missing a number of keys.
> >>
> >> Is there a better example somewhere else? Something that displays all
> >> possible configuration options?
> >>
> >> ---
> >> Philip
> >> g...@gpcentre.net
> >> http://www.gpcentre.net/
> >>
> >
> > --
> > List: fw-general@lists.zend.com
> > Info: http://framework.zend.com/archives
> > Unsubscribe: fw-general-unsubscr...@lists.zend.com
> >
> >
> >
>


Re: [fw-general] Zend\Di\Di configuration array?

2014-01-10 Thread Daniel Latter
I find this one more up to date:

http://zf2.readthedocs.org/en/latest/modules/zend.di.introduction.html

Don't know if this is the one you looked at though?
On 10 Jan 2014 19:08, "Philip G"  wrote:

> Is there any better Zend\Di\Di configuration array in the wild? The one on
> the docs page is wrong: the hierarchy is completely incorrect, and it's
> missing a number of keys.
>
> Is there a better example somewhere else? Something that displays all
> possible configuration options?
>
> ---
> Philip
> g...@gpcentre.net
> http://www.gpcentre.net/
>


Re: [fw-general] Having trouble writing a basic application after making first steps into ZF2

2013-11-15 Thread Daniel Latter
Hi,

I would suggest get the Skeleton App (
http://zf2.readthedocs.org/en/latest/user-guide/skeleton-application.html)
working first as this will give you a basic CRUD implementation that you
can build upon and change.

Then I would suggest installing at ZfcUser (
https://github.com/ZF-Commons/ZfcUser) module as this will give you the
authentication aspect you are looking for -  you can of course edit this to
your liking.

Build Incrementally.

HTH
Daniel


On 15 November 2013 07:52, cheresha...@ihahockey.com <
cheresha...@ihahockey.com> wrote:

> Hello Denis,
>
> Your business logic is very specific.
> Maybe the best way to do it is to try building it yourself.
> Also you will learn a lot. This will take time.
> The most important is to get the app running right, the way you want it.
> If there are no suitable modules you have to build them.
> I can not give you step by step instructions, but start from what is
> obvious.
> First create the Authentication. Just go step by step. If you have to, go
> back
> and refactor.
> There are so many different ways.
>
> Take care!
> Stoyan
>
> > dennis-fedco  hat am 15. November 2013 um 00:03
> > geschrieben:
> >
> >
> > I am having some trouble creating a beginning ZF2 application.
> >
> > My trouble stems from still learning ZF2, and from a LOT of options
> > available when it comes to development, and a lot of modules available,
> and
> > from not being crystal clear on how to deal with such modules.
> >
> > Here is what I want to do:
> >
> > I want to create a basic application where a user can:
> >
> > * sign up (verify themselves via email)
> > * authenticate themselves (log in),
> > * if the user is authorized, they can access a protected "resource" page
> > * various resources have their own sets of permissions (aka permissions
> are
> > not global)
> > * (eventually) a page where I can edit users, resources, and access
> > permissions
> >
> > Sounds great, and this can be kind-of done by several different modules,
> if
> > you do not care about how the details are implemented. And here is the
> > problem: I would like to have more of a precision control over how things
> > are implemented at the database level. In fact, I have created a database
> > model of how my 'user' will look like, what 'roles' the user will have,
> what
> > 'access permissions' the user will have to what 'resources', how users
> can
> > form 'teams', and how 'users' can have access to certain 'teams. In a
> word,
> > my specific business logic. No module out there has my desired business
> > logic, nor how would they? They do not know what my application is. I
> need
> > to make my own customizations.
> >
> > Not knowing how to use ZF2 I downloaded coolcsn modules and started
> hacking
> > up the code in 'vendor' packages, realizing only today that I am not
> > supposed to do this. I was doing it all wrong. It was going along
> > splendidly, but I want to do things right, so now I am back to square
> one.
> >
> > My question is: How can I create an application, where the above-listed
> > specifications hold true, and I have freedom to define my database
> > relations, tables, and objects, the way I see fit? Do I use modules, do I
> > create my own, do I do something else? Can you give me a concrete,
> possibly
> > detailed set of steps that I can follow please?
> >
> > Thank you for reading!
> >
> >
> >
> > --
> > View this message in context:
> >
> http://zend-framework-community.634137.n4.nabble.com/Having-trouble-writing-a-basic-application-after-making-first-steps-into-ZF2-tp4661220.html
> > Sent from the Zend Framework mailing list archive at Nabble.com.
> >
> > --
> > List: fw-general@lists.zend.com
> > Info: http://framework.zend.com/archives
> > Unsubscribe: fw-general-unsubscr...@lists.zend.com
> >
> >
>


[fw-general] Skeleton App Tutorial Album Class Input Filter Change

2013-11-14 Thread Daniel Latter
Hi All,

On this page:
http://zf2.readthedocs.org/en/latest/user-guide/forms-and-actions.html

Its defines a filter for a form field:

...
$inputFilter->add(array(
 'name' => 'id',
 'required' => true,
 'filters'  => array(
 array('name' => 'Int'),
 ),
));
...

The problem is with the required = true attribute, it makes the
testAddActionRedirectsAfterValidPost() test method fail, when going through
the unit testing tutorial (
http://zf2.readthedocs.org/en/latest/tutorials/unittesting.html).

Method shown here:
public function testAddActionRedirectsAfterValidPost()
{
$albumTableMock = $this->getMockBuilder('Album\Model\AlbumTable')
->disableOriginalConstructor()
->getMock();

$albumTableMock->expects($this->once())
->method('saveAlbum')
->will($this->returnValue(null));

$serviceManager = $this->getApplicationServiceLocator();
$serviceManager->setAllowOverride(true);
$serviceManager->setService('Album\Model\AlbumTable', $albumTableMock);

$postData = array(
'title'  => 'Led Zeppelin III',
'artist' => 'Led Zeppelin',
);
$this->dispatch('/album/add', 'POST', $postData);
$this->assertResponseStatusCode(302);

$this->assertRedirectTo('/album');
}

I think there are a few ways to sort this I just don't know the best way?
I'm happy to submit a PR but wanted to get everyones thoughts.

Thanks
Daniel


[fw-general] ServiceManager Factories and Callable functions

2013-11-07 Thread Daniel Latter
Hi All,

I am trying to get my head around the best way to configure the service
manager.

Am I correct in thinking that if I have a ServiceManager defined with
anonymous functions like so: (Added to 'factories' configuration key)

...
'Album\Controller\Foo' => function($sm) {

$dependancy = new \stdClass();
$dependancy->bar = 'hello Foo!';
$controller = new FooController($dependancy);
$controller->setFooService($dependancy);

},
...

it will be called upon every request?

As opposed to defining a factory class:

'Album\Controller\Foo' => 'Album\Service\FooControllerFactory'

Which will be called when we use the service key:  'Album\Controller\Foo'

Is this correct?

Many Thanks.
Daniel


Re: [fw-general] Service Manager issue in the Getting started tutorial

2013-08-10 Thread Daniel Latter
Hi,

I don't use Zend\Db\Adapter but you are more than welcome to see "how I get
a db instance using a service manager". I aggressively try to make all
classes I write standalone so I wrote my own ServiceManager that I utilise
with ZF2's service manager. I have linked to classes below that hightlight
this:

This is my own ServiceManager:

https://bitbucket.org/latterd/smodels/src/41e32aef09c91fd797d5ebb5ef16307286215579/vendor/Supa/SupaServiceManager.php?at=master

This is how I set up access to my ServiceManager in Module.php
(getServiceConfig() method):

https://bitbucket.org/latterd/smodels/src/41e32aef09c91fd797d5ebb5ef16307286215579/module/Application/Module.php?at=master

This is how I access my ServiceManager from a Controller:

https://bitbucket.org/latterd/smodels/src/41e32aef09c91fd797d5ebb5ef16307286215579/module/Application/src/Application/Controller/ReviewController.php?at=master

Hope it helps you.
Daniel


On 10 August 2013 16:42, András Csányi  wrote:

> Hi All,
>
> I'm going through the Getting started Zend Framework 2 tutorial and I
> got the error message below at this [1] part of the material:
>
> Zend\ServiceManager\ServiceManager::get was unable to fetch or create
> an instance for Zend\Db\Adapter\Adapter
>
> [1] -
> http://framework.zend.com/manual/2.0/en/user-guide/database-and-models.html#using-servicemanager-to-configure-the-table-gateway-and-inject-into-the-albumtable
>
> I googled around and I found that not I'm the only one who have to
> face this issue [2] and [3], etc. But those articles are about
> developer version of ZF2, however, I'm using ZF 2.2.2.
>
> [2] -
> http://stackoverflow.com/questions/11355126/how-do-i-get-the-service-manager-in-zend-framework-2-beta4-to-create-an-instance
>
> [3] -
> http://stackoverflow.com/questions/11688260/servicenotfoundexception-in-zendframework-2-example-from-rob-allen
>
> I have tried every solution described these articles and suggested by
> the community without any success. My question is that is there any
> solution for this problem? Does anybody has a link which describe a
> working solution for this?
>
> Thanks for any help in advance!
>
> András
>
> --
> --  Csanyi Andras (Sayusi Ando)  -- http://sayusi.hu --
> http://facebook.com/andras.csanyi
> --  ""Trust in God and keep your gunpowder dry!" - Cromwell
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


Re: [fw-general] Translate routes

2013-08-05 Thread Daniel Latter
Hi,

I don't have answer but maybe this will shed some light?:

http://zend-framework-community.634137.n4.nabble.com/Fwd-About-Translatable-segments-td4660214.html


On 5 August 2013 14:17, Ralf Eggert  wrote:

> Hi,
>
> > 1. Can I configure the translator in the module.config.php as well or
> >do I need to do it in the Module::onBootstrap() all the time?
>
> I solved this issue by using my I18nListener which implements the
> ListenerAggregateInterface. So don't worry about that.
>
> > 2. Is the translation only working for segment routes? Or can it also
> >be used with others like literal or regex?
>
> Unfortunately, I have big problems in understanding how to write
> translatable routes. For example, I have this route defined:
>
> --
> 'user-profile' => array(
> 'type'=> 'segment',
> 'options' => array(
> 'route'=> '/user-profile[/:action[/:id]]',
> 'constraints' => array(
> 'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
> 'id' => '[0-9]+',
> ),
> 'defaults' => array(
> 'controller' => 'user-profile',
> 'action' => 'index',
> ),
> ),
> ),
> --
>
> In a first step, I want to action parameter to be translatable. I tried
> to change the route to '/user-profile/{action}[/:id]' but without success.
>
> To make sure, I want these routes translated:
>
> /user-profile/mitglied  => /user-profile/member
> /user-profile/bild  => /user-profile/image
> /user-profile/anschrift => /user-profile/address
>
> /user-profile/mitglied/2  => /user-profile/member/2
> /user-profile/bild/2  => /user-profile/image/2
> /user-profile/anschrift/2 => /user-profile/address/2
>
> Can anyone please help?
>
> Thanks and best regards,
>
> Ralf
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


[fw-general] Empty Delimiter Mystery when using Zend_Config_Ini

2013-06-28 Thread Daniel Latter
Hi All,

I am getting a strange error in my PHP logs.

I have just took over some legacy code using ZF 1.9.6 and I am constantly
getting the below error in my PHP log:

PHP Warning:  explode() [function.explode]:
Empty delimiter in Zend/Config/Ini.php on line 190

The thing is that this line uses a delimiter ($this->_sectionSeparator)
that is given a default value
' : ' so how can this be empty??? Has anyone experiences this before? Could
it be Bots not setting the correct environment?

Thanks for any help.

Daniel.


Fwd: [fw-general] Re: Populating a submit element?

2013-06-12 Thread Daniel Latter
*Anyway, I don't think anyone would want to set the value of a submit
element with posted data, no?

*
No they wouldn't, so don't pass it to setData. But I should imaging people
would want to set the value on the submit element programtically, I don't
think there is a distinction between posted form data and normal setter
data, I think that may be the issue?
*
*
Thanks
Daniel


On 12 June 2013 10:30, Andreas Möller  wrote:

> Hello,
>
>
> > as I just encountered this: is it desirable for anyone that a submit
> element gets actually populated with the requested data?
>
> To demonstrate what I think is unexpected behaviour, I've prepared a test
> right here, which fails, though:
>
> https://gist.github.com/localheinz/ded9b52f8f6b381ddf4d
>
> Can you take a look?
>
> I believe it is undesirable behaviour to be able to fiddle with the label
> of a submit element.
>
> I've encountered this issue when in one view, a button had to be rendered
> using a  tag (Zend\Form\Element\Button) because an icon was needed
> before the actual content, and in a different view an  tag is used
> for rendering the button (Zend\Form\Element\Submit). When submitting the
> form with the  in it, the label of the value of the submit element
> with the  tag is empty, since the  tag doesn't have any (but
> the same name).
>
> Anyway, I don't think anyone would want to set the value of a submit
> element with posted data, no?
>
>
> Best regards,
>
> Andreas
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


Re: [fw-general] Re: zf2 - one/many-to-many relationships

2013-05-22 Thread Daniel Latter
FYI a code view of my approach. Drill down to see Mapper.php:
https://bitbucket.org/latterd/smodels/src/d86fb69051235b33ce4bfba3078b5c0336d86c03/vendor/Supa?at=master


On 22 May 2013 16:13, Daniel Latter  wrote:

> Hi,
>
> Yeah, I just use an adapter that I inject into mappers, I don't use
> Zend/Db stuff. I find it much easier to maintain and debug this way.
>
> From my point of view this is all that is needed. All my mappers do is
> query the db and return the models, I use service classes to utilise the
> mappers and perform model validation.
>
>
>
> On 22 May 2013 00:54, tonystamp  wrote:
>
>> ok, so you have one mapper that communicates with two seperate tables
>> (even
>> if the second table just contains, for instance, 2 columns (foreign
>> keys))?
>> So i'm assuming that is two seperate TableGateway instances? Or you just
>> have an adapter with custom sql queries?
>>
>>
>>
>> --
>> View this message in context:
>> http://zend-framework-community.634137.n4.nabble.com/zf2-one-many-to-many-relationships-tp4659910p4660088.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>> --
>> List: fw-general@lists.zend.com
>> Info: http://framework.zend.com/archives
>> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>>
>>
>>
>


Re: [fw-general] Re: zf2 - one/many-to-many relationships

2013-05-22 Thread Daniel Latter
Hi,

Yeah, I just use an adapter that I inject into mappers, I don't use Zend/Db
stuff. I find it much easier to maintain and debug this way.

>From my point of view this is all that is needed. All my mappers do is
query the db and return the models, I use service classes to utilise the
mappers and perform model validation.



On 22 May 2013 00:54, tonystamp  wrote:

> ok, so you have one mapper that communicates with two seperate tables (even
> if the second table just contains, for instance, 2 columns (foreign keys))?
> So i'm assuming that is two seperate TableGateway instances? Or you just
> have an adapter with custom sql queries?
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/zf2-one-many-to-many-relationships-tp4659910p4660088.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


Re: [fw-general] Get Apache variable in PHPUnit tests

2013-05-08 Thread Daniel Latter
Just mock it out.

You are not testing the getenv method, so do you really need you call it?

D.



On 8 May 2013 15:41, stef  wrote:

> Hello,
>
> I have just started with ZF2 and I came across interesting problem. In a
> controller I'm using specific variables set in vhosts file with SetEnv. It
> is not a problem to get it there using getenv. But PHPUnit test fails on
> getenv function. Even if use getenv directly in unit test, result is the
> same.
>
> I have tried to initialize it in Bootstrap.php in conjunction with Ant but
> no luck. I have spent a day searching for solution on Google, but nothing
> worked.
>
> Did anyone had at least similar problem and how can I solve it?
>
> Thanks in advance,
> Ivan
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Get-Apache-variable-in-PHPUnit-tests-tp4659961.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


Re: [fw-general] 4 whitespaces appended on Response Body

2013-03-06 Thread Daniel Latter
Hi,

Don't know, but number 4 is interesting as some devs change editor settings
to enter 4 spaces when the TAB key is pressed.

Prob just a coincidence though.

Daniel



d...@modeweb.co.uk
www.modeweb.co.uk

t: 07947 716 714


On 6 March 2013 22:30, pobrejuanito  wrote:

> Hi I have a strange problem. I am examining the response payload and I
> have 4
> white spaces appended before my content:
>
> curl -i http://localhost/ARestFul
>
>
> HTTP/1.1 200 OK
> Date: Wed, 06 Mar 2013 17:37:22 GMT
> Server: Apache/2.2.22 (Unix) PHP/5.3.15 with Suhosin-Patch mod_ssl/2.2.22
> OpenSSL/0.9.8r DAV/2
> X-Powered-By: PHP/5.3.15
> Content-Length: 17
> Content-Type: application/json; charset=utf-8
>
> {"foo":"bar"}
>
>
> 4 empty spaces before {"foo:"bar"} which I don't know where that's coming
> from.
>
> I have a REST controller that extends AbstractRestfulController.  I've
> configured the module to output as JSON through:
>
> module.config.php
>
>  view_manager' => array(
> 'strategies' => array(
> 'ViewJsonStrategy'
> ),
> ),
>
>
> ARestFulController.php
>
>
> public function getList() {
>
> return new JsonModel(array('foo'=>'bar'));
> }
>
>
>
>
> I am trying to figure out why it adds the 4 extra spaces before
> {"foo":"bar"}
>
> Anyone know?
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/4-whitespaces-appended-on-Response-Body-tp4659403.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


[fw-general] [ZF2] Get model from DB before update?

2013-03-06 Thread Daniel Latter
Hi All,

OK, this is probably a no brain'er but I wanted to get other peoples'
thoughts.

When I update a model (persist the data in a data store) is it always
necessary to get the model first from the store, set the values, then
update? The OO purist in me says yes, but I wonder if there are any other
smarter solutions out there?

Basically, I don't want to go the database if I don't have to.

Thanks
Daniel


Re: [fw-general] Re: Force ZF2_PATH to be used

2013-02-22 Thread Daniel Latter
"Anyway, you can always tweak your init_autoload.php to suit your needs"

Why not say that in the first place then?


On 22 February 2013 20:39, Marco Pivetta  wrote:

> Yes, that was irony :) (don't take it too much as a joke by the way: code
> under VCS is just a problem)
>
> Anyway, you can always tweak your init_autoload.php to suit your needs
>
> Marco Pivetta
>
> http://twitter.com/Ocramius
>
> http://ocramius.github.com/
>
>
> On 22 February 2013 19:33, mpalourdio [via Zend Framework Community] <
> ml-node+s634137n4659283...@n4.nabble.com> wrote:
>
> > Is this irony ? :D English is not my native language :]
> >
> > BTW, is this tweak somehow possible ? Or am I missing something ?
> >
> > --
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> >
> http://zend-framework-community.634137.n4.nabble.com/Force-ZF2-PATH-to-be-used-tp4659276p4659283.html
> >  To start a new topic under Zend Framework, email
> > ml-node+s634137n634138...@n4.nabble.com
> > To unsubscribe from Zend Framework Community, click here<
> http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=634137&code=b2NyYW1pdXNAZ21haWwuY29tfDYzNDEzN3wxNzE0OTI1MTk4
> >
> > .
> > NAML<
> http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
> >
>
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Force-ZF2-PATH-to-be-used-tp4659276p4659286.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


[fw-general] Re: [ZF2] Digits Validator

2013-02-19 Thread Daniel Latter
I have just realise it does, because in some languages the decimal point is
used differently, is that correct?

Thanks

PS http://en.wikipedia.org/wiki/Rubber_duck_debugging (Thank You ;) )


On 19 February 2013 23:22, Daniel Latter  wrote:

> I have just double checked the ZF2 reference guide and found this:
>
> *Validating numbers*
>
> When you want to validate numbers or numeric values, be aware that this
> validator only validates digits. This means that any other sign like a
> thousand separator or a comma will not pass this validator. In this case
> you should use Zend\I18n\Validator\Int or Zend\I18n\Validator\Float.
>
> Does this mean decimal places too then?
>
> Thanks
>
>
>
> On 19 February 2013 23:11, Daniel Latter  wrote:
>
>> Hi All,
>>
>> Does Zend\Validator\Digits support floats? i.e. validate TRUE for a given
>> float?
>>
>> It's just if I pass 7.5, Digits returns false? but if I look at the
>> isValid() method of the Digits class, the first thing it does are sanity
>> checks, and one is:
>>
>> is_float($value)
>>
>> So we know that this will return false if a string is passed but I am
>> passing 7.5 (not a string), so the checks pass.
>>
>> But later in the method Digits performs it's own filter on the value.
>> After that a final comparison takes place and in my case 7.5 and 75 are
>> being compared, which is false so the validation is failing?
>>
>> Forgive me if I have overlooked something (probably have)
>>
>> Thanks
>> Daniel
>>
>
>


[fw-general] Re: [ZF2] Digits Validator

2013-02-19 Thread Daniel Latter
I have just double checked the ZF2 reference guide and found this:

*Validating numbers*

When you want to validate numbers or numeric values, be aware that this
validator only validates digits. This means that any other sign like a
thousand separator or a comma will not pass this validator. In this case
you should use Zend\I18n\Validator\Int or Zend\I18n\Validator\Float.

Does this mean decimal places too then?

Thanks



On 19 February 2013 23:11, Daniel Latter  wrote:

> Hi All,
>
> Does Zend\Validator\Digits support floats? i.e. validate TRUE for a given
> float?
>
> It's just if I pass 7.5, Digits returns false? but if I look at the
> isValid() method of the Digits class, the first thing it does are sanity
> checks, and one is:
>
> is_float($value)
>
> So we know that this will return false if a string is passed but I am
> passing 7.5 (not a string), so the checks pass.
>
> But later in the method Digits performs it's own filter on the value.
> After that a final comparison takes place and in my case 7.5 and 75 are
> being compared, which is false so the validation is failing?
>
> Forgive me if I have overlooked something (probably have)
>
> Thanks
> Daniel
>


[fw-general] [ZF2] Digits Validator

2013-02-19 Thread Daniel Latter
Hi All,

Does Zend\Validator\Digits support floats? i.e. validate TRUE for a given
float?

It's just if I pass 7.5, Digits returns false? but if I look at the
isValid() method of the Digits class, the first thing it does are sanity
checks, and one is:

is_float($value)

So we know that this will return false if a string is passed but I am
passing 7.5 (not a string), so the checks pass.

But later in the method Digits performs it's own filter on the value.
After that a final comparison takes place and in my case 7.5 and 75 are
being compared, which is false so the validation is failing?

Forgive me if I have overlooked something (probably have)

Thanks
Daniel


Fwd: [fw-general] Zend\Crypt oddities

2013-01-29 Thread Daniel Latter
Maybe this will help? from php.net

/* You should pass the entire results of crypt() as the salt for comparing a
   password, to avoid problems when different hashing algorithms are used. (As
   it says above, standard DES-based password hashing uses a 2-character salt,
   but MD5-based hashing uses 12.) */
if (crypt($user_input, $hashed_password) == $hashed_password) {
   echo "Password verified!";
}



On 29 January 2013 14:17, Andreas Möller  wrote:

> Hello list,
>
>
> I want to hash and verify password using Zend\Crypt, but I'm a bit
> irritated by a discrepancy in the docs and the actual code:
>
> Docs say:
>
> use Zend\Crypt\Password\Bcrypt;
>
> $bcrypt = new Bcrypt();
> $securePass = 'the stored bcrypt value';
> $password = 'the password to check';
>
> if ($bcrypt->verify($password, $securePass)) {
> echo "The password is correct! \n";
> } else {
> echo "The password is NOT correct.\n";
> }
> * see
> https://zf2.readthedocs.org/en/latest/modules/zend.crypt.password.html?highlight=crypt
>
> Code says:
>
> /**
>  * Verify if a password is correct against an hash value
>  *
>  * @param  string $password
>  * @param  string $hash
>  * @return boolean
>  */
> public function verify($password, $hash)
> {
> return ($hash === crypt($password, $hash));
> }
>
> So, shouldn't the verify() method use the salt to encrypt the password?
> The expression would only evaluate to true ever if crypt returned the
> second parameter, i.e, the salt.
>
>
> Best regards,
>
> Andreas


[fw-general] Dependency Injection / Lazy Load

2012-12-14 Thread Daniel Latter
Hi All,

I just have a question regarding injecting dependencies and lazy loading.

The way I have developed my objects (model classes) is to pass in an array
of data to the constructor, this mainly hanldes the setting of scalar
properties (strings, int's etc) on the object,
when I wish to load a property that is an object my aim is to lazy load it
on demand.

What is the best way to accomplish this?

I am going to do this via setter injection in the model, so my first
thought is to use a DiC,
accessible via model classes, is this a common approach?
Or I was also thinking about creating a lazy_load method that would be
utilized by model getter methods:

Something like so:


public function getProp()
return lazy_load($this->prop, $className, $args);
}
...

Then inside the lazy load function, I could harness the DiC?

Any comments or improvements on this approach?

Many Thanks
Daniel


Re: [fw-general] i am newbie zend framework and please help me

2012-03-27 Thread Daniel Latter
Checkout http://akrabat.com/, Rob Allen has some excellent tutorials on how to 
set up ZF.

On 27 Mar 2012, at 13:40, doctorgocha  wrote:

> i can't construct question exactly,but i am try
> 
> i read many books and  watched video tutorial about zend,but i couldn't
> understood
> ( i create my web project on the local server (xampp) and everything ok )
> 
> 1.where i can store zend library folder on the web-host (if i can!)
> 2. can i configure php.ini ,vhost,host files and setup include_path (server
> side setup)
> 3.if i have web project,how i can deploy it on the web-host
> 4.is any guide about server side setup and troubleshoot
> 
> please help me
> 
> 
> --
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/i-am-newbie-zend-framework-and-please-help-me-tp4508708p4508708.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> -- 
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
> 
> 

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] Re: ZF2 - Access PUT data in RestController update() method

2012-03-07 Thread Daniel Latter
Hi,

Thanks for reply,

Yes I have but its empty? Could it be an issue with my route:

'restful' => array(
'type'=> 'Zend\Mvc\Router\Http\Segment'
,
'options' => array(
'route'   =>
'/[:module[/:controller[.:formatter][/:id]]]',
'constraints' => array(
'module' => '[a-zA-Z][a-zA-Z0-9_-]*',
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'formatter'  => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[a-zA-Z0-9_-]*'
),
),
),

Thanks



On 7 March 2012 15:51, mpinkston  wrote:

> Have you tried accessing it through the method args?
>
>
> class MyRestController extends RestfulController
> {
>// ...
>
>public function update($id, $data)
>{
>
>}
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/ZF2-Access-PUT-data-in-RestController-update-method-tp4453542p4453614.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>


[fw-general] ZF2 - Access PUT data in RestController update() method

2012-03-07 Thread Daniel Latter
Hi All,

What is the "best" way to access to PUT data ($data param) in update method
of the new
RestController?

At the moment I am using PHP input stream, but there must be a better way?
but cant seem to find one?

Thanks
Daniel


Re: [fw-general] Re: Detect Mobile use Different View

2011-03-19 Thread Daniel Latter
Ok, so you would still need to check at view script level with suggestion I 
made but there will be a way with suggestion I made to architect it in a way so 
the "check" is inherent within the app.

On 19 Mar 2011, at 12:52, is that you john wayne?  
wrote:

> Hector,
> 
> I fixed the problem a while back, i didnt use your suggestion as i'm not
> pulling out the view in the plugin.  THis is predispatch and asa such the
> View doesnt seem to exist.
> 
> TBH the more i think about this the more i'm preferring my solution anyway,
> as it's simple, doesnt require a whole lotta Zend knowledge, i litterally
> resort back to PHP basics.  Which will be king in 3 months when i try and
> fix a random bug :)
> 
> Thanks for the help, you helped me at least understand a little more about
> the 'joys' of Zend.
> 
> -
> ... or is it me?
> --
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/Detect-Mobile-use-Different-View-tp3387303p3389577.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> -- 
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
> 
> 

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] Re: Detect Mobile use Different View

2011-03-19 Thread Daniel Latter
You could also do this at server level no? In a .htaccess file you could detect 
   and redirect to mobile subdomain, The subdomain folder on server would 
only contain a simple index.php file that bootstraps the app? Saves having to 
check every time, especially if you purely want to provide users with a mobile 
version of the site, IF they view it via mobile device. 

On 19 Mar 2011, at 12:52, is that you john wayne?  
wrote:

> Hector,
> 
> I fixed the problem a while back, i didnt use your suggestion as i'm not
> pulling out the view in the plugin.  THis is predispatch and asa such the
> View doesnt seem to exist.
> 
> TBH the more i think about this the more i'm preferring my solution anyway,
> as it's simple, doesnt require a whole lotta Zend knowledge, i litterally
> resort back to PHP basics.  Which will be king in 3 months when i try and
> fix a random bug :)
> 
> Thanks for the help, you helped me at least understand a little more about
> the 'joys' of Zend.
> 
> -
> ... or is it me?
> --
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/Detect-Mobile-use-Different-View-tp3387303p3389577.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> -- 
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
> 
> 

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] Re: [zf-contributors] ZF tools and SVN going offline briefly

2011-03-18 Thread Daniel Latter
Just a note on the command I posted, the UUIDs will need to be switched now 
because the UUID has been set back to original.


On 18 Mar 2011, at 18:41, joshl  wrote:

> Is Daniel's find-and-replace command the recommended fix when it's
> difficult/impossible to replace the whole working copy? I've tried using
> "svn switch" or "svn switch --relocate" to no avail. I'd really prefer to
> fix this in place without having to make a brand new working copy, but "svn
> up library/Zend" on a pre-existing working copy still gives me the error. A
> new working copy doesn't give the error.
> 
> --
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/ZF-tools-and-SVN-going-offline-briefly-tp3381916p3388054.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> -- 
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
> 
> 

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] Re: [zf-contributors] ZF tools and SVN going offline briefly

2011-03-17 Thread Daniel Latter
HI,

This is how we fixed it:

browse to Zend lib (e.g. lib/Zend) and run this:

find . -type f -name entries -exec sed -i -e
's/44c647ce-9c0f-0410-b52a-842ac1e357ba/1589e24e-76c8-4bf2-8f94-c092ebc2bf4e/g'
{} \;

Thanks
Daniel

On 17 March 2011 12:35, Bruno Friedmann  wrote:
> On 03/17/2011 11:23 AM, Martin Roest wrote:
>> Hi,
>>
>>
>>> wrote:

> We've migrated to the new data center, and public DNS has been updated.
>
> At this time, if you still cannot access the tools, likely you simply
> need to wait for your DNS to update.
>>>
>>
>>
>> Subversion is reachable but now I get this:
>>
>> iSmartie-2 ~/zyzou/shared/library/Zend$ svn up
>> svn: Repository UUID '1589e24e-76c8-4bf2-8f94-c092ebc2bf4e' doesn't match
>> expected UUID '44c647ce-9c0f-0410-b52a-842ac1e357ba'
>>
>>
>> Is this just me or did someone forget to correct the svn UUID after
>> migration.
>>
>>
>> Regards,
>
> same here
> svn up .
> svn: UUID du dépôt source '1589e24e-76c8-4bf2-8f94-c092ebc2bf4e' différent de 
> celui attendu '44c647ce-9c0f-0410-b52a-842ac1e357ba'
>
>
> --
>
> Bruno Friedmann
> Ioda-Net Sàrl www.ioda-net.ch
>
> openSUSE Member & Ambassador
> GPG KEY : D5C9B751C4653227
> irc: tigerfoot
>
> --
> List: fw-general@lists.zend.com
> Info: http://framework.zend.com/archives
> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>
>
>

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




Re: [fw-general] Re: [zf-contributors] ZF tools and SVN going offline briefly

2011-03-17 Thread Daniel Latter
the command should be on a single line:

find . -type f -name entries -exec sed -i -e
's/44c647ce-9c0f-0410-b52a-842ac1e357ba/1589e24e-76c8-4bf2-8f94-c092ebc2bf4e/g'
{} \;

Bruno Friedmann 

On 17 March 2011 13:41, Daniel Latter  wrote:
> HI,
>
> This is how we fixed it:
>
> browse to Zend lib (e.g. lib/Zend) and run this:
>
> find . -type f -name entries -exec sed -i -e
> 's/44c647ce-9c0f-0410-b52a-842ac1e357ba/1589e24e-76c8-4bf2-8f94-c092ebc2bf4e/g'
> {} \;
>
> Thanks
> Daniel
>
> On 17 March 2011 12:35, Bruno Friedmann  wrote:
>> On 03/17/2011 11:23 AM, Martin Roest wrote:
>>> Hi,
>>>
>>>
>>>> wrote:
>>>>>
>>>>>> We've migrated to the new data center, and public DNS has been updated.
>>>>>>
>>>>>> At this time, if you still cannot access the tools, likely you simply
>>>>>> need to wait for your DNS to update.
>>>>
>>>
>>>
>>> Subversion is reachable but now I get this:
>>>
>>> iSmartie-2 ~/zyzou/shared/library/Zend$ svn up
>>> svn: Repository UUID '1589e24e-76c8-4bf2-8f94-c092ebc2bf4e' doesn't match
>>> expected UUID '44c647ce-9c0f-0410-b52a-842ac1e357ba'
>>>
>>>
>>> Is this just me or did someone forget to correct the svn UUID after
>>> migration.
>>>
>>>
>>> Regards,
>>
>> same here
>> svn up .
>> svn: UUID du dépôt source '1589e24e-76c8-4bf2-8f94-c092ebc2bf4e' différent 
>> de celui attendu '44c647ce-9c0f-0410-b52a-842ac1e357ba'
>>
>>
>> --
>>
>> Bruno Friedmann
>> Ioda-Net Sàrl www.ioda-net.ch
>>
>> openSUSE Member & Ambassador
>> GPG KEY : D5C9B751C4653227
>> irc: tigerfoot
>>
>> --
>> List: fw-general@lists.zend.com
>> Info: http://framework.zend.com/archives
>> Unsubscribe: fw-general-unsubscr...@lists.zend.com
>>
>>
>>
>

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com




[fw-general] Memcache Approach

2010-12-10 Thread Daniel Latter
Hi All,

Just wondered if anyone had any thoughts on the following:

We have a ZF app where we use memcache to cache our model classes. The issue
I have
is that we cant store the db conn on the object so we have to make a static
call to grab a
db conn in everyone of our model class methods, which seems repetitive.

Just wondered if anyone had a better approach?

Many Thanks
Dan.


Re: [fw-general] Zend http timeout

2010-10-25 Thread Daniel Latter
Thanks  a bunch guys!

Daniel.

On 25 October 2010 10:40, Chris Riesen  wrote:

> Quote: http://framework.zend.com/manual/en/zend.http.client.html
>
> $client = new Zend_Http_Client();
> $client->setUri('http://example.org');
> $client->setConfig(array(
>'maxredirects' => 0,
>'timeout'  => 30));
>
>
> And most services you have a method to set the client. If it's a
> Zend_Service derived class, it has setHttpClient as a method which
> will take the object ($client in this sample) as value.
>
> On Mon, Oct 25, 2010 at 11:33 AM, Daniel Latter 
> wrote:
> > Hi All,
> >
> > I have to modify the timeout value in Zend/Http/Client.php for a web
> service
> > i am building.
> >
> > Is there any way I can avoid editing Zend/Http/Client.php (config array)
> and
> > instead pass the object
> > to webservice server/client, say in a config array with the changed
> timeout
> > value?
> >
> >
> > Thanks
> > Daniel
> >
>
>
>
> --
> Greetings,
> Christian Riesen
> http://christianriesen.com/ - My personal page
> http://toreas.com/ - Toreas a free fantasy novel
> http://gamewiki.net/ - Open Videogames Wiki
>


[fw-general] Zend http timeout

2010-10-25 Thread Daniel Latter
Hi All,

I have to modify the timeout value in Zend/Http/Client.php for a web service
i am building.

Is there any way I can avoid editing Zend/Http/Client.php (config array) and
instead pass the object
to webservice server/client, say in a config array with the changed timeout
value?


Thanks
Daniel


Re: [fw-general] Re: Zend_Validate_Date returns false for dates between: 28/10/2038 and 19/03/2042

2010-10-08 Thread Daniel Latter
Thanks for the response Hector,

I guess I was coming from the point of view that - can we assume an app will
be doing the same thing it is now with regard to functionality in, say, 28
years time? but then I think that question is dependant on the nature of the
app and how critical its operation is?

Also do you think the issue with Zend_validate_Date is because of the 32-bit
integer limit like I assumed?

Thanks
Daniel

On 8 October 2010 22:52, Hector Virgen  wrote:

> That's only 28 years into the future. I think it's perfectly valid to worry
> about those dates not working -- consider, for example, a mortgage company
> that signs 30-year loans. I'm sure they'd want to show the expected maturity
> date for a mortgage signed today.
>
> --
> *Hector Virgen*
> Sr. Web Developer
> Walt Disney Parks and Resorts Online
> http://www.virgentech.com
>
>
>
> On Fri, Oct 8, 2010 at 2:01 PM, Daniel Latter wrote:
>
>> related to below but does anyone think its silly to be messing with dates
>> in
>> an app so far in future? Our use case is that we are storing driving
>> licences and their expiry date - to be checked in future - and we are
>> using
>> Zend_Validate_Date to validate input...?
>>
>> Obviously we can just extend Zend_Validate_Date and override isValid
>> method
>> but just wondering if anyone has any good arguments against above scenario
>> or to why we shouldn't worry about dates so far in future??
>>
>> Daniel.
>>
>> On 8 October 2010 21:52, Daniel Latter  wrote:
>>
>> > Hi all,
>> >
>> > I posted an issue (as in the title of this post) on the tracker:
>> >
>> > http://framework.zend.com/issues/browse/ZF-10525
>> >
>> > I have later realised it may have something to do with the 32-bit
>> integer
>> > limit but I dont understand why Zend_validate_Date starts to return true
>> > after the date mentioned (19/03/2042) ?
>> >
>> > Is it because overflow occurs in the bit pattern for the number so the
>> > number falls back into the 32-bit integer range again?
>> >
>> > Thanks
>> > Daniel
>> >
>>
>
>


[fw-general] Re: Zend_Validate_Date returns false for dates between: 28/10/2038 and 19/03/2042

2010-10-08 Thread Daniel Latter
related to below but does anyone think its silly to be messing with dates in
an app so far in future? Our use case is that we are storing driving
licences and their expiry date - to be checked in future - and we are using
Zend_Validate_Date to validate input...?

Obviously we can just extend Zend_Validate_Date and override isValid method
but just wondering if anyone has any good arguments against above scenario
or to why we shouldn't worry about dates so far in future??

Daniel.

On 8 October 2010 21:52, Daniel Latter  wrote:

> Hi all,
>
> I posted an issue (as in the title of this post) on the tracker:
>
> http://framework.zend.com/issues/browse/ZF-10525
>
> I have later realised it may have something to do with the 32-bit integer
> limit but I dont understand why Zend_validate_Date starts to return true
> after the date mentioned (19/03/2042) ?
>
> Is it because overflow occurs in the bit pattern for the number so the
> number falls back into the 32-bit integer range again?
>
> Thanks
> Daniel
>


[fw-general] Zend_Validate_Date returns false for dates between: 28/10/2038 and 19/03/2042

2010-10-08 Thread Daniel Latter
Hi all,

I posted an issue (as in the title of this post) on the tracker:

http://framework.zend.com/issues/browse/ZF-10525

I have later realised it may have something to do with the 32-bit integer
limit but I dont understand why Zend_validate_Date starts to return true
after the date mentioned (19/03/2042) ?

Is it because overflow occurs in the bit pattern for the number so the
number falls back into the 32-bit integer range again?

Thanks
Daniel


Re: [fw-general] Select object behaviour

2010-10-04 Thread Daniel Latter
Hi,

ok will do.

But what if a zero did happen to get  through? would you put this down to
just bad down to bad code and testing?

PS any news on my Zend/Dom commit for exceptions branch? i did submit
another pull request? I have it working with eclipse now so Ill try again if
now good?

Thanks
Daniel

On 4 October 2010 16:59, Ralph Schindler  wrote:

> There is some more discussion here:
>
> http://framework.zend.com/issues/browse/ZF-7666
>
> I'd follow up on that thread.
>
> The problem is  that LIMIT is not an SQL standard, and there is no standard
> approach.
>
> http://troels.arvin.dk/db/rdbms/#select-limit
>
> As such, our API in ZF1 needs to remain as consistent for possible for the
> main API.
>
> What I fail to see is why this cannot be implemented in userland?
>
> Instead of:
>
>  $select->from()->  ->limit($limit);
>
> You dont just use:
>
>  $select->from()-> ;
>  if (is_int($limit) && $limit > 0) {
>$select->limit(0);
>  }
>
> Doesn't that (semantically) make more sense?
>
> -ralph
>
>
>
> On 10/4/10 9:43 AM, Daniel Latter wrote:
>
>> not yet, will do later.
>>
>> Daniel
>>
>> On 4 October 2010 15:42, Hector Virgen  wrote:
>>
>>  I agree; iterating over a "limit 0" result set should result in no more
>>> than 0 iterations. Have you filed a bug report?
>>>
>>> --
>>> Hector Virgen
>>> Sent from my Droid X
>>> On Oct 4, 2010 2:17 AM, "Daniel Latter"  wrote:
>>>
>>>> what i meant was if you do happen to pass a zero to the limit method,
>>>>
>>> then
>>>
>>>> say loop over the (possibly millions of rows it will return) returned
>>>>
>>> rows,
>>>
>>>> couldn't this potentially bring down a server?
>>>>
>>>> Daniel.
>>>>
>>>> 2010/10/3 Valeriy Yatsko
>>>>
>>>>  Good day
>>>>>
>>>>>  Yes, but it doesnt seem right to assume someones app will have the
>>>>>>
>>>>> same
>>>
>>>>  amount or rows that is equesl to the max integer the os can hold?
>>>>>>
>>>>>
>>>>> You really have table larger than 2 000 000 000 entries on 32-bit
>>>>>
>>>> servers?
>>>
>>>> :)
>>>>>
>>>>> Let's see... int = 4 bytes on 32 bit systems:
>>>>> 2 000 000 000 x 4 = 8 000 000 000 = ~ 8 gb minimum per table :)
>>>>>
>>>>> Let's add here at least varchar(255):
>>>>> 2 000 000 000 x (4 + 255) = 518 000 000 000 = ~ 518 gb per table :)
>>>>>
>>>>> Try to search some data through this table. :)
>>>>>
>>>>> There are some architecture solutions for this, like splitting tables
>>>>>
>>>> into
>>>
>>>> smaller (or shards).
>>>>>
>>>>> --
>>>>> Валерий Яцко
>>>>> __
>>>>> d...@design.ru | http://www.artlebedev.ru
>>>>>
>>>>>
>>>
>>


Re: [fw-general] Select object behaviour

2010-10-04 Thread Daniel Latter
not yet, will do later.

Daniel

On 4 October 2010 15:42, Hector Virgen  wrote:

> I agree; iterating over a "limit 0" result set should result in no more
> than 0 iterations. Have you filed a bug report?
>
> --
> Hector Virgen
> Sent from my Droid X
> On Oct 4, 2010 2:17 AM, "Daniel Latter"  wrote:
> > what i meant was if you do happen to pass a zero to the limit method,
> then
> > say loop over the (possibly millions of rows it will return) returned
> rows,
> > couldn't this potentially bring down a server?
> >
> > Daniel.
> >
> > 2010/10/3 Valeriy Yatsko 
> >
> >> Good day
> >>
> >> > Yes, but it doesnt seem right to assume someones app will have the
> same
> >> > amount or rows that is equesl to the max integer the os can hold?
> >>
> >> You really have table larger than 2 000 000 000 entries on 32-bit
> servers?
> >> :)
> >>
> >> Let's see... int = 4 bytes on 32 bit systems:
> >> 2 000 000 000 x 4 = 8 000 000 000 = ~ 8 gb minimum per table :)
> >>
> >> Let's add here at least varchar(255):
> >> 2 000 000 000 x (4 + 255) = 518 000 000 000 = ~ 518 gb per table :)
> >>
> >> Try to search some data through this table. :)
> >>
> >> There are some architecture solutions for this, like splitting tables
> into
> >> smaller (or shards).
> >>
> >> --
> >> Валерий Яцко
> >> __
> >> d...@design.ru | http://www.artlebedev.ru
> >>
>


Re: [fw-general] Select object behaviour

2010-10-04 Thread Daniel Latter
what i meant was if you do happen to pass a zero to the limit method, then
say loop over the (possibly millions of rows it will return) returned rows,
couldn't this potentially bring down a server?

Daniel.

2010/10/3 Valeriy Yatsko 

> Good day
>
> > Yes, but it doesnt seem right to assume someones app will have the same
> > amount or rows that is equesl to the max integer the os can hold?
>
> You really have table larger than 2 000 000 000 entries on 32-bit servers?
> :)
>
> Let's see... int = 4 bytes on 32 bit systems:
> 2 000 000 000 x 4 = 8 000 000 000 = ~ 8 gb minimum per table :)
>
> Let's add here at least varchar(255):
> 2 000 000 000 x (4 + 255) = 518 000 000 000 = ~ 518 gb per table :)
>
> Try to search some data through this table. :)
>
> There are some architecture solutions for this, like splitting tables into
> smaller (or shards).
>
> --
> Валерий Яцко
> __
> d...@design.ru | http://www.artlebedev.ru
>


Re: [fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
Yes, but it doesnt seem right to assume someones app will have the same
amount or rows that is equesl to the max integer the os can hold?

Daniel

2010/10/3 Valeriy Yatsko 

> Good day
>
> > So limit 0 (or limit null, or limit false) would remove the limit portion
> if
> > the query?
>
> True.
>
> As long as you have entries amount less than PHP_INT_MAX (which is
> different for 32-bit and 64-bit systems).
>
> Mac OS X Snow Leopard 10.6.4 (64 bit)
>
> dwr:~ dwr$ php intmax.php
> 9223372036854775807
> dwr:~ dwr$
>
> Debian Lenny 5.0 (32 bit)
>
> dwr:~ dev1$ php intmax.php
> 2147483647
> dwr:~ dev1$
>
> --
> Валерий Яцко
> __
> d...@design.ru | http://www.artlebedev.ru
>


Re: [fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
OK, so it doesnt seem to be a bug judging by what Valeriy said and the link
posted but i think this maybe a bit drastic, as Hector said I think limit 0,
null or false should just remove or even dont add the limit part?

Daniel.

On 3 October 2010 01:24, Hector Virgen  wrote:

> So limit 0 (or limit null, or limit false) would remove the limit portion
> if the query?
>
> --
> Hector Virgen
> Sent from my Droid X
> On Oct 2, 2010 5:21 PM, "Daniel Latter"  wrote:
> > or just throw away the limit part altogether?
> >
> > Daniel
> >
> > On 3 October 2010 01:17, Hector Virgen  wrote:
> >
> >> Limit 0 us definitely an incorrect usage, so maybe an exception should
> be
> >> thrown?
> >>
> >> --
> >> Hector Virgen
> >> Sent from my Droid X
> >> On Oct 2, 2010 5:15 PM, "Daniel Latter"  wrote:
> >> > Hi,
> >> >
> >> > I know what your saying but my point is that, is this intended
> behaviour
> >> to
> >> > return a number so large if a zero happend to be passed.?
> >> >
> >> > Thanks
> >> > Daniel.
> >> >
> >> > 2010/10/3 Valeriy Yatsko 
> >> >
> >> >> Good day
> >> >>
> >> >> > dont know if this is a bug or not but if you pass the following
> >> >> parameters
> >> >> > to the limit method on select object like so:
> >> >> >
> >> >> > ->limit(0, 10);
> >> >> >
> >> >> > It produces the following SQL:
> >> >> >
> >> >> > LIMIT 2147483647 OFFSET 10
> >> >> >
> >> >> > now i know you should vaidate the limit val beforehand but this
> could
> >> >> > potentially kill someones app?
> >> >>
> >> >>
> >> >> In Zend_Db_Select, you can use the limit() method to specify the
> count
> >> of
> >> >> rows and the number of rows to skip. The first argument to this
> method
> >> is
> >> >> the desired count of rows. The second argument is the number of rows
> to
> >> >> skip.
> >> >>
> >> >> So you should use
> >> >> ->limit(10,0)
> >> >> instead.
> >> >>
> >> >> --
> >> >> Валерий Яцко
> >> >>
> __
> >> >> d...@design.ru | http://www.artlebedev.ru
> >> >>
> >> >>
> >>
>


Re: [fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
or just throw away the limit part altogether?

Daniel

On 3 October 2010 01:17, Hector Virgen  wrote:

> Limit 0 us definitely an incorrect usage, so maybe an exception should be
> thrown?
>
> --
> Hector Virgen
> Sent from my Droid X
> On Oct 2, 2010 5:15 PM, "Daniel Latter"  wrote:
> > Hi,
> >
> > I know what your saying but my point is that, is this intended behaviour
> to
> > return a number so large if a zero happend to be passed.?
> >
> > Thanks
> > Daniel.
> >
> > 2010/10/3 Valeriy Yatsko 
> >
> >> Good day
> >>
> >> > dont know if this is a bug or not but if you pass the following
> >> parameters
> >> > to the limit method on select object like so:
> >> >
> >> > ->limit(0, 10);
> >> >
> >> > It produces the following SQL:
> >> >
> >> > LIMIT 2147483647 OFFSET 10
> >> >
> >> > now i know you should vaidate the limit val beforehand but this could
> >> > potentially kill someones app?
> >>
> >>
> >> In Zend_Db_Select, you can use the limit() method to specify the count
> of
> >> rows and the number of rows to skip. The first argument to this method
> is
> >> the desired count of rows. The second argument is the number of rows to
> >> skip.
> >>
> >> So you should use
> >> ->limit(10,0)
> >> instead.
> >>
> >> --
> >> Валерий Яцко
> >> __
> >> d...@design.ru | http://www.artlebedev.ru
> >>
> >>
>


Re: [fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
The example I am thinking of is an app could very well have millions of
rows, and if you did happen to pass a zero you would most probably end up
killing the server with an out of memory error, or timeout issues... and
thus bring you app crashing down.

Daniel.

2010/10/3 Daniel Latter 

> Hi,
>
> I know what your saying but my point is that, is this intended behaviour to
> return a number so large if a zero happend to be passed.?
>
> Thanks
> Daniel.
>
> 2010/10/3 Valeriy Yatsko 
>
> Good day
>>
>> > dont know if this is a bug or not but if you pass the following
>> parameters
>> > to the limit method on select object like so:
>> >
>> > ->limit(0, 10);
>> >
>> > It produces the following SQL:
>> >
>> > LIMIT 2147483647 OFFSET 10
>> >
>> > now i know you should vaidate the limit val beforehand but this could
>> > potentially kill someones app?
>>
>>
>> In Zend_Db_Select, you can use the limit() method to specify the count of
>> rows and the number of rows to skip. The first argument to this method is
>> the desired count of rows. The second argument is the number of rows to
>> skip.
>>
>> So you should use
>> ->limit(10,0)
>> instead.
>>
>> --
>> Валерий Яцко
>> __
>> d...@design.ru | http://www.artlebedev.ru
>>
>>
>


Re: [fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
Hi,

I know what your saying but my point is that, is this intended behaviour to
return a number so large if a zero happend to be passed.?

Thanks
Daniel.

2010/10/3 Valeriy Yatsko 

> Good day
>
> > dont know if this is a bug or not but if you pass the following
> parameters
> > to the limit method on select object like so:
> >
> > ->limit(0, 10);
> >
> > It produces the following SQL:
> >
> > LIMIT 2147483647 OFFSET 10
> >
> > now i know you should vaidate the limit val beforehand but this could
> > potentially kill someones app?
>
>
> In Zend_Db_Select, you can use the limit() method to specify the count of
> rows and the number of rows to skip. The first argument to this method is
> the desired count of rows. The second argument is the number of rows to
> skip.
>
> So you should use
> ->limit(10,0)
> instead.
>
> --
> Валерий Яцко
> __
> d...@design.ru | http://www.artlebedev.ru
>
>


[fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
Hi All,

dont know if this is a bug or not but if you pass the following parameters
to the limit method on select object like so:

->limit(0, 10);

It produces the following SQL:

LIMIT 2147483647 OFFSET 10

now i know you should vaidate the limit val beforehand but this could
potentially kill someones app?

Thanks
Daniel.


Re: [fw-general] Template Fall Back

2010-09-24 Thread Daniel Latter
not that I know of but what your saying would be easy to accomplish using
Zend_Layout and in particular the setLayout() method.

Daniel.


Re: [fw-general] Committing to milestones branch

2010-09-24 Thread Daniel Latter
Thanks,

Ive submitted another pull request to the changes I have made to my master
(zf2) fork on GitHub, indicating the milestones/exceptions branch.

I'll await to get response then go from there.

Thanks again for your patience.


[fw-general] Committing to milestones branch

2010-09-24 Thread Daniel Latter
RE: Ralph

Thanks for the reply on github

I have made the amendments you suggested. Sorry to say I only scan read the
post you linked to the other day on zfdev so im gonna read that properly
tonight :)

I am using Git Bash for windows with Github as my remote repo. I currently
have all the changes in a separate branch of my master zf2 branch (forked
from zendFramework).

Should I commit my changes to milestones/exceptions branch on Github? If so
how do I commit to a branch on Github using Git Bash, cant seem to get do
it?

Thanks for all your help, I'm sure I am nearly there :)

Also, I followed the same approach adopted with the Zend/Acl Exception
changes, which I think I read you mentioned was OK to do so i a blog post?


Re: [fw-general] ZF2: Community Involvement in the Next Major Milestone

2010-09-13 Thread Daniel Latter
Hi Ralph,

Ill log in when I get home from work to see who's about. But first, at noted
in your previous email, ill sign the CLA and get a Jira account.

Thanks

On 13 September 2010 15:56, Ralph Schindler wrote:

> Hey Daniel,
>
> You should log into #zftalk.dev today so we can discuss, I know that the
> MVC component will be going through some re-factoring soon and I'd like to
> coordinate your effort with matthew's.  If you cannot make it into IRC, I'll
> ask Matthew which parts he feels you can work on without worry that your
> work wont be dismissed as part of a larger ongoing effort.
>
> -ralph
>
>
> On 9/10/10 2:12 PM, Daniel Latter wrote:
>
>> I'd like to do the view section if that's any help?
>>
>> Keen to get involved, let me know what I have to do.
>>
>> Daniel.
>>
>> On Friday, September 10, 2010, Wil Moore III
>>  wrote:
>>
>>>
>>>
>>> Ralph Schindler-2 wrote:
>>>
>>>>
>>>> Either reply to this email thread or fine me in #zftalk.dev to discuss
>>>> what component you'd like to work on.
>>>>
>>>>  As mentioned via IRC, I'll take on Uri, Rest\Route, and Pagination.
>>> Wanted
>>> to post here in case people want to know what is already being worked on.
>>>
>>> Ralph, should those interested expect to see the finished example
>>> (Zend\Authentication) at this point or is that still to come?
>>>
>>>
>>> -
>>> --
>>> Wil Moore III
>>>
>>> Why is Bottom-posting better than Top-posting:
>>> http://www.caliburn.nl/topposting.html
>>> --
>>> View this message in context:
>>> http://zend-framework-community.634137.n4.nabble.com/ZF2-Community-Involvement-in-the-Next-Major-Milestone-tp2533454p2534740.html
>>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>>
>>>
>>


Re: [fw-general] ZF2: Community Involvement in the Next Major Milestone

2010-09-11 Thread Daniel Latter

I'd like to do the zend view classes if that's any help?

Keen to get involved, let me know what I have to do.

Daniel



On 9 Sep 2010, at 20:16, Ralph Schindler   
wrote:



Hey all!

We are moving into development on our next major milestone in ZF2  
and as such, we are looking for your help.  This milestone focuses  
on converting the existing exception code to the new set of  
standards. These standards are discussed in the following proposal  
by Matthew:


 * http://framework.zend.com/wiki/display/ZFDEV2/Proposal+for+Exceptions+in+ZF2

To see the overall goals for this milestone, you can consult the ZF2  
Milestones document:


 * 
http://framework.zend.com/wiki/display/ZFDEV2/Zend+Framework+2.0+Milestones#ZendFramework2.0Milestones-Milestone%3AExceptions

So what is there for you to do?

I've gone through and refactored Zend\Authentication to conform to  
the new Exception standards and expectation.  I will be moving onto  
Zend\AccessControl next and both it and Authentication can act as a  
blueprint for rest of the components.


All work is being done inside the "milestones/exceptions" branch for  
this milestone.


If you are interested in jumping into ZF2 development, now is a good  
time to start coding and getting familiar with the code base.


Either reply to this email thread or fine me in #zftalk.dev to  
discuss what component you'd like to work on.


Thanks & Happy ZF(2)ing!
-ralph

--
Ralph Schindler
Software Engineer | ralph.schind...@zend.com
Zend Framework| http://framework.zend.com/


Re: [fw-general] ZF2: Community Involvement in the Next Major Milestone

2010-09-10 Thread Daniel Latter
I'd like to do the view section if that's any help?

Keen to get involved, let me know what I have to do.

Daniel.

On Friday, September 10, 2010, Wil Moore III  wrote:
>
>
> Ralph Schindler-2 wrote:
>>
>> Either reply to this email thread or fine me in #zftalk.dev to discuss
>> what component you'd like to work on.
>>
> As mentioned via IRC, I'll take on Uri, Rest\Route, and Pagination. Wanted
> to post here in case people want to know what is already being worked on.
>
> Ralph, should those interested expect to see the finished example
> (Zend\Authentication) at this point or is that still to come?
>
>
> -
> --
> Wil Moore III
>
> Why is Bottom-posting better than Top-posting:
> http://www.caliburn.nl/topposting.html
> --
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/ZF2-Community-Involvement-in-the-Next-Major-Milestone-tp2533454p2534740.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Zend_XmlRpc token passing

2010-09-07 Thread Daniel Latter
Thanks Matthew I'll digest this fully tommorow but just wanted to  
appologise as I sent this message a few times from a different email,  
so sorry to the list for that.


Thanks again Matthew for your thoughts, they help a lot.

Daniel.

On 7 Sep 2010, at 21:16, Matthew Weier O'Phinney   
wrote:



-- Daniel Latter  wrote
(on Tuesday, 07 September 2010, 08:39 PM +0100):

One more question if I may.
Rather than verifying the token at the method level what do you think
about verifying the token in the request constructor?

What I mean is that for each server method that you want "protected"
you would have to verify the token in the method body. But if you do
this in the extended request constructor say, you would only need to
do this once.?


It depends on what the token represents.

Typically, the token will represent an identity, and you will need  
to do

two different actions:

* Verify and obtain the identity
* Validate whether or not the identity has permissions to perform the
  current action.

The first should likely be done outside handling the call; if it's an
invalid token, you can return a fault response immediately:

   $token = $request->getToken();

   $authenticator = new AuthenticationAdapter($token);
   $result = $authenticator->authenticate();
   if (!$result->isValid()) {
   $response = new Zend_XmlRpc_Fault(401, 'Invalid token');
   header('Content-Type: text/xml');
   echo $response;
   exit();
   }

   $identity = $result->getIdentity();

You would then pass the *identity* to your service objects -- and yes,
the constructor is a great place -- or do it via a setter:

   // via constructor
   $service = new SomeService($identity);

   // via setter
   $service = new SomeService();
   $service->setIdentity($identity);

Now, within the service, you may have fine-grained or broad access --
broad access means the user has access to all methods or none at all,
while fine-grained would refer to access being determined per- 
method. In

each case, you compare it to the ACLs:

   if (!$acl->isAllowed($identity, $this, 'somepermission')) {
   throw new RestrictedAccessException();
   }

(The above assumes your service class acts as an ACL resource.)

Where they vary are the permissions you check against, and where you
check. If you're doing broad access, you can likely omit the third
argument to isAllowed, as you're querying on all permissions:

   if (!$acl->isAllowed($identity, $this)) { }

As such, you might want to do this in the constructor -- and if you  
do,

you have two choices for when/where to do it:

* Prior to attaching the service to the server. As such, you'd create
  the Fault object manually as I did in the above example when
  authenticating the token.

* Alternately, attach the class to the server by name, specifying a
  constructor argument of the identity:

  $server->setClass('SomeService', 'some', $identity);

(Second argument is the XML-RPC "namespace" under which the classes
methods will be grouped.)

When you do that, the exception will be caught by the server as soon  
as

it tries to handle it -- and if you have a number of classes attached,
this is a good way to reduce how much up-front coding and checking you
need to do.

If doing fine-grained, you'll likely determine permissions per-method,
you _must_ do the checks in each method. I usually develop a helper  
for

this:

   protected function validateAcls($action)
   {
   if (!$this->getAcl()->isAllowed($this->getIdentity(), $this,  
$action)) {

   throw new RestrictedAccessException();
   }
   }

and then pop the following line into the top of all ACL'd methods:

   public function foo()
   {
   $this->validateAcls(__FUNCTION__);
   // ...
   }

You'll note I use a discrete exception for invalid ACL assertions. I  
do

this so that I can leverage another aspect of the server: having fault
responses for known exceptions.

   Zend_XmlRpc_Server_Fault::attachFaultExceptions 
('RestrictedAccessException');


Any exception passed this way can return its message and code in the
returned fault -- which makes it very easy to document in your API why
calls might be failing.

Hope that helps!

On Monday, September 6, 2010, Daniel Latter   
wrote:

Excellent, thanks a bunch for the quick response. - and the slightly
improved approach.

Greatly appreciated.

Daniel

On 6 September 2010 16:52, Matthew Weier O'Phinney  
 wrote:

-- Daniel Latter  wrote
(on Monday, 06 September 2010, 04:43 PM +0100):

Sorry, I missed part of the message:

Would you just specify the token here:

client = new Zend_XmlRpc_Client('http://localhost:10088/xmlrpcserver' 
);

$timesheets = $client->getProxy('timesheets');
$resp = $timesheets->addHours($token, $hours);


Yes, exactly -- you add the token as the fi

Re: [fw-general] Zend_XmlRpc token passing

2010-09-07 Thread Daniel Latter

RE Matthew, (and list)

One more question if I may.
Rather than verifying the token at the method level what do you think
about verifying the token in the request constructor?

What I mean is that for each server method that you want "protected"
you would have to verify the token in the method body. But if you do
this in the extended request constructor say, you would only need to
do this once.?

I would be gratefull to hear your thoughts on this?

Thanks
Daniel

On 6 Sep 2010, at 16:52, Matthew Weier O'Phinney   
wrote:



-- Daniel Latter  wrote
(on Monday, 06 September 2010, 04:43 PM +0100):

Sorry, I missed part of the message:

Would you just specify the token here:

client = new Zend_XmlRpc_Client('http://localhost:10088/ 
xmlrpcserver');

$timesheets = $client->getProxy('timesheets');
$resp = $timesheets->addHours($token, $hours);


Yes, exactly -- you add the token as the first or last argument to  
every

method, and then the request object on the server side strips it out,
and you inject it into service classes.



-- Forwarded message --
From: Daniel Latter 
Date: 6 September 2010 16:40
Subject: Zend_XmlRpc token passing
To: Zend Framework General 


hi,

RE: Matthew Weier O'Phinney

On a Nabble post you refer to a piece of code that enables the  
passing

of a token:

 class My_XmlRpc_Request extends Zend_XmlRpc_Request_Http
   {

   public function __construct()
   {
   parent::__construct();

   if ($this->getMethod() != 'login') {
   $params = $this->getParams();
   $token  = array_shift($params);
   $this->setParams($params);

   // Verify the token, and then add it to the  
registry...

   Zend_Registry::set('token', $token);
   }
   }
   }

I am correct in thinking that all service method(s) will stay the
same, i.e. - have no reference to the token?

so like this:

/**
* Add timesheet hours for a candidate
*
* @param array Hours for a working week
* @return array
*/
   public function addHours($hours) {

   $timesheetService = new Service_Timesheet();
   $resp = $timesheetService->addCandidateTimesheetHours 
($hours);


   return $resp;
   }


and NOT like this:

/**
* Add timesheet hours for a candidate
*
* @param string token
* @param array Hours for a working week
* @return array
*/
   public function addHours($token, $hours) {

   $timesheetService = new Service_Timesheet();
   $resp = $timesheetService->addCandidateTimesheetHours 
($hours);


   return $resp;
   }


TIA

Daniel.



--
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/
PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc


[fw-general] Fwd: Zend_XmlRpc token passing

2010-09-07 Thread Daniel Latter
-- Forwarded message --
From: Daniel Latter 
Date: Tuesday, September 7, 2010
Subject: Zend_XmlRpc token passing
To: "fw-general@lists.zend.com" 


RE Matthew, (and list)

One more question if I may.
Rather than verifying the token at the method level what do you think
about verifying the token in the request constructor?

What I mean is that for each server method that you want "protected"
you would have to verify the token in the method body. But if you do
this in the extended request constructor say, you would only need to
do this once.?

I would be gratefull to hear your thoughts on this?

Thanks
Daniel

On Monday, September 6, 2010, Daniel Latter  wrote:
> Excellent, thanks a bunch for the quick response. - and the slightly
> improved approach.
>
> Greatly appreciated.
>
> Daniel
>
> On 6 September 2010 16:52, Matthew Weier O'Phinney  wrote:
>> -- Daniel Latter  wrote
>> (on Monday, 06 September 2010, 04:43 PM +0100):
>>> Sorry, I missed part of the message:
>>>
>>> Would you just specify the token here:
>>>
>>> client = new Zend_XmlRpc_Client('http://localhost:10088/xmlrpcserver');
>>> $timesheets = $client->getProxy('timesheets');
>>> $resp = $timesheets->addHours($token, $hours);
>>
>> Yes, exactly -- you add the token as the first or last argument to every
>> method, and then the request object on the server side strips it out,
>> and you inject it into service classes.
>>
>>
>>> -- Forwarded message --
>>> From: Daniel Latter 
>>> Date: 6 September 2010 16:40
>>> Subject: Zend_XmlRpc token passing
>>> To: Zend Framework General 
>>>
>>>
>>> hi,
>>>
>>> RE: Matthew Weier O'Phinney
>>>
>>> On a Nabble post you refer to a piece of code that enables the passing
>>> of a token:
>>>
>>>  class My_XmlRpc_Request extends Zend_XmlRpc_Request_Http
>>>    {
>>>
>>>        public function __construct()
>>>        {
>>>            parent::__construct();
>>>
>>>            if ($this->getMethod() != 'login') {
>>>                $params = $this->getParams();
>>>                $token  = array_shift($params);
>>>                $this->setParams($params);
>>>
>>>                // Verify the token, and then add it to the registry...
>>>                Zend_Registry::set('token', $token);
>>>            }
>>>        }
>>>    }
>>>
>>> I am correct in thinking that all service method(s) will stay the
>>> same, i.e. - have no reference to the token?
>>>
>>> so like this:
>>>
>>> /**
>>>         * Add timesheet hours for a candidate
>>>         *
>>>         * @param array Hours for a working week
>>>         * @return array
>>>         */
>>>        public function addHours($hours) {
>>>
>>>                $timesheetService = new Service_Timesheet();
>>>                $resp = 
>>> $timesheetService->addCandidateTimesheetHours($hours);
>>>
>>>                return $resp;
>>>        }
>>>
>>>
>>> and NOT like this:
>>>
>>> /**
>>>         * Add timesheet hours for a candidate
>>>         *
>>>         * @param string token
>>>         * @param array Hours for a working week
>>>         * @return array
>>>         */
>>>        p


[fw-general] Zend_XmlRpc token passing

2010-09-07 Thread Daniel Latter
RE Matthew, (and list)

One more question if I may.
Rather than verifying the token at the method level what do you think
about verifying the token in the request constructor?

What I mean is that for each server method that you want "protected"
you would have to verify the token in the method body. But if you do
this in the extended request constructor say, you would only need to
do this once.?

I would be gratefull to hear your thoughts on this?

Thanks
Daniel

On Monday, September 6, 2010, Daniel Latter  wrote:
> Excellent, thanks a bunch for the quick response. - and the slightly
> improved approach.
>
> Greatly appreciated.
>
> Daniel
>
> On 6 September 2010 16:52, Matthew Weier O'Phinney  wrote:
>> -- Daniel Latter  wrote
>> (on Monday, 06 September 2010, 04:43 PM +0100):
>>> Sorry, I missed part of the message:
>>>
>>> Would you just specify the token here:
>>>
>>> client = new Zend_XmlRpc_Client('http://localhost:10088/xmlrpcserver');
>>> $timesheets = $client->getProxy('timesheets');
>>> $resp = $timesheets->addHours($token, $hours);
>>
>> Yes, exactly -- you add the token as the first or last argument to every
>> method, and then the request object on the server side strips it out,
>> and you inject it into service classes.
>>
>>
>>> -- Forwarded message --
>>> From: Daniel Latter 
>>> Date: 6 September 2010 16:40
>>> Subject: Zend_XmlRpc token passing
>>> To: Zend Framework General 
>>>
>>>
>>> hi,
>>>
>>> RE: Matthew Weier O'Phinney
>>>
>>> On a Nabble post you refer to a piece of code that enables the passing
>>> of a token:
>>>
>>>  class My_XmlRpc_Request extends Zend_XmlRpc_Request_Http
>>>    {
>>>
>>>        public function __construct()
>>>        {
>>>            parent::__construct();
>>>
>>>            if ($this->getMethod() != 'login') {
>>>                $params = $this->getParams();
>>>                $token  = array_shift($params);
>>>                $this->setParams($params);
>>>
>>>                // Verify the token, and then add it to the registry...
>>>                Zend_Registry::set('token', $token);
>>>            }
>>>        }
>>>    }
>>>
>>> I am correct in thinking that all service method(s) will stay the
>>> same, i.e. - have no reference to the token?
>>>
>>> so like this:
>>>
>>> /**
>>>         * Add timesheet hours for a candidate
>>>         *
>>>         * @param array Hours for a working week
>>>         * @return array
>>>         */
>>>        public function addHours($hours) {
>>>
>>>                $timesheetService = new Service_Timesheet();
>>>                $resp = 
>>> $timesheetService->addCandidateTimesheetHours($hours);
>>>
>>>                return $resp;
>>>        }
>>>
>>>
>>> and NOT like this:
>>>
>>> /**
>>>         * Add timesheet hours for a candidate
>>>         *
>>>         * @param string token
>>>         * @param array Hours for a working week
>>>         * @return array
>>>         */
>>>        public function addHours($token, $hours) {
>>>
>>>                $timesheetService = new Service_Timesheet();
>>>                $resp = 
>>> $timesheetService->addCandidateTimesheetHours($hours);
>>>
>>>                return $resp;
>>>        }
>>>
>>>
>>> TIA
>>>
>>> Daniel.
>>>
>>
>> --
>> Matthew Weier O'Phinney
>> Project Lead


Re: [fw-general] Zend_XmlRpc token passing

2010-09-06 Thread Daniel Latter
Excellent, thanks a bunch for the quick response. - and the slightly
improved approach.

Greatly appreciated.

Daniel

On 6 September 2010 16:52, Matthew Weier O'Phinney  wrote:
> -- Daniel Latter  wrote
> (on Monday, 06 September 2010, 04:43 PM +0100):
>> Sorry, I missed part of the message:
>>
>> Would you just specify the token here:
>>
>> client = new Zend_XmlRpc_Client('http://localhost:10088/xmlrpcserver');
>> $timesheets = $client->getProxy('timesheets');
>> $resp = $timesheets->addHours($token, $hours);
>
> Yes, exactly -- you add the token as the first or last argument to every
> method, and then the request object on the server side strips it out,
> and you inject it into service classes.
>
>
>> -- Forwarded message --
>> From: Daniel Latter 
>> Date: 6 September 2010 16:40
>> Subject: Zend_XmlRpc token passing
>> To: Zend Framework General 
>>
>>
>> hi,
>>
>> RE: Matthew Weier O'Phinney
>>
>> On a Nabble post you refer to a piece of code that enables the passing
>> of a token:
>>
>>  class My_XmlRpc_Request extends Zend_XmlRpc_Request_Http
>>    {
>>
>>        public function __construct()
>>        {
>>            parent::__construct();
>>
>>            if ($this->getMethod() != 'login') {
>>                $params = $this->getParams();
>>                $token  = array_shift($params);
>>                $this->setParams($params);
>>
>>                // Verify the token, and then add it to the registry...
>>                Zend_Registry::set('token', $token);
>>            }
>>        }
>>    }
>>
>> I am correct in thinking that all service method(s) will stay the
>> same, i.e. - have no reference to the token?
>>
>> so like this:
>>
>> /**
>>         * Add timesheet hours for a candidate
>>         *
>>         * @param array Hours for a working week
>>         * @return array
>>         */
>>        public function addHours($hours) {
>>
>>                $timesheetService = new Service_Timesheet();
>>                $resp = $timesheetService->addCandidateTimesheetHours($hours);
>>
>>                return $resp;
>>        }
>>
>>
>> and NOT like this:
>>
>> /**
>>         * Add timesheet hours for a candidate
>>         *
>>         * @param string token
>>         * @param array Hours for a working week
>>         * @return array
>>         */
>>        public function addHours($token, $hours) {
>>
>>                $timesheetService = new Service_Timesheet();
>>                $resp = $timesheetService->addCandidateTimesheetHours($hours);
>>
>>                return $resp;
>>        }
>>
>>
>> TIA
>>
>> Daniel.
>>
>
> --
> Matthew Weier O'Phinney
> Project Lead            | matt...@zend.com
> Zend Framework          | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>


[fw-general] Zend_XmlRpc token passing

2010-09-06 Thread Daniel Latter
Sorry, I missed part of the message:

Would you just specify the token here:

client = new Zend_XmlRpc_Client('http://localhost:10088/xmlrpcserver');
$timesheets = $client->getProxy('timesheets');
$resp = $timesheets->addHours($token, $hours);


Thanks

-- Forwarded message --
From: Daniel Latter 
Date: 6 September 2010 16:40
Subject: Zend_XmlRpc token passing
To: Zend Framework General 


hi,

RE: Matthew Weier O'Phinney

On a Nabble post you refer to a piece of code that enables the passing
of a token:

 class My_XmlRpc_Request extends Zend_XmlRpc_Request_Http
   {

       public function __construct()
       {
           parent::__construct();

           if ($this->getMethod() != 'login') {
               $params = $this->getParams();
               $token  = array_shift($params);
               $this->setParams($params);

               // Verify the token, and then add it to the registry...
               Zend_Registry::set('token', $token);
           }
       }
   }

I am correct in thinking that all service method(s) will stay the
same, i.e. - have no reference to the token?

so like this:

/**
        * Add timesheet hours for a candidate
        *
        * @param array Hours for a working week
        * @return array
        */
       public function addHours($hours) {

               $timesheetService = new Service_Timesheet();
               $resp = $timesheetService->addCandidateTimesheetHours($hours);

               return $resp;
       }


and NOT like this:

/**
        * Add timesheet hours for a candidate
        *
        * @param string token
        * @param array Hours for a working week
        * @return array
        */
       public function addHours($token, $hours) {

               $timesheetService = new Service_Timesheet();
               $resp = $timesheetService->addCandidateTimesheetHours($hours);

               return $resp;
       }


TIA

Daniel.


[fw-general] Zend_XmlRpc token passing

2010-09-06 Thread Daniel Latter
hi,

RE: Matthew Weier O'Phinney

On a Nabble post you refer to a piece of code that enables the passing
of a token:

 class My_XmlRpc_Request extends Zend_XmlRpc_Request_Http
{

public function __construct()
{
parent::__construct();

if ($this->getMethod() != 'login') {
$params = $this->getParams();
$token  = array_shift($params);
$this->setParams($params);

// Verify the token, and then add it to the registry...
Zend_Registry::set('token', $token);
}
}
}

I am correct in thinking that all service method(s) will stay the
same, i.e. - have no reference to the token?

so like this:

/**
 * Add timesheet hours for a candidate
 *
 * @param array Hours for a working week
 * @return array
 */
public function addHours($hours) {

$timesheetService = new Service_Timesheet();
$resp = $timesheetService->addCandidateTimesheetHours($hours);

return $resp;
}


and NOT like this:

/**
 * Add timesheet hours for a candidate
 *
 * @param string token
 * @param array Hours for a working week
 * @return array
 */
public function addHours($token, $hours) {

$timesheetService = new Service_Timesheet();
$resp = $timesheetService->addCandidateTimesheetHours($hours);

return $resp;
}


TIA

Daniel.


Re: [fw-general] Question

2010-08-26 Thread Daniel Latter
Thanks David, I have just started a new job and the code base uses the form:

while($attribute = $result->fetch_assoc()) {

}

I believe this just doesnt sit right, well with me any way, althoug I
understand its also not a major point, but I started to use:

while(false !== ($attribute = $result->fetch_assoc())) {

}

My lead developer says there is no need but I just couldn't articulate
why it was better/safer ( i thought, especially in enterprise app )
the way I did it.

Now I have some ammo :) Thanks guys.

Dan

On 26 August 2010 19:25, David Mintz  wrote:
>
>
> On Thu, Aug 26, 2010 at 2:11 PM, Hector Virgen  wrote:
>>
>> PHP is a loosely-typed language, meaning that the empty string '' will
>> evaluate to false unless you do strict comparisons (=== and !==). For
>> example:
>> $test = FALSE;
>> if ('' != $test) {
>>     // this executes because of loose typing
>> }
>> if ('' !== $test) {
>>    // this doesn't execute because of strict comparison
>> }
>>
>> When testing function return values that may return a number or FALSE, it
>> is best to use strict comparisons:
>> while(false !== ($attribute = $result->fetch_assoc())) {
>> ...
>> }
>> --
>
>
> As I understand it, one reason for putting the literal on the left side of a
> comparison test is to safeguard against introducing a typo/bug when you
> mistakenly type '='  instead of '=='  or '==='
> if ($foo = 346)  {
>
> }
> which in fact is an idiom some of us are fond of, i.,e assigning values
> inside conditionals
> if ($foo = $this->_getParam('something_verbose')) {
>          // work with $foo
> }
>
>
> --
> Support real health care reform:
> http://phimg.org/
>
> --
> David Mintz
> http://davidmintz.org/
>
>
>


[fw-general] Question

2010-08-26 Thread Daniel Latter
Hi All,

forgive me for the simplistic question but looking through ZF source I
see if statements structured like so:

if ('' === $value) {
..
}

is this just to protect against $value being empty?

Consequently, would I be better doing this:

while(false != ($attribute = $result->fetch_assoc())) {
...
}

instead of:

while($attribute = $result->fetch_assoc()) {
..
}

TIA

Dan


Re: [fw-general] Renaming file before upload

2010-07-17 Thread Daniel Latter
Think of what your asking, how could you possibly rename a file before
upload??? It means you would need access to the system where the file
resides.


On Saturday, July 17, 2010, ClintR  wrote:
>
> Hi,
>
> I've been going through the reference guide, this board and Google trying to
> find out how to rename a file before it's uploaded so old files don't get
> overwritten in case filenames are the same. Is it even possible in ZF 1.10?
>
> The reference guide puts nothing in to context so I'm having trouble
> understanding where to place the code it gives for using Zend_File_Transfer.
>
> I found a solution on this board from 2008 that included registering the
> $_FILES superglobal in the bootstrap using:
>
> Zend::register('files',$_FILES);
>
> However, that gives me this error:
> Fatal error: Class 'Zend' not found in
> /Users/Clintonia/Sites/shoppingcenter/application/Bootstrap.php on line 12
>
> So, no luck with that.
>
> Does anyone have a working example or a link to a how-to that actually
> covers this?
>
> Thanks.
> --
> View this message in context: 
> http://zend-framework-community.634137.n4.nabble.com/Renaming-file-before-upload-tp2292597p2292597.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Question about SQL (not ZF related, sorry)

2010-06-30 Thread Daniel Latter
If this is your only use case you could just have one product table
with an extra "tags" column, here you could list the tags space
separated then just do a full text search on that column, this would
only take one query.

Thanks

On Wednesday, June 30, 2010, Aurimas Likas  wrote:
> I want to ask Im sure a really simple question (at laest for most of you). 
> Here is the situation:
>
> I have 3 DB tables: products, tags and products_tags. products_tags has 2 
> columns product_id and tag_id (for many-to-many relationship). So the 
> question is: how can I select products which have tag1 AND tag2 and tag3 and 
>  tagN? I need a best way in terms of performance. The only way I can 
> think of now is to create a query with self joins. The query joins number 
> would equal tags number - 1. Is there a better way? Maybe I miss here 
> something fundamental (think). My project products need a way to be filtered 
> by various tags...
>
> Thanks in advance.
> --
> Aurimas L.
>


[fw-general] Free Design Contest at 99designs.com

2010-06-24 Thread Daniel Latter
We did it!  We won a prestigious Webby Award.  To celebrate,
Friday June 25 is 'Free Contest Day' at 99designs.  It's our way
of saying THANK YOU for your vote.

1. Return to 99designs any time on Friday June 25, PDT.

http://99designs.com/go/freecontestday

2. Decide what you need designed, such a new brochure to attract
more clients, new banner ads to grow website traffic, event
invitation cards for an upcoming party, or maybe some attention
grabbing business cards.

3. Click the 'post a design project' button to launch a contest.
We'll pay your listing fee, which means you'll only need to cover
the processing fee, prize and any optional upgrades you pick.
You'll instantly save $39.

Be sure to return to 99designs on 'Free Contest Day' to take
advantage of this one-time offer.  This really is a low-risk,
cost-effective way to get a custom design you love or your money
back!

http://99designs.com/go/freecontestday


Re: [fw-general] Question: Deleting an action

2010-06-24 Thread Daniel Latter
What about project xml file?

Thanks.
Dan

On 24 June 2010 18:46, Nilesh Govindarajan  wrote:

> On 06/22/2010 05:23 PM, Parham Doustdar wrote:
>
>> Hi,
>>
>> As I was learning the Zend framework, I accidentally entered:
>> [code]
>> c:\>zf create action sucess account
>> [/code]
>>
>> Then, afterwards, as I wanted to delete this action and enter "success"
>> instead, i found no command. Should I remove the created files, and the
>> entry in the project XML file, by hand? or there's something I'm missing?
>>
>> Thanks!
>>
>
> No need, just edit controllers/AccountController.php and change the name.
>
> --
> Regards,
> Nilesh Govindarajan
> Facebook: http://www.facebook.com/nilesh.gr
> Twitter: http://twitter.com/nileshgr
> Website: http://www.itech7.com
> Cheap and Reliable VPS Hosting: http://j.mp/arHk5e
>


Re: [fw-general] Question: Deleting an action

2010-06-22 Thread Daniel Latter

Hi,

There is no delete action for Zend_Tool, I do it manually.

In this case you could probably just make amendments, to the  
controller class and XML file.


Thanks.

On 22 Jun 2010, at 12:53, Parham Doustdar  wrote:


Hi,

As I was learning the Zend framework, I accidentally entered:
[code]
c:\>zf create action sucess account
[/code]

Then, afterwards, as I wanted to delete this action and enter  
"success" instead, i found no command. Should I remove the created  
files, and the entry in the project XML file, by hand? or there's  
something I'm missing?


Thanks!


[fw-general] Zend_Naviagtion Breadcrumb With Custom Routes

2010-06-14 Thread Daniel Latter
Hi All,

I have a route: */sports/item/*

Now I am using Zend_Navigation to print out some breadcrumbs.

I am using the following config:

resources.navigation.pages.page1.pages.page3.type =
"Zend_Navigation_Page_Uri"
resources.navigation.pages.page1.pages.page3.label = "Sport"
resources.navigation.pages.page1.pages.page3.uri = "/sports/"
resources.navigation.pages.page1.pages.page3.route = "item"
resources.navigation.pages.page1.pages.page3.params.topicName = "sports"
resources.navigation.pages.page1.pages.page3.pages.page1.type =
"Zend_Navigation_Page_Uri"
resources.navigation.pages.page1.pages.page3.pages.page1.label = "Sport
Item"
resources.navigation.pages.page1.pages.page3.pages.page1.uri =
"/sports/item/"
resources.navigation.pages.page1.pages.page3.pages.page1.route =
"singleItem"
resources.navigation.pages.page1.pages.page3.pages.page1.params.topicName =
"sports"
resources.navigation.pages.page1.pages.page3.pages.page1.params.title= ""

On my breadcrumbs I am only seeing: */sports/item/* but I would like to
see: */sports/item/*. Do I have to use $page->setLabel()? or can I
pick up
the route params (title, topicName) and use those?


Any help would be great,

Thanks
Dan


[fw-general] Re: Passing Pagination Page Param with Custom Route

2010-06-10 Thread Daniel Latter
Hi,

Managed to get it to work by changing route type:

$route = new Zend_Controller_Router_Route(
':topicName/list/:page',
array(
'page' => 1,
'controller' => 'item',
'action' => 'list'
),
array('topicName'  =>
'(news|sports|movies|music|television|technology|showbiz)')
    );
$router->addRoute('multipleItem', $route);

Thanks

On 10 June 2010 11:11, Daniel Latter  wrote:

> Hi All,
>
> I am using a Zend_Controller_Router_Route_Regex like so:
>
> '(news|sports|movies|music|television|technology|showbiz)/list',
>
> What do I need to add to the regex above so it I can also pick up
> pagination values for use
> with Zend_Paginator?
>
> I have tried:
> '(news|sports|movies|music|television|technology|showbiz)/list/*',
> '(news|sports|movies|music|television|technology|showbiz)/list/page/(\d+)',
>
> I am using the url helper to make the url in my pagination view script so
> do I need to pass the named route into
> the url helper also?
>
> Heres my full route:
> $route = new Zend_Controller_Router_Route_Regex(
>
> '(news|sports|movies|music|television|technology|showbiz)/list',
> array(
> 'controller' => 'item',
> 'action' => 'list'
> ),
> array(
> 1 => 'topicName'
> )
> );
> $router->addRoute('multipleItem', $route);
>
> Thanks a lot guys.
> Dan
>
>
>
>
>


[fw-general] Passing Pagination Page Param with Custom Route

2010-06-10 Thread Daniel Latter
Hi All,

I am using a Zend_Controller_Router_Route_Regex like so:

'(news|sports|movies|music|television|technology|showbiz)/list',

What do I need to add to the regex above so it I can also pick up pagination
values for use
with Zend_Paginator?

I have tried:
'(news|sports|movies|music|television|technology|showbiz)/list/*',
'(news|sports|movies|music|television|technology|showbiz)/list/page/(\d+)',

I am using the url helper to make the url in my pagination view script so do
I need to pass the named route into
the url helper also?

Heres my full route:
$route = new Zend_Controller_Router_Route_Regex(
'(news|sports|movies|music|television|technology|showbiz)/list',
array(
'controller' => 'item',
'action' => 'list'
),
array(
1 => 'topicName'
)
);
$router->addRoute('multipleItem', $route);

Thanks a lot guys.
Dan


Re: [fw-general] Generate WSDL

2010-06-04 Thread Daniel Latter
Brilliant! lol

On 4 June 2010 20:10, Johnny Bravo  wrote:

> http://tinyurl.com/3ykhgr4
>
> On 6/4/10, robert mena  wrote:
> > Hi,
> >
> > Is there a way to generate the WSDL file from a class using a Zend
> > component?
> >
>


Re: [fw-general] Feeds

2010-06-03 Thread Daniel Latter
Hi,

Just to re-ignite this thread,

I came across the following site: *http://www.onenewspage.co.uk*, it
contradicts our initial assessment of Google getting "special treatment" as
some of the stories form BBC are very fresh, like: "5 minutes ago", do you
think these too get special treatment? (its hard to imagine they do?)

Ive also checked all feeds from BBC and they do not include the fresh
stories that the website above shows? - any thoughts? - Screen Scraping
perhaps?

Thanks.


On 1 June 2010 20:50, Daniel Latter  wrote:

> Thanks for the info Guys.
>
>
>
> On 28 May 2010 22:18, Pádraic Brady  wrote:
>
>> Google doesn't receive instant updates from BBC - it just retrieves the
>> feed every few minutes. There's a difference between frequent polling and
>> real-time updates. The first can be done with any platform - just use a GET
>> request. The second requires active pings from a Publisher so a Hub can
>> notify Subscribers. What you're describing is subtly different, that BBC
>> feeds are updated after Google is notified? This could be a simple case of
>> highly focused optimisation - allow Google access to fresh feed generation
>> (filter by Google's domain) while the general public get a cached feed
>> updated every 10-15 minutes. Would be simple to architect and ensures Google
>> always get the fresh content ASAP for indexing.
>>
>> The only proactive instant update mechanisms getting wider usage are
>> Pubsubhubbub and RSS Cloud. BBC implement neither at the moment, so you are
>> stuck with polling for now, or using an offsite service (e.g. Superfeedr)
>> which does 10 minute polling and updates via PuSH.
>>
>> Paddy
>>
>> Pádraic Brady
>>
>> http://blog.astrumfutura.com
>> http://www.survivethedeepend.com
>> OpenID Europe Foundation Irish Representative<http://www.openideurope.eu/>
>>
>>
>> --
>> *From:* Daniel Latter 
>> *To:* Bradley Holt 
>> *Cc:* Zend Framework General 
>> *Sent:* Fri, May 28, 2010 12:47:12 PM
>> *Subject:* Re: [fw-general] Feeds
>>
>> Maybe I am misunderstanding but how can I use PuSH for a BBC feed if they
>> don't support it? because doesn't a publisher ping the hub to notify of an
>> update?
>>
>> So saying that, I am wondering how Google Reader gets instant updates from
>> a BBC feed?
>>
>> On 28 May 2010 01:21, Bradley Holt  wrote:
>>
>>> On Thu, May 27, 2010 at 7:42 PM, Daniel Latter wrote:
>>>
>>>> Hi all,
>>>>
>>>> I'm processing feeds with Zend_Feed and I am wondering how to get
>>>> instant feed updates like Google reader?
>>>>
>>>> For example, I consume a feed from bbc.co.uk and get a pubDate for each
>>>> item, but if I look in Google reader at same feed I can see that it has
>>>> been/gets updated almost instantly with new items? But the propoagtion to
>>>> the feed takes much longer?
>>>>
>>>> Now I know about the pubsubhubbub class that ZF provides that enables
>>>> "real time web" but that is still relatively new.
>>>>
>>>>
>>> Why is its "newness" a reason not to use it?
>>>
>>>
>>>> So I guess my question is how can I architect real time feed updates
>>>> like Google Reader.?
>>>>
>>>>
>>> I'd just use PubSubHubbub and not reinvent the wheel :-)
>>>
>>>
>>>> Thanks
>>>> Dan
>>>
>>>
>>>
>>
>


Re: [fw-general] Feeds

2010-06-01 Thread Daniel Latter
Thanks for the info Guys.


On 28 May 2010 22:18, Pádraic Brady  wrote:

> Google doesn't receive instant updates from BBC - it just retrieves the
> feed every few minutes. There's a difference between frequent polling and
> real-time updates. The first can be done with any platform - just use a GET
> request. The second requires active pings from a Publisher so a Hub can
> notify Subscribers. What you're describing is subtly different, that BBC
> feeds are updated after Google is notified? This could be a simple case of
> highly focused optimisation - allow Google access to fresh feed generation
> (filter by Google's domain) while the general public get a cached feed
> updated every 10-15 minutes. Would be simple to architect and ensures Google
> always get the fresh content ASAP for indexing.
>
> The only proactive instant update mechanisms getting wider usage are
> Pubsubhubbub and RSS Cloud. BBC implement neither at the moment, so you are
> stuck with polling for now, or using an offsite service (e.g. Superfeedr)
> which does 10 minute polling and updates via PuSH.
>
> Paddy
>
> Pádraic Brady
>
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative<http://www.openideurope.eu/>
>
>
> --
> *From:* Daniel Latter 
> *To:* Bradley Holt 
> *Cc:* Zend Framework General 
> *Sent:* Fri, May 28, 2010 12:47:12 PM
> *Subject:* Re: [fw-general] Feeds
>
> Maybe I am misunderstanding but how can I use PuSH for a BBC feed if they
> don't support it? because doesn't a publisher ping the hub to notify of an
> update?
>
> So saying that, I am wondering how Google Reader gets instant updates from
> a BBC feed?
>
> On 28 May 2010 01:21, Bradley Holt  wrote:
>
>> On Thu, May 27, 2010 at 7:42 PM, Daniel Latter wrote:
>>
>>> Hi all,
>>>
>>> I'm processing feeds with Zend_Feed and I am wondering how to get instant
>>> feed updates like Google reader?
>>>
>>> For example, I consume a feed from bbc.co.uk and get a pubDate for each
>>> item, but if I look in Google reader at same feed I can see that it has
>>> been/gets updated almost instantly with new items? But the propoagtion to
>>> the feed takes much longer?
>>>
>>> Now I know about the pubsubhubbub class that ZF provides that enables
>>> "real time web" but that is still relatively new.
>>>
>>>
>> Why is its "newness" a reason not to use it?
>>
>>
>>> So I guess my question is how can I architect real time feed updates like
>>> Google Reader.?
>>>
>>>
>> I'd just use PubSubHubbub and not reinvent the wheel :-)
>>
>>
>>> Thanks
>>> Dan
>>
>>
>>
>


Re: [fw-general] Feeds

2010-05-28 Thread Daniel Latter
Maybe I am misunderstanding but how can I use PuSH for a BBC feed if they
don't support it? because doesn't a publisher ping the hub to notify of an
update?

So saying that, I am wondering how Google Reader gets instant updates from a
BBC feed?

On 28 May 2010 01:21, Bradley Holt  wrote:

> On Thu, May 27, 2010 at 7:42 PM, Daniel Latter wrote:
>
>> Hi all,
>>
>> I'm processing feeds with Zend_Feed and I am wondering how to get instant
>> feed updates like Google reader?
>>
>> For example, I consume a feed from bbc.co.uk and get a pubDate for each
>> item, but if I look in Google reader at same feed I can see that it has
>> been/gets updated almost instantly with new items? But the propoagtion to
>> the feed takes much longer?
>>
>> Now I know about the pubsubhubbub class that ZF provides that enables
>> "real time web" but that is still relatively new.
>>
>>
> Why is its "newness" a reason not to use it?
>
>
>> So I guess my question is how can I architect real time feed updates like
>> Google Reader.?
>>
>>
> I'd just use PubSubHubbub and not reinvent the wheel :-)
>
>
>> Thanks
>> Dan
>
>
>


Re: [fw-general] Re: Zend_Feed findFeeds don't find all feeds on a page

2010-05-27 Thread Daniel Latter
I've realised my question is moot because it's simplexml that's  
processing the XML, no zf.


Soz.
Dan

On 27 May 2010, at 21:06, Pádraic Brady   
wrote:


Have you tried using Zend_Feed_Reader? If it has the same problem,  
create an issue for it and I'll look into it before the weekend.


Paddy

Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative


From: Stefan Sturm 
To: fw-general@lists.zend.com
Sent: Wed, May 26, 2010 8:23:37 AM
Subject: Fwd: [fw-general] Re: Zend_Feed findFeeds don't find all  
feeds on a page


Hello,

> OK, the first 2 are being found because of the 'ö' entity in  
the title

> attribute.

this is the html entity code for a german umlaut(
http://en.wikipedia.org/wiki/Umlaut_(diacritic)#HTML ).

> This throws the following error: Entity 'ouml' not defined in 

does this mean, that I can't find feeds containing a german umlaut?

Greetings,
Stefan Sturm


> Dan.
>
> On 25 May 2010 15:48, Stefan Sturm   
wrote:

>>
>> Hallo Daniel,
>>
>> thanks for your answer. I allready did this, but I can't find  
anything.

>> Here is the code from the page( www.torfabrik.de ):
>>
>> 
>> > href="http://torfabrik.de/profis/rss.xml"; />
>> > href="http://torfabrik.de/nachwuchs/rss.xml"; />
>> > href="http://torfabrik.de/einwurf/rss.xml"; />
>> > href="http://torfabrik.de/querpass/rss.xml"; />
>> > href="http://torfabrik.de/kurzpass/rss.xml"; />
>> 
>> He finds only the last 3 feeds, not the first 2...
>>
>> And here from another page( www.mactechnews.de ):
>> > type="application/rss+xml" title="News" />
>> > type="application/rss+xml" title="Journals" />
>> > type="application/rss+xml" title="Forum" />
>> Here he only finds the first feed and not the last two...
>>
>> Perhaps somebody can find a difference...
>>
>> Thanks and greetings,
>> Stefan Sturm
>>
>> 2010/5/25 Daniel Latter :
>> >
>> >
>> > -- Forwarded message --
>> > From: Daniel Latter 
>> > Date: 25 May 2010 15:25
>> > Subject: Re: [fw-general] Re: Zend_Feed findFeeds don't find  
all feeds

>> > on a
>> > page
>> > To: Stefan Sturm 
>> >
>> >
>> > Look at the 2 feeds it doesnt find and see if you can spot a  
pattern.

>> >
>> > What the difference between the feeds it finds and the feeds it  
doesnt.

>> >
>> > Maybe these will give you more answers.
>> >
>> >
>> > On 25 May 2010 15:08, Stefan Sturm  


>> > wrote:
>> >>
>> >> Hallo,
>> >>
>> >> no one with an Idea on this?
>> >>
>> >> Greetings,
>> >> Stefan Sturm
>> >>
>> >> 2010/5/20 Stefan Sturm :
>> >> > Hello,
>> >> >
>> >> > I try to find all feeds of a page using Zend_Feed::findFeeds 
().

>> >> > But it does not find all feeds from a page. Take this example:
>> >> > http://www.torfabrik.de
>> >> >
>> >> > findFeed shows me 3 feeds, but there are 5 feeds on ths  
site...

>> >> >
>> >> > What can be the problem here?
>> >> >
>> >> > Thanks and greetings,
>> >> > Stefan Sturm
>> >> >
>> >
>> >
>> >
>
>


Re: [fw-general] Re: Zend_Feed findFeeds don't find all feeds on a page

2010-05-27 Thread Daniel Latter

Hi,

I did the test for Stefan, I will look and get back.

On another note, when I am processing rss feeds the return value for  
the  element will be a string value, but for the odd feed  
the return value is an array and i have ro use nodeValue, to get  
description value, Is this intended behaviour?


Thanks.

On 27 May 2010, at 21:06, Pádraic Brady   
wrote:


Have you tried using Zend_Feed_Reader? If it has the same problem,  
create an issue for it and I'll look into it before the weekend.


Paddy

Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative


From: Stefan Sturm 
To: fw-general@lists.zend.com
Sent: Wed, May 26, 2010 8:23:37 AM
Subject: Fwd: [fw-general] Re: Zend_Feed findFeeds don't find all  
feeds on a page


Hello,

> OK, the first 2 are being found because of the 'ö' entity in  
the title

> attribute.

this is the html entity code for a german umlaut(
http://en.wikipedia.org/wiki/Umlaut_(diacritic)#HTML ).

> This throws the following error: Entity 'ouml' not defined in 

does this mean, that I can't find feeds containing a german umlaut?

Greetings,
Stefan Sturm


> Dan.
>
> On 25 May 2010 15:48, Stefan Sturm   
wrote:

>>
>> Hallo Daniel,
>>
>> thanks for your answer. I allready did this, but I can't find  
anything.

>> Here is the code from the page( www.torfabrik.de ):
>>
>> 
>> > href="http://torfabrik.de/profis/rss.xml"; />
>> > href="http://torfabrik.de/nachwuchs/rss.xml"; />
>> > href="http://torfabrik.de/einwurf/rss.xml"; />
>> > href="http://torfabrik.de/querpass/rss.xml"; />
>> > href="http://torfabrik.de/kurzpass/rss.xml"; />
>> 
>> He finds only the last 3 feeds, not the first 2...
>>
>> And here from another page( www.mactechnews.de ):
>> > type="application/rss+xml" title="News" />
>> > type="application/rss+xml" title="Journals" />
>> > type="application/rss+xml" title="Forum" />
>> Here he only finds the first feed and not the last two...
>>
>> Perhaps somebody can find a difference...
>>
>> Thanks and greetings,
>> Stefan Sturm
>>
>> 2010/5/25 Daniel Latter :
>> >
>> >
>> > -- Forwarded message --
>> > From: Daniel Latter 
>> > Date: 25 May 2010 15:25
>> > Subject: Re: [fw-general] Re: Zend_Feed findFeeds don't find  
all feeds

>> > on a
>> > page
>> > To: Stefan Sturm 
>> >
>> >
>> > Look at the 2 feeds it doesnt find and see if you can spot a  
pattern.

>> >
>> > What the difference between the feeds it finds and the feeds it  
doesnt.

>> >
>> > Maybe these will give you more answers.
>> >
>> >
>> > On 25 May 2010 15:08, Stefan Sturm  


>> > wrote:
>> >>
>> >> Hallo,
>> >>
>> >> no one with an Idea on this?
>> >>
>> >> Greetings,
>> >> Stefan Sturm
>> >>
>> >> 2010/5/20 Stefan Sturm :
>> >> > Hello,
>> >> >
>> >> > I try to find all feeds of a page using Zend_Feed::findFeeds 
().

>> >> > But it does not find all feeds from a page. Take this example:
>> >> > http://www.torfabrik.de
>> >> >
>> >> > findFeed shows me 3 feeds, but there are 5 feeds on ths  
site...

>> >> >
>> >> > What can be the problem here?
>> >> >
>> >> > Thanks and greetings,
>> >> > Stefan Sturm
>> >> >
>> >
>> >
>> >
>
>


[fw-general] Feeds

2010-05-27 Thread Daniel Latter

Hi all,

I'm processing feeds with Zend_Feed and I am wondering how to get  
instant feed updates like Google reader?


For example, I consume a feed from bbc.co.uk and get a pubDate for  
each item, but if I look in Google reader at same feed I can see that  
it has been/gets updated almost instantly with new items? But the  
propoagtion to the feed takes much longer?


Now I know about the pubsubhubbub class that ZF provides that enables  
"real time web" but that is still relatively new.


So I guess my question is how can I architect real time feed updates  
like Google Reader.?


Thanks
Dan 


Fwd: [fw-general] Re: Zend_Feed findFeeds don't find all feeds on a page

2010-05-25 Thread Daniel Latter


Sorry, the below should say 'not being found' ...

Begin forwarded message:


From: Daniel Latter 
Date: 25 May 2010 16:04:42 GMT+01:00
To: Stefan Sturm 
Cc: Zend Framework General 
Subject: Re: [fw-general] Re: Zend_Feed findFeeds don't find all  
feeds on a page






Hi,

OK, the first 2 are being found because of the 'ö' entity in the  
title attribute.


This throws the following error: Entity 'ouml' not defined in 

Each link findFeeds finds gets passed to simplexml_load_string(),  
this function is returning false because of the undefined entity. I  
think its an error on the feed makers part.


Dan.

On 25 May 2010 15:48, Stefan Sturm   
wrote:

Hallo Daniel,

thanks for your answer. I allready did this, but I can't find  
anything.

Here is the code from the page( www.torfabrik.de ):


http://torfabrik.de/profis/rss.xml"; />
http://torfabrik.de/nachwuchs/rss.xml"; />
http://torfabrik.de/einwurf/rss.xml"; />
http://torfabrik.de/querpass/rss.xml"; />
http://torfabrik.de/kurzpass/rss.xml"; />

He finds only the last 3 feeds, not the first 2...

And here from another page( www.mactechnews.de ):



Here he only finds the first feed and not the last two...

Perhaps somebody can find a difference...

Thanks and greetings,
Stefan Sturm

2010/5/25 Daniel Latter :
>
>
> -- Forwarded message --
> From: Daniel Latter 
> Date: 25 May 2010 15:25
> Subject: Re: [fw-general] Re: Zend_Feed findFeeds don't find all  
feeds on a

> page
> To: Stefan Sturm 
>
>
> Look at the 2 feeds it doesnt find and see if you can spot a  
pattern.

>
> What the difference between the feeds it finds and the feeds it  
doesnt.

>
> Maybe these will give you more answers.
>
>
> On 25 May 2010 15:08, Stefan Sturm   
wrote:

>>
>> Hallo,
>>
>> no one with an Idea on this?
>>
>> Greetings,
>> Stefan Sturm
>>
>> 2010/5/20 Stefan Sturm :
>> > Hello,
>> >
>> > I try to find all feeds of a page using Zend_Feed::findFeeds().
>> > But it does not find all feeds from a page. Take this example:
>> > http://www.torfabrik.de
>> >
>> > findFeed shows me 3 feeds, but there are 5 feeds on ths site...
>> >
>> > What can be the problem here?
>> >
>> > Thanks and greetings,
>> > Stefan Sturm
>> >
>
>
>



Re: [fw-general] Re: Zend_Feed findFeeds don't find all feeds on a page

2010-05-25 Thread Daniel Latter
Hi,

OK, the first 2 are being found because of the 'ö' entity in the title
attribute.

This throws the following error: *Entity 'ouml' not defined in *

Each link findFeeds finds gets passed to simplexml_load_string(), this
function is returning false because of the undefined entity. I think its an
error on the feed makers part.

Dan.

On 25 May 2010 15:48, Stefan Sturm  wrote:

> Hallo Daniel,
>
> thanks for your answer. I allready did this, but I can't find anything.
> Here is the code from the page( www.torfabrik.de ):
>
> 
>  href="http://torfabrik.de/profis/rss.xml"; />
>  href="http://torfabrik.de/nachwuchs/rss.xml"; />
>  href="http://torfabrik.de/einwurf/rss.xml"; />
>  href="http://torfabrik.de/querpass/rss.xml"; />
>  href="http://torfabrik.de/kurzpass/rss.xml"; />
> 
> He finds only the last 3 feeds, not the first 2...
>
> And here from another page( www.mactechnews.de ):
>  type="application/rss+xml" title="News" />
>  type="application/rss+xml" title="Journals" />
>  type="application/rss+xml" title="Forum" />
> Here he only finds the first feed and not the last two...
>
> Perhaps somebody can find a difference...
>
> Thanks and greetings,
> Stefan Sturm
>
> 2010/5/25 Daniel Latter :
> >
> >
> > -- Forwarded message --
> > From: Daniel Latter 
> > Date: 25 May 2010 15:25
> > Subject: Re: [fw-general] Re: Zend_Feed findFeeds don't find all feeds on
> a
> > page
> > To: Stefan Sturm 
> >
> >
> > Look at the 2 feeds it doesnt find and see if you can spot a pattern.
> >
> > What the difference between the feeds it finds and the feeds it doesnt.
> >
> > Maybe these will give you more answers.
> >
> >
> > On 25 May 2010 15:08, Stefan Sturm 
> wrote:
> >>
> >> Hallo,
> >>
> >> no one with an Idea on this?
> >>
> >> Greetings,
> >> Stefan Sturm
> >>
> >> 2010/5/20 Stefan Sturm :
> >> > Hello,
> >> >
> >> > I try to find all feeds of a page using Zend_Feed::findFeeds().
> >> > But it does not find all feeds from a page. Take this example:
> >> > http://www.torfabrik.de
> >> >
> >> > findFeed shows me 3 feeds, but there are 5 feeds on ths site...
> >> >
> >> > What can be the problem here?
> >> >
> >> > Thanks and greetings,
> >> > Stefan Sturm
> >> >
> >
> >
> >
>


Fwd: [fw-general] Re: Zend_Feed findFeeds don't find all feeds on a page

2010-05-25 Thread Daniel Latter
-- Forwarded message --
From: Daniel Latter 
Date: 25 May 2010 15:25
Subject: Re: [fw-general] Re: Zend_Feed findFeeds don't find all feeds on a
page
To: Stefan Sturm 


Look at the 2 feeds it doesnt find and see if you can spot a pattern.

What the difference between the feeds it finds and the feeds it doesnt.

Maybe these will give you more answers.



On 25 May 2010 15:08, Stefan Sturm  wrote:

> Hallo,
>
> no one with an Idea on this?
>
> Greetings,
> Stefan Sturm
>
> 2010/5/20 Stefan Sturm :
> > Hello,
> >
> > I try to find all feeds of a page using Zend_Feed::findFeeds().
> > But it does not find all feeds from a page. Take this example:
> > http://www.torfabrik.de
> >
> > findFeed shows me 3 feeds, but there are 5 feeds on ths site...
> >
> > What can be the problem here?
> >
> > Thanks and greetings,
> > Stefan Sturm
> >
>


Re: [fw-general] Zend_Config and versioning

2010-05-24 Thread Daniel Latter
You could use separate XML files, then extend Zend_Config class to add
behaviour that switches between versions?

On Monday, May 24, 2010, Hector Virgen  wrote:
> Hello,
> We are using a Zend_Config object for Zend_Navigation (as suggested in the 
> docs[1]). We need to version-ize our navigation (1.0, 1.1, 1.2, etc.) in 
> order to meet client needs. Does Zend_Config support versions? If not, is 
> there a way to cleverly emulate versioning support?
>
>
> I know I can probably "extend" a previous version, but AFAIK, I can only add 
> to the section I'm extending from. In other words, I can't "remove" a page 
> from 1.1 to create 1.2.
>
>
> Some other ideas are:Create separate XML files for each versionCreate each 
> version in a new section that doesn't extend another sectionAny thoughts?
>
>
> 1. http://framework.zend.com/manual/1.8/en/zend.navigation.containers.html
> --
> Hector
>
>


Re: [fw-general] Re: Saving many Zend_Db_Table_Rows in for loop

2010-05-24 Thread Daniel Latter
Does it work without quoteInto?

If it does, you could do escape/filter the values yourself and then use
Zend_Db_Expr to create expression? OR Just generate string for use in
where() method yourself.

On 24 May 2010 14:06, Саша Стаменковић  wrote:

> Yeah, quoteInto connects to db for every quoted value, and that breaks my
> limit of 15 queries at once, even I only run one select and one update
> query, it quotes array of values. What should I do?
>
> Regards,
> Saša Stamenković
>
>
>
> On Thu, May 20, 2010 at 3:14 PM, Саша Стаменковић wrote:
>
>> Only in development environment :)
>>
>> Thanks.
>>
>> Regards,
>> Saša Stamenković
>>
>>
>>
>> On Thu, May 20, 2010 at 3:13 PM, Daniel Latter wrote:
>>
>>>
>>> Ive heard about a problem with the zf debug bar where it creates extra
>>> connections? are you using this?
>>>
>>>
>>> On 20 May 2010 14:07, Саша Стаменковић  wrote:
>>>
>>>> I'm on shared hosting, so I can't do that.
>>>>
>>>> I'm quoting like this:
>>>>
>>>> return $this->fetchAll(
>>>> $this->select()
>>>>  ->from($this->_name)
>>>> ->where($this->getAdapter()->quoteInto($this->_name . '.id IN (?)',
>>>> $ids, Zend_Db::INT_TYPE))
>>>>  ->order('date DESC')
>>>> );
>>>>
>>>> where $ids is array of table primary keys.
>>>>
>>>> Regards,
>>>> Saša Stamenković
>>>>
>>>>
>>>>
>>>> On Thu, May 20, 2010 at 3:02 PM, Thomas D. wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Саша Стаменковић wrote:
>>>>> > I don't know how to monitor mysqld, maybe get connection
>>>>> > from adapter with getConnection() and then retreive it from there and
>>>>> log?
>>>>>
>>>>> No. Monitoring your mysqld has nothing to do with PHP.
>>>>>
>>>>> If you are on Unix or FreeBSD, you would use a tool like "mtop".
>>>>> If you are on Windows you can use the MySQL Administrator from
>>>>> mysql.org.
>>>>>
>>>>>
>>>>> P.s.: When you are quoting, how do you do that?
>>>>> $table = new MyZendTable();
>>>>> $adapter = $table->getAdapter();
>>>>>
>>>>> $quoted_string = $adapter->quote(...);
>>>>>
>>>>> If you are using "getConnection()" you will create an additional
>>>>> connection/object and won't use the existing one.
>>>>> Maybe this is your problem...
>>>>>
>>>>>
>>>>> --
>>>>> Regards,
>>>>> Thomas
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>


Re: [fw-general] Re: Saving many Zend_Db_Table_Rows in for loop

2010-05-20 Thread Daniel Latter
Ive heard about a problem with the zf debug bar where it creates extra
connections? are you using this?

On 20 May 2010 14:07, Саша Стаменковић  wrote:

> I'm on shared hosting, so I can't do that.
>
> I'm quoting like this:
>
> return $this->fetchAll(
> $this->select()
>  ->from($this->_name)
> ->where($this->getAdapter()->quoteInto($this->_name . '.id IN (?)', $ids,
> Zend_Db::INT_TYPE))
>  ->order('date DESC')
> );
>
> where $ids is array of table primary keys.
>
> Regards,
> Saša Stamenković
>
>
>
> On Thu, May 20, 2010 at 3:02 PM, Thomas D. wrote:
>
>> Hi,
>>
>> Саша Стаменковић wrote:
>> > I don't know how to monitor mysqld, maybe get connection
>> > from adapter with getConnection() and then retreive it from there and
>> log?
>>
>> No. Monitoring your mysqld has nothing to do with PHP.
>>
>> If you are on Unix or FreeBSD, you would use a tool like "mtop".
>> If you are on Windows you can use the MySQL Administrator from mysql.org.
>>
>>
>> P.s.: When you are quoting, how do you do that?
>> $table = new MyZendTable();
>> $adapter = $table->getAdapter();
>>
>> $quoted_string = $adapter->quote(...);
>>
>> If you are using "getConnection()" you will create an additional
>> connection/object and won't use the existing one.
>> Maybe this is your problem...
>>
>>
>> --
>> Regards,
>> Thomas
>>
>>
>>
>


Re: [fw-general] zend_mail and microsoft exchange

2010-05-13 Thread Daniel Latter
Are you sending the emails from a script on a windows box? If so, try just
using the email address in the to/form sections, instead of the form:

"Something "

Thanks

On 13 May 2010 17:18, darthtina  wrote:

>
> Hello All,
>
>
>
>
> Thanks for helping!  I had my unix server setup to use a pop account for
> sending mail and have now changed it to an exchange account to send my mail
> through.  I am just using smtp & zend_mail to send the basic text emails.
> When I switch to the exchange account I get this error:
>
>
> 501 5.1.3 Invalid address
>
>
> Here are my facts:
>
> 1.  If I switch to the wrong password I get an authentication error, so I
> know that the invalid address is referring to the address I'm sending to.
> 2.  If I change the address I'm sending to, I get the same error.
> 3.  If I switch back to my pop account all is well.
>
> So, I think that maybe the format of the email address is somehow wrong?
>  Or
> I need to handle the communication differently somehow?
>
> Thanks in advance!!!
>
>  ~Christina
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/zend-mail-and-microsoft-exchange-tp219p219.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] create tree from arrays

2010-05-13 Thread Daniel Latter
To clarify more on the link I posted, in contains a view helper that takes a
flat array (with 'parentID' element), and outputs a tree. When I said
function I meant on object method.

Thanks

On 13 May 2010 14:56, Ralph Schindler  wrote:

> There are a couple of ways to go about buiding and recursing "trees" in
> PHP.  Utilizing functions to do it is one route.
>
> The more object-oriented route would be to build a tree structure around
> SPL's RecursiveIterator, and RecursiveIteratorIterator.
>
> A component in Zend Framework that does this is Zend_Navigation. It can
> have infinitely deep nodes.
>
>
> http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Navigation.php
>
> http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Navigation/
>
> Another component to look at is Zend_Tool_Project_Profile.  This creates a
> Tree based off an xml file that can then be searched and iterated.
>
>
> http://framework.zend.com/svn/framework/standard/trunk/library/Zend/Tool/Project/
>
> It might take some time to wrap your head around RI and RII, but in the end
> you might find its worth it to have each node as an object.  I makes your
> "tree" code more maintainable.
>
> -ralph
>
>
> shahrzad khorrami wrote:
>
>>
>> hi all,
>>
>> I want to create an array from another array to create json file in my
>> format and pass it to a js libraryok.
>> I just know that I have to use recursive function... but how? it's hard
>> for me to create the new array..
>>
>> main array:
>>
>> Array
>> (
>>[0] => Array
>>(
>>[nid] => 1
>>[parentID] => 0
>>[text] => Dashboard
>>[cls] => x-btn-icon
>>[icon] => lib/extjs/resources/images/default/icon/Dashboard.png
>>[singleClickExpand] => 1
>>[leaf] => 0
>>[id] => Dashboard
>>)
>>
>>[1] => Array
>>(
>>[nid] => 2
>>[parentID] => 1
>>[text] => Dashboard
>>[cls] => firstExpanded
>>[icon] => lib/extjs/resources/images/default/tree/s.gif
>>[singleClickExpand] => 1
>>[leaf] => 0
>>[id] =>
>>)
>>
>>[2] => Array
>>(
>>[nid] => 3
>>[parentID] => 2
>>[text] => Dashboard
>>[cls] => x-btn-icon
>>[icon] => lib/extjs/resources/images/default/tree/s.gif
>>[singleClickExpand] => 1
>>[leaf] => 1
>>[id] => dashboard
>>)
>> ...
>>
>>
>> -- The array I want to create: 
>>
>>[0] => Array
>>(
>>[nid] => 1
>>[parentID] => 0
>>[text] => Dashboard
>>[cls] => x-btn-icon
>>[icon] => lib/extjs/resources/images/default/icon/Dashboard.png
>>[singleClickExpand] => 1
>>[leaf] => 0
>>[id] => Dashboard
>>[children] => Array(
>> [0] => Array
>>(
>>[nid] => 2
>>[parentID] => 1
>>[text] => Dashboard
>>[cls] => firstExpanded
>>[icon] =>
>> lib/extjs/resources/images/default/tree/s.gif
>>[singleClickExpand] => 1
>>[leaf] => 0
>>[id] =>
>>[children] => Array(
>>[0] => Array
>>(
>>  [nid] => 3
>>  [parentID] => 2
>>  [text] => Dashboard
>>  [cls] => x-btn-icon
>>  [icon] =>
>> lib/extjs/resources/images/default/tree/s.gif
>>  [singleClickExpand]
>> => 1
>>  [leaf] => 1
>>  [id] => dashboard
>>  )
>>)
>>)
>>)
>>)
>>
>> .
>> wow!
>> it means that by nid and parentID, I'll notice where I must add children
>> item to array...
>>
>> Thanks,
>> Shahrzad
>>
>>
>>
>>


[fw-general] create tree from arrays

2010-05-13 Thread Daniel Latter
Hi,

Have a look at: http://www.box.net/shared/fdyp2h2yrp

It includes a recursive function you could use to build your tree.

Thanks
Dan

On 13 May 2010 10:51, shahrzad khorrami  wrote:

>
> hi all,
>
> I want to create an array from another array to create json file in my
> format and pass it to a js libraryok.
> I just know that I have to use recursive function... but how? it's hard for
> me to create the new array..
>
> main array:
>
> Array
> (
> [0] => Array
> (
> [nid] => 1
> [parentID] => 0
> [text] => Dashboard
> [cls] => x-btn-icon
> [icon] => lib/extjs/resources/images/default/icon/Dashboard.png
> [singleClickExpand] => 1
> [leaf] => 0
> [id] => Dashboard
> )
>
> [1] => Array
> (
> [nid] => 2
> [parentID] => 1
> [text] => Dashboard
> [cls] => firstExpanded
> [icon] => lib/extjs/resources/images/default/tree/s.gif
> [singleClickExpand] => 1
> [leaf] => 0
> [id] =>
> )
>
> [2] => Array
> (
> [nid] => 3
> [parentID] => 2
> [text] => Dashboard
> [cls] => x-btn-icon
> [icon] => lib/extjs/resources/images/default/tree/s.gif
> [singleClickExpand] => 1
> [leaf] => 1
> [id] => dashboard
> )
> ...
>
>
> -- The array I want to create: 
>
> [0] => Array
> (
> [nid] => 1
> [parentID] => 0
> [text] => Dashboard
> [cls] => x-btn-icon
> [icon] => lib/extjs/resources/images/default/icon/Dashboard.png
> [singleClickExpand] => 1
> [leaf] => 0
> [id] => Dashboard
> [children] => Array(
>  [0] => Array
> (
> [nid] => 2
> [parentID] => 1
> [text] => Dashboard
> [cls] => firstExpanded
> [icon] =>
> lib/extjs/resources/images/default/tree/s.gif
> [singleClickExpand] => 1
> [leaf] => 0
> [id] =>
> [children] => Array(
> [0] => Array
> (
>   [nid] => 3
>   [parentID] => 2
>   [text] => Dashboard
>   [cls] => x-btn-icon
>   [icon] =>
> lib/extjs/resources/images/default/tree/s.gif
>   [singleClickExpand]
> => 1
>   [leaf] => 1
>   [id] => dashboard
>   )
> )
> )
> )
> )
>
> .
> wow!
> it means that by nid and parentID, I'll notice where I must add children
> item to array...
>
> Thanks,
> Shahrzad
>
>
>
>


Re: [fw-general] IE7

2010-05-05 Thread Daniel Latter
 

Re: [fw-general] problem wiht "php scripts/load.sqlite.php "

2010-04-24 Thread Daniel Latter

Hi,

If you look at the paths in the error you will see that it is looking  
for the config file @ /configs/application.ini, looking at where your  
running the command from it looks like it should be c:/wamp/www/ 
quickstart/configs/application.ini,


So it looks like a path problem,

Hth.

On 24 Apr 2010, at 13:37, something  wrote:



Hi Every one,

I am new to ZENDFRAME WORK.

when i am running this
php scripts/load.sqlite.php --withdata
command in CMD i am getting the following out out


C:\wamp\www\quickstart\data>php scripts/load.sqlite.php --withdata


Fatal error: Uncaught exception 'Zend_Config_Exception' with message
'parse_ini_
file(/configs/application.ini): failed to open stream: No such file or
directory
' in C:\ZendFramework\library\Zend\Config\Ini.php:181
Stack trace:

#0 C:\ZendFramework\library\Zend\Config\Ini.php(201):
Zend_Config_Ini->_parseIni
File('/configs/applic...')

#1 C:\ZendFramework\library\Zend\Config\Ini.php(125):
Zend_Config_Ini->_loadIniF
ile('/configs/applic...')

#2 C:\ZendFramework\library\Zend\Application.php(383):
Zend_Config_Ini->__constr
uct('/configs/applic...', 'development')

#3 C:\ZendFramework\library\Zend\Application.php(85):
Zend_Application->_loadCon
fig('/configs/applic...')

#4 C:\wamp\www\quickstart\data\scripts\load.sqlite.php(41):
Zend_Application->__
construct('development', '/configs/applic...')

#5 {main}
 thrown in C:\ZendFramework\library\Zend\Config\Ini.php on line 181


what is the problem i am not able to understand.
i googled out and also did not find any solution
if any one can help me send the solution ASAP..



-
something
--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/problem-wiht-php-scripts-load-sqlite-php-tp2063411p2063411.html
Sent from the Zend Framework mailing list archive at Nabble.com.


Re: [fw-general] Re: Deeplinking SWF inside Zend Framework

2010-03-09 Thread Daniel Latter
what about using htaccess somehow?

To turn off rewriting on the front-end maybe?


Thanks
Dan




On 9 March 2010 14:42, Matthew Weier O'Phinney  wrote:

> -- MrMastermindNL  wrote
> (on Tuesday, 09 March 2010, 06:16 AM -0800):
> > I've been looking at the Zend_Controller_Router_Route, but I just can't
> > figure out how to set this up. Swfaddress does use th '#" character. So
> > preferrable the route would convert /#/controller/action to
> > /controller/action.
> >
> > Does anyone have an example of such a route? Or another solution to get
> > solved? I can imagine someone already using SWFaddress in a Zend
> Framework
> > setup.
>
> Anything following a # will not be passed to the server -- # denotes an
> -in-page anchor.
>
> Many JS libraries will take the anchor, and use it to determine what
> page on the server to request, however -- not sure how flex/flash handle
> it.
>
> --
> Matthew Weier O'Phinney
> Project Lead| matt...@zend.com
> Zend Framework  | http://framework.zend.com/
> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
>


Re: [fw-general] Re: Manual Headings

2010-02-23 Thread Daniel Latter
CTRL + F is your friend...


Thanks
Dan




On 23 February 2010 01:36, David Muir

> wrote:

>
> +1 from me too. And while we're at it, add a table of contents for each
> page
> (à la wikipedia).
>
> Example:
> Try to quickly find "Navigation Helpers" in:
> http://framework.zend.com/manual/en/zend.view.helpers.html
>
> Cheers,
> David
>
>
> --
> View this message in context:
> http://n4.nabble.com/Manual-Headings-tp1565051p1565402.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Re: [fw-mvc] How can I run a single zf application on different subdomains?

2010-02-19 Thread Daniel Latter
You will also probably need to enable wild card sub-domains? no?

Thanks
Dan




On 19 February 2010 14:23, Rob Keplin  wrote:

>  I would look into Zend_Controller_Router_Route_Hostname for this:
> http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.hostname
>
> This way, you can route the page to a specific controller/action when a
> subdomain is present, and retrieve what language they want as if it were
> part of the query string.
>
> Rob
>
>
>
> Laurens van Vliet wrote:
>
> I have a website that I made with ZF and it is running on a server. Because
> I want this website to be multilanguage, I made some subdomains for the
> different languages on the webserver.
> Lets say the site is running now on en.mywebsite.com. In this directory
> all the application code, data and library is located.
> I also have on the same server these es.mywebsite.com and 
> fr.mywebsite.comdirectories. My idea was to put the files that are normally 
> in the /public
> directory of a zf application in these subdomain dirs. And by pointing the
> Application_path in the index.php files to the
> en.mywebsite.com/application I thought I could run the application on the
> subdomains.
>
> When I open the es.mywebsite.com in my browser I get a error message like
> this:
> Fatal error:  Uncaught exception 'Zend_Config_Exception' with message
> 'parse_ini_file(../application/configs/application.ini) [ href='function.parse-ini-file'>function.parse-ini-file]: failed to open
> stream: No such file or directory' in
> /var/www/zend/ZendFramework-1.9.7-minimal/library/Zend/Config/Ini.php:184
>
> Is my approach correct to run a single application on different subdomains
> and how can I solve this?
> Can someone help me with this problem? Thanks!
>
>  Regards,
>
>  Laurens van Vliet
>
>
>
>


Re: [fw-general] Deeplinking SWF inside Zend Framework

2010-02-17 Thread Daniel Latter
Hi,

I think you should be able to use Custom Routes for somthing like this:

http://www.framework.zend.com/manual/en/zend.controller.router.html


Thanks
Dan




On 17 February 2010 10:54, MrMastermindNL wrote:

>
> I'm using Zend Framework to build a HTML based CMS backend and a Flash
> frontend. In flash it is possible to deeplink to a specific section using
> the url from the browser. But Zend Framework is also interpreting the url
> to
> redirect to a controller and action.
> So my question is, how can I use the Zend Framework to route my CMS backend
> and not route the front end a let Flash handle the deeplinking?
>
> Any suggestions would be appreciated.
>
> Thanks in advance
> --
> View this message in context:
> http://n4.nabble.com/Deeplinking-SWF-inside-Zend-Framework-tp1558493p1558493.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


[fw-general] Quickstart Zip download package

2010-01-29 Thread Daniel Latter
Hi Guys,

I think the download zip for the quickstart is pointing to an old version?

Why? because it doesnt use Zend_Application or Bootstrap classes but instead
does it
the "old" way:

heres: the index.php: http://pastebin.com/m1fd64657
heres the bootstrap: http://pastebin.com/m4aa41dd9

Appologies if this is intentional, but if not it is likely to cause
confusion.


Thanks
Dan


Re: [fw-general] Zend Framework Widgets

2010-01-21 Thread Daniel Latter
to me it seems: more complexity = more code = harder to maintain.

Thanks
Dan




2010/1/21 Paul 

>  Any thoughts?
>
>
> On 1/20/2010 3:11 PM, Paul wrote:
>
> I know the term Widget is a loaded concept, but was wondering what
> everyone's thoughts on the best way to create reusable
> Controls/Components/Widgets.
>
> To me a Widget is something you can drop into any controller and it would
> be able to handle rendering itself and working with Model.  At first this
> sounds very similar to a View Helper, which is how I have done this so far.
> The issue comes when you need to update the Model.
>
> Updating a model from the view is not really good practice or allowed in
> MVC.
>
> An example situation, may help paint the picture:
>
> A Widget photo selection widget.  This widget would fetch images from some
> Gallery Model.  The view part of the widget would show a thumbnail grid of
> the photos, with some sort of js lightbox modal.  When a user select one
> photo, it would via ajax, post back and add to the image to his favorite
> photos collection, which means we need to update a model.
>
>
> If this widget was just going to be in one system, you would just create a
> view helper, and the controller to handle the ajax.  If you want to make
> this ajax/post reusable you could create an Action Helper.  So to me seems
> like to be able to do this, you would need a way to create an encapsulate
> package that includes a View Helper and Action Helper.
>
> What we want to be able to do, similar to modules, is to just drop a widget
> in place.  It doesn't need to go as far as having to bootstrap itself like a
> module.  It can work like action helper / view helpers do with brokers.  The
> issue I have is that since the package is contained, you are going to add up
> with a bunch of helper paths which is going to really hurt performance if
> you have a bunch of widgets in your system.
>
> Thoughts? Ideas? I am thinking too much about this :)
>
>
>


Re: [fw-general] Check if an image exists on remote server

2010-01-15 Thread Daniel Latter
http://www.framework.zend.com/manual/en/zend.file.transfer.validators.html#zend.file.transfer.validators.isimage




2010/1/15 JoostV 

>
>
>
> Thomas Weidner wrote:
> >
> > Or simply use Zend_Validate_File_IsImage which is much saver than relying
> > on
> > client data.
> >
>
> Good call. Where can I find it in the manual?
>
> --
> View this message in context:
> http://n4.nabble.com/Check-if-an-image-exists-on-remote-server-tp1014172p1014978.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Server URL absence in the URL view helper

2010-01-12 Thread Daniel Latter

Yes, This is intended behaviour.


On 12 Jan 2010, at 17:29, Diego Potapczuk  wrote:


Hi,

When i use the $this->url() in the view, it don´t include the server 
 url, is this the correct behavior?



Example:
url(array('module' => 'admin',
'controller' =>  
'info',

'action' => 'show',
'id' => $this->var 
['id']),

'default', true);
?>
// /admin/info/show/id/4 (what i get)

// /http://www.server.com/admin/info/show/id/4 (what i would like to  
get)



Thanks

::: Diego Potapczuk




Re: [fw-general] Digital sign PDF

2010-01-12 Thread Daniel Latter
Im am doing this at the moment and was going to use an image from a scanned
in signature, is this no good?


Thanks
Dan



2010/1/12 Andreas Kraftl 

> Hello,
>
> has anybody an idea, how to add a digital signature to an PDF file?
>
> It must be an X.509 certificate.
>
> Thanks
> Andreas
> --
> Kraftl EDV - Dienstleistungen
> Linux, Linuxschulungen, Webprogrammierung
> Autofabrikstraße 16/6
> 1230 Wien
>
>


Re: [fw-general] Faltal Error with Controller Action on ZF

2010-01-06 Thread Daniel Latter
Sorry, I cant see anything obvious as theres not much going on in the
controller like you said.

If you comment out the Alex_Http_* statements and echo some text, do
you still get the error?


Dan



2010/1/6 Big Al :
>
>
> It's also worth pointing out that this doesn't crash PHP or Apache.  I can
> still access other websites on the server that use PHP and they work fine.
> But if I go back to my Zend Framework site, refresh that page (or indeed go
> to any other page in the site) all I get is that error.  It's like that one
> site has "crashed" but the webserver is fine... Strange...
>
> Alex
>
>
> Daniel Latter wrote:
>>
>> Post your controller (bare essentials) it may help, even to rule it out,
>>
>> Thanks
>> Dan
>>
> --
> View this message in context: 
> http://n4.nabble.com/Faltal-Error-with-Controller-Action-on-ZF-tp998248p1005228.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Faltal Error with Controller Action on ZF

2010-01-06 Thread Daniel Latter
Post your controller (bare essentials) it may help, even to rule it out,

Thanks
Dan





2010/1/6 Big Al :
>
>
> Jacques Marques wrote:
>>
>> When I change anything in my controller and try access it I receive this
>> message:
>> Fatal Error: Cannot override final method
>> Zend_Controller_Action::_forward() ...
>>
>> I am using Zend Framework 1.9.5 with Zend Server on Linux.
>>
>
> I am getting the same error and I'm not sure why:
>
> "Fatal error: Cannot override final method
> Zend_Controller_Action::_forward() in Unknown on line 0"
>
> Strangely I will load a very simple page and refresh a few times (to see
> some minor changes in the page as I build it).  After a handful of refreshes
> I will get this error.  I have to restart PHP to get rid of this error, then
> the pages loads okay, until the next "crash".
>
> How can I debug this error?
>
> (I am using ZF 1.9.6 on Ubuntu Desktop 9.10 Karmic)
> --
> View this message in context: 
> http://n4.nabble.com/Faltal-Error-with-Controller-Action-on-ZF-tp998248p1001908.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


  1   2   3   >