Re: [fw-general] Zend_Db

2010-09-13 Thread Shaun Farrell
Rafael,

Did you check out the Zend Framework Quickstart?

There are two good ones.
http://framework.zend.com/manual/en/learning.quickstart.intro.html
http://akrabat.com/zend-framework-tutorial/


I would start there first.

Shaun J. Farrell
Washington, DC


On Mon, Sep 13, 2010 at 8:56 PM, Rafael  wrote:

>
>  Hello,
>
> I would like to get help from someone ,I'm new at PHP, I have setted the
> database config in the application.ini ( resources.db... ), I've been trying
> to retrieving the adapter instance but I didn't find a way to get it than
> using with Zend_Db_Table, How could I get it with Zend_Db? I didn't find
> enough documentation for it.
>
> I would be thankful
>
>
>


Re: [fw-general] Zend_Search get all documents

2010-09-13 Thread Shaun Farrell
Niko,

The Luke project (http://code.google.com/p/luke/) is really good for just
browsing an index.
All you have to do is install it (java) and point it at your index.



Shaun J. Farrell
Washington, DC


On Mon, Sep 13, 2010 at 3:06 AM, Niko Sams  wrote:

> Hi,
>
> Is there a way to get all documents from an index?
> (I want to check if they are still valid)
>
> thanks,
> Niko
>


Re: [fw-general] Zend_Service_Twitter not working

2010-06-27 Thread Shaun Farrell
Zend_Service_Twitter as of 1.10.6 requires oauth for logging in.


Shaun J. Farrell
Washington, DC


On Sun, Jun 27, 2010 at 10:10 PM, Jack Houghton  wrote:

>  Robert,
>
>
>
> Unfortunately, I may not be of that much help. I ran into the same issue
> and switched to using cURL for my twitter feed (without OAuth). I posted
> this to the list a month back and came away with the realization that
> Zend_Service_Twitter was simply broken and based on cURL working with the
> user/pass authorization I can confirm that OAuth is not yet required.
>
>
>
> Please let me know if you get anywhere with this.
>
>
>
> -Jack-
>
>
>  --
>
> *From:* robert mena [mailto:robert.m...@gmail.com]
> *Sent:* Sunday, June 27, 2010 7:32 PM
> *To:* Zend Framework
> *Subject:* [fw-general] Zend_Service_Twitter not working
>
>
>
> Hi,
>
>
>
> I am trying to use Zend_Service_Twitter (ZF10.6.5 / PHP 5.3.2) but it
> always complains about the credentials even tough I've tested the
> username/password. I found a post somewhere that Twitter will/was no longer
> accept this and I'll be 'forced' to use Oauth.
>
>
>
> Is this true?  In that case does anybody have a quickstart?  The manual of
> Zend_Service_Twitter does not cover that and I am unsure of how to add the
> capability for my app to post stuff automatically
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.830 / Virus Database: 271.1.1/2966 - Release Date: 06/27/10
> 14:35:00
>


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

2010-06-22 Thread Shaun Farrell
Parham,
Your right... this is the only way to delete the action as far as I am
aware.


Shaun J. Farrell
Washington, DC


On Tue, Jun 22, 2010 at 7:53 AM, 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!
>


Re: [fw-general] Zend_Config and versioning

2010-05-24 Thread Shaun Farrell
You could always store them in a DB and then load them in based on a simple
query.  just store the changes from a base version of the navigation.

Shaun J. Farrell
Washington, DC


On Mon, May 24, 2010 at 6:17 PM, Hector Virgen  wrote:

> Thanks Shaun. I agree, separate XML files for each version might be the
> cleanest way. I wanted to avoid copy/paste but I think for this use case it
> makes more sense than the alternatives.
>
> Thanks again!
>
> --
> Hector
>
>
>
> On Mon, May 24, 2010 at 3:15 PM, Shaun Farrell wrote:
>
>> Hector,
>>
>> What if you created the xml file for each version then in the bootstrap
>> you can get the version of the framework you need and load the specific
>> navigation file.  You can switch the frameworks with
>> http://framework.zend.com/manual/en/zend.loader.autoloader.html
>>
>> That is probably the best and simplest way.
>>
>> Shaun J. Farrell
>> Washington, DC
>>
>>
>>
>> On Mon, May 24, 2010 at 5:53 PM, 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 version
>>>- Create each version in a new section that doesn't extend another
>>>section
>>>
>>> Any thoughts?
>>>
>>> 1.
>>> http://framework.zend.com/manual/1.8/en/zend.navigation.containers.html
>>>
>>> --
>>> Hector
>>>
>>
>>
>


Re: [fw-general] Zend_Config and versioning

2010-05-24 Thread Shaun Farrell
Hector,

What if you created the xml file for each version then in the bootstrap you
can get the version of the framework you need and load the specific
navigation file.  You can switch the frameworks with
http://framework.zend.com/manual/en/zend.loader.autoloader.html

That is probably the best and simplest way.

Shaun J. Farrell
Washington, DC


On Mon, May 24, 2010 at 5:53 PM, 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 version
>- Create each version in a new section that doesn't extend another
>section
>
> Any thoughts?
>
> 1. http://framework.zend.com/manual/1.8/en/zend.navigation.containers.html
>
> --
> Hector
>


Re: [fw-general] Re: add subform using Jquery and AJAX [update]

2010-05-04 Thread Shaun Farrell
MrMastermindNL,

Check out http://github.com/farrelley/Dynamic-Forms-with-Zend-Framework

It uses
Jquery to clone a subform and add it to the form.  It for adding dynamic key
values.

You can also try this example
http://www.jeremykendall.net/2009/01/19/dynamically-adding-elements-to-zend-form/

Shaun J. Farrell
Washington, DC


On Tue, May 4, 2010 at 5:03 AM, MrMastermindNL
wrote:

>
> I've come a little further with my issue. I can now make an AJAX call with
> JQuery, but it will not return the subform. When I echo a line in my
> action,
> that is returned, but now I get an "invalid controller specified" in the
> return of the AJAX call. Here's my changed code:
>
> Moved the init() code to the imageformAction:
>
> public function imageformAction()
>{
>if ($this->getRequest()->isXmlHttpRequest())
>{
>  $ajaxContext = $this->_helper->getHelper('AjaxContext');
>  $ajaxContext->addActionContext('imageform',
> 'html')->initContext();
>
>  $id = $this->_getParam('id', null);
>  $this->getForm()->addSubForm(new RS_Form_Pimage(), 'pImage'.$id);
>}
>}
>
> JQuery javascript:
>
> function ajaxAddField()
> {
>$.post("/admin/project/imageform",{"pid": id},
>function(response)
>{
> var subForm = $(response);
>
>$("#addBtn-label").prepend(subForm);
>});
> }
>
> I hope someone can help me out here, so I can get the subforms dynamically
> into my form.
>
> Many thanks in advance.
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/add-subform-using-Jquery-and-AJAX-tp2075629p2125198.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Would anyone want Zend_VersionControl_Subversion?

2010-03-19 Thread Shaun Farrell
Steven,
I would like to see this too!
I like Zend_VersionControl_*

Look forward to see it something.

Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


On Thu, Mar 18, 2010 at 6:00 PM, Danny Fröberg  wrote:

>  Steven,
>
> Yes would love to have it, use case could be for having self updating apps
> deployed.
>
>
>
> Regards
>
> Danny
>
>
>
> *From:* Steven Brown [mailto:ste...@yewchube.com]
> *Sent:* den 18 mars 2010 22:59
> *To:* fw-general@lists.zend.com
> *Subject:* [fw-general] Would anyone want Zend_VersionControl_Subversion?
>
>
>
> For fun, I began experimenting with putting together a PHP implementation
> of a Subversion client that uses the svn protocol and thought it might be a
> useful addition to ZF.
>
>
>
> Bill Karwin pointed out that a PECL extension already exists to provide
> this functionality, though the documentation is filled with warnings about
> it being experimental.
>
>
>
> I suggest that it is possible in some hosting environments that developers
> won’t have the PECL extension installed and may not be able to install it.
>
>
>
> Some uses for such a module include:
>
>
>
> 1.   Deployment – code can be installed or updated using PHP code
>
> 2.   Repository browsing – for tools such as bug/issue trackers
>
> 3.   Committing – for example if files can be changed in an admin
> area, the changes can be committed to the repository
>
>
>
> I think it should be possible to provide similar functionality for Git,
> Mercurial, and other version control systems.
>
>
>
> I have already started developing an adapter that uses the svn protocol,
> but others could be created that use SSH or LDAP/HTTP access, or the PECL
> extension.
>
>
>
> Would Zend_VersionControl_Subversion be useful or is it just a waste of
> time?
>
>
>
> Cheers,
>
> Steven
>


[fw-general] Creating a Zend_Service_* Component

2010-03-16 Thread Shaun Farrell
I have been working on creating some Zend_Service components and I am trying
to figure out the best way to break out my methods.

Do I write one long class or do I break out the sections of the API into
multiple classes.

Take flickr for an example.  There are a lot of API calls.  flickr has them
grouped very well, you can see them here http://www.flickr.com/services/api/
If I was going to create a flickr component would I throw all those API
calls in one class called flickr.php or would you suggest creating the
flickr.php to have the photo methods and then in the Zend_Service_Flickr
folder create stats.php for the stats methods, people.php for the people
methods, etc.  All these classes would extend the main class (flickr.php)

I'm sort of confused right now on what route to go with.

Suggestions and comments would be great!

Thanks!

Shaun J. Farrell
Washington, DC


Re: [fw-general] Zend Framework application next to existing website

2010-02-25 Thread Shaun Farrell
1. you can create a subdomain if you able to
2. you can symlink you public folder into a folder under your host.  if you
domain is www.abc.com just  put all of ZF outside of the webroot and then
just symbolic link the public folder to www.abc.com/FOLDERNAME

The app will run out of www.abc.com/FOLDERNAME



Shaun J. Farrell
Washington, DC
www.farleyhills.com

On Thu, Feb 25, 2010 at 4:53 AM, MrMastermindNL
wrote:

>
> Hi,
>
> I've create a Zend Framework application and I now have to move it to the
> webspace of my client. Unfortunately there's already a website running
> there. So if I just upload my framework, the site wil not be visible
> anymore.
>
> So the question is, how can I upload and test my Zend Framework application
> on the webspace of my client, without interferring with the current
> website?
> --
> View this message in context:
> http://n4.nabble.com/Zend-Framework-application-next-to-existing-website-tp1568746p1568746.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Zend_Service_Twitter short url

2010-02-25 Thread Shaun Farrell
I am in the process of updating the Zend_Service_Twitter to add all the
Twitter API calls. I am going to post the proposal this weekend on the wiki
along with code.

I will also search through the issue tracker and fix the needed bugs that
effect Zend_Service_Twitter.

Does anyone have any suggestions or comments before I post anything to the
wiki?

I think a new Service like Zend_Service_Bitly or Zend_Service_Trim would be
fantastic.  I currently don't see any proposals for these.

Shaun J. Farrell
Washington, DC


On Thu, Feb 25, 2010 at 5:09 AM, Саша Стаменковић wrote:

> If you are using http://tr.im/ service for url shortening, I have
> imeplemented service based on Zend_Rest_Client.
> Check http://code.google.com/p/servicetrim/
>
> Regards,
> Saša Stamenković
>
>
>
> On Thu, Feb 25, 2010 at 10:43 AM, MrMastermindNL <
> ma...@alting-multimedia.nl> wrote:
>
>>
>> Hi,
>>
>> I'm implementing the Twitter service in my Zend Framework application.
>> This
>> all works fine, but when adding a url, it shows the complete url. What I
>> would like is to have a short url in the tweet. Is there a way to
>> integrate
>> this?
>>
>> Thanks in advance.
>> --
>> View this message in context:
>> http://n4.nabble.com/Zend-Service-Twitter-short-url-tp1568732p1568732.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>
>


Re: [fw-general] Custom view helper in Zend_Form

2010-02-19 Thread Shaun Farrell
jörg,

You can create your own view helper.  Check out this article
http://devzone.zend.com/article/3412


Shaun



On Fri, Feb 19, 2010 at 3:35 PM, pankraz  wrote:

>
> hi,
>
> i (zf newbie) am trying to implement an own view helper for my radio
> buttons.
>
> my problem: i am not able to integrate it in my form.
> my question: how/where do i overwrite the standard viewhelper
> ("FormRadio")?
>
> regards
> jörg
> --
> View this message in context:
> http://n4.nabble.com/Custom-view-helper-in-Zend-Form-tp1562204p1562204.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] Display all weeks in particular year

2010-01-21 Thread Shaun Farrell
Nisanth,

Look in Zend_Date.
Check out getWeek(), and setWeek().

This should do it for ya.  Remember that a week is defined differently based
on your locale.


Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farleyhills.com


On Thu, Jan 21, 2010 at 6:37 AM, nisanth  wrote:

>
> Hi all, How print all the weeks which start with monday and end with
> sunday..
> like below ..using Zend_Date and Zend::Week
>
> Week No
> 1 04-Jan-2010-10-Jan-2010
> 2 11-Jan-2010-17-Jan-2010
> 3 18-Jan-2010-24-Jan-2010
> --
> View this message in context:
> http://n4.nabble.com/Display-all-weeks-in-particular-year-tp1049666p1049666.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>


Re: [fw-general] preDispach Plugin | URL Issues

2009-12-07 Thread Shaun Farrell
Yeah, I am not sure I want do a header redirect all the time.

Anyone know if it is wise to instantiate the Action Helper Redirector in the
plugin?

$redirector = new Zend_Controller_Action_Helper_Redirector();
$redirector->gotoRoute($urlOptions, '', true);



Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


On Mon, Dec 7, 2009 at 8:39 AM, Jurian Sluiman
wrote:

> The redirector is an action helper which you can't use inside front
> controller
> plugins. You have access though to the response object. You could inject
> the
> redirect header directly into the response object.
>
> Regards, Jurian
> --
> Jurian Sluiman
> CTO Soflomo V.O.F.
> http://soflomo.com
>
> On Monday 07 Dec 2009 12:31:30 Shaun Farrell wrote:
> > Ok so here is what I am doing.  Before dispatch if the user is logged in
> >  and they have to reset their password then it will set the action and
> the
> >  controller to the correct controller/action.
> > This code below works fine.  However, the url in the browser doesn't
> > change.  So if I come into the system at www.abc.com/profile  and i need
> to
> > reset my pwd it will keep the url at www.abc.com/profile but the page
> that
> > shows is www.abc.com/login/resetpassword
> >
> > anyone know how to reset the url so that it changes.  Can I use
> >
> > return $this->_helper->redirector();
> >
> > public function preDispatch(Zend_Controller_Request_Abstract $request)
> > {
> >
> >if (Zend_Auth::getInstance()->hasIdentity()) {
> > //checks to make sure that the password doesn't need to be
> > reset.
> >if ("Y" ===
> > Zend_Auth::getInstance()->hasIdentity()->Reset_Password) {
> >
> > $request->setActionName('resetpassword')->setControllerName('Login');
> >return;
> > }
> >
> >
> > Thanks,
> >
> > Shaun J. Farrell
> > Washington, DC
> > www.farrelley.com
> >
>


[fw-general] preDispach Plugin | URL Issues

2009-12-07 Thread Shaun Farrell
Ok so here is what I am doing.  Before dispatch if the user is logged in and
they have to reset their password then it will set the action and the
controller to the correct controller/action.
This code below works fine.  However, the url in the browser doesn't
change.  So if I come into the system at www.abc.com/profile  and i need to
reset my pwd it will keep the url at www.abc.com/profile but the page that
shows is www.abc.com/login/resetpassword

anyone know how to reset the url so that it changes.  Can I use

return $this->_helper->redirector();

public function preDispatch(Zend_Controller_Request_Abstract $request)
{

   if (Zend_Auth::getInstance()->hasIdentity()) {
//checks to make sure that the password doesn't need to be
reset.
   if ("Y" ===
Zend_Auth::getInstance()->hasIdentity()->Reset_Password) {

$request->setActionName('resetpassword')->setControllerName('Login');
   return;
}


Thanks,

Shaun J. Farrell
Washington, DC
www.farrelley.com


Re: [fw-general] Bug in Zend_Date

2009-10-28 Thread Shaun Farrell
Did you try $date->getTimestamp();  That may work but I'm not sure if it
will read the year correctly.



On Wed, Oct 28, 2009 at 8:37 AM, Peter Smit  wrote:

> On Wed, Oct 28, 2009 at 2:29 PM, Shaun Farrell wrote:
>
>> Peter,
>>
>> Try this.  It may work
>>
>> $indate = "Fri Oct 23 15:47:42 + 2009";
>> $outformat = " d MMM ";
>> $date = new Zend_Date();
>> $date->setTimezone('Europe/Helsinki');
>> $datetime = strtotime($indate);
>> $date->set($datetime);
>>
>> echo "Date: " . $date->toString($outformat);
>> echo "TimeZone: " . $date->getTimezone();
>>
>>
>>
> It works, it is indeed a workaround to convert the date to a timestamp with
> strtotime and construct a date from that. I have only the following 2
> concerns
>  - I was expecting Zend_Date to do this for me, so is my expectation wrong
> than this is a solution, if not it's a workaround
>  - This will not work with dates outside the range of the timestamp (> year
> 2039 according to
> http://php.net/manual/en/function.strtotime.php#function.strtotime.notes)
>
>
>


-- 
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


Re: [fw-general] Bug in Zend_Date

2009-10-28 Thread Shaun Farrell
Peter,

Try this.  It may work

$indate = "Fri Oct 23 15:47:42 + 2009";
$outformat = " d MMM ";
$date = new Zend_Date();
$date->setTimezone('Europe/Helsinki');
$datetime = strtotime($indate);
$date->set($datetime);

echo "Date: " . $date->toString($outformat);
echo "TimeZone: " . $date->getTimezone();


On Wed, Oct 28, 2009 at 6:17 AM, Peter Smit  wrote:

> It seems that Zend_Date does not parse a date well when the year comes
> after the timezone.
>
> Example code:
>  date_default_timezone_set('Europe/Helsinki');
> set_include_path('/home/peter/Desktop/ZendFramework-1.9.3PL1/library' .
> PATH_SEPARATOR . get_include_path());
>
> require_once('ZendFramework-1.9.3PL1/library/Zend/Date.php');
> require_once('ZendFramework-1.9.3PL1/library/Zend/Locale.php');
>
> $informat = "EEE MMM d h:mm:ss ZZZ ";
> $indate = "Fri Oct 23 15:47:42 + 2009";
>
> $outformat = " d MMM ";
>
> $date = new Zend_Date($indate, $informat);
> #$date = new Zend_Date();
> echo $date->toString($outformat) . "\n";
> echo $date->toString($informat) . "\n";
>
> Gives:
> Thursday 23 Oct 
> Thu Oct 23 3:47:42 + 
>
> This date format is common for the Twitter API.
>
> Is this a bug?
>
> Regards,
>
> Peter Smit
>



-- 
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


Re: [fw-general] Dynamic orWhere Clause | Zend_Db_Select

2009-10-24 Thread Shaun Farrell
Actually I have narrowed it down to the ajax i think.

I can call the method in the model and it works fine.  However when I call
the action via ajax it leaves out the orWhere loop.

Seems odd to me.

On Sat, Oct 24, 2009 at 6:33 PM, Hector Virgen  wrote:

> What is the error? If you can echo the SQL but not query it, it's probably
> a syntax error.
>
> --
> Hector
>
>
>
> On Sat, Oct 24, 2009 at 1:26 PM, Shaun Farrell wrote:
>
>> Are you able to do this?
>>
>> $teamTags = an array or strings
>>
>> $select = $this->getTable()->select();
>>
>> foreach($teamTags as $tags) {
>> $select->orWhere('Text like ?', '%' . $tags['Tag'] . '%');
>> }
>>
>> $select->where('(Create_Dt < ?', '2009-10-24 23:59:59')
>> ->where('Create_Dt > ?)', '2009-10-24 00:00:01')
>> ->order('Id DESC')
>> ->limit(10);
>>
>> $result = $this->getTable()->fetchAll($select);
>>
>> If you echo the $select it's fine.
>> if you try to do fetchAll() it doesn't work.
>>
>> any thoughts?
>>
>> --
>> Shaun J. Farrell
>> Washington, DC
>> (202) 713-5241
>> www.farrelley.com
>>
>
>


-- 
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


[fw-general] Dynamic orWhere Clause | Zend_Db_Select

2009-10-24 Thread Shaun Farrell
Are you able to do this?

$teamTags = an array or strings

$select = $this->getTable()->select();

foreach($teamTags as $tags) {
$select->orWhere('Text like ?', '%' . $tags['Tag'] . '%');
}

$select->where('(Create_Dt < ?', '2009-10-24 23:59:59')
->where('Create_Dt > ?)', '2009-10-24 00:00:01')
->order('Id DESC')
->limit(10);

$result = $this->getTable()->fetchAll($select);

If you echo the $select it's fine.
if you try to do fetchAll() it doesn't work.

any thoughts?

-- 
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


Re: [fw-general] Zend_Form and arrays

2009-10-24 Thread Shaun Farrell
Your Zend_Form is a POST method.

You can also do it this way in your controller.

$form = new Default_Form_FormName();  // instantiate the form
$this->view->form = $form; // form for the view

//after submitting the form
if($this->getRequest()->isPost()) { // if the form is a post
$formData = $this->getRequest()->getPost(); // get the data from the
post
if ($form->isValid($formData)) { //if the post if valid
$values = $form->getValues(); //values of the form
   //make an array
$data=array(
'er1'=>$values['er1'],
'er2'=>$values['er2'],
);
}
}





On Sat, Oct 24, 2009 at 8:03 AM, Peter Warnock wrote:

> 2009/10/22 Krzysztof Szatanik 
>
>> As you can see even if i get form values in request as i wanted, they
>> aren't recognized by Zend_Form. Output of $form->getValues() is different
>> from expected, and even fields aren't recognized, so i can use Zend_Form
>> only to generate HTML form but not to filter and validate submited form.
>>
>
> Assuming it's a post:
>
> $form->isValid($request->getPost());
> $data = $form->getValues();
>
> - pw
>



-- 
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


[fw-general] Zend_Cache | Page Caching

2009-09-18 Thread Shaun Farrell
Quick question, I am running Zend Page Caching to cache some flickr photos
so that I don't have to pull the files down all the time since they don't
change.  My question is...

On the manual pages for Page Caching it says that you don't have to generate
the Id since it is generated automatically.  Here is that section,

On the other hand, the "cache id" is calculated automatically with
> $_SERVER['REQUEST_URI'] and (depending on options) $_GET, $_POST,
> $_SESSION, $_COOKIE, $_FILES. More over, you have only one method to call
> (start()) because the end() call is fully automatic when the page is
> ended.
>

However, When I don't specify a cache ID it doesn't cache, but when I
specify one the page gets cached.

Am I doing something wrong in the code?

I don't think there is a reason to test the cache since Page Caching either
pulls it or renders and caches it for the set lifetime.  Am I doing
something wrong?

-- Bootstrap
protected function _initCache()
{
$frontendOptions = array(
'lifetime' => 30, // cache lifetime of 30 seconds
'regexps' => array(
   '^/index/flickr' => array(
   'cache' => true,
)
   ),
);
$backendOptions = array('cache_dir' => '/tmp/');
$flickrCache = Zend_Cache::factory('Page', 'File', $frontendOptions,
$backendOptions);
$flickrCache->start('flickr');
//Zend_Registry::set('flickrCache', $flickrCache);
}


Thanks!

-- 
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


Re: [fw-general] application.ini - config controllers and layouts, but not pages?

2009-09-18 Thread Shaun Farrell
Yeah i assume that would work too.  The ZF Manula says

In fact, you can "stack" paths using the addScriptPath() method. As you add
paths to the stack, Zend_View will look at the most-recently-added path for
the requested view script. This allows you override default views with
custom views so that you may create custom "themes" or "skins" for some
views, while leaving others alone.


On Fri, Sep 18, 2009 at 9:50 AM, Kyle Spraggs  wrote:

>
>
>
> Artsemis wrote:
> >
> >
> > Shaun Farrell wrote:
> >>
> >> Artsemis,
> >>
> >> Check out this
> >> http://framework.zend.com/manual/en/zend.view.controllers.html
> >>
> >> I also think you can override the viewRenderer.  Below is an example
> from
> >> framework.zend.com and shows how to use smarty.  I assume if you just
> >> change
> >> the setViewBasePathSpec to your dir that might work.  haven't tested it
> >> but
> >> worth a try
> >>
> >>
> >> $view = new Zend_View_Smarty('/path/to/templates');
> >> $viewRenderer =
> >> new
> >> Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
> >> $viewRenderer->setView($view)
> >>  ->setViewBasePathSpec($view->_smarty->template_dir)
> >>  ->setViewScriptPathSpec(':controller/:action.:suffix')
> >>  ->setViewScriptPathNoControllerSpec(':action.:suffix')
> >>  ->setViewSuffix('tpl');
> >>
> >>
> >>
> >> On Thu, Sep 17, 2009 at 9:45 PM, Artsemis  wrote:
> >>
> >>>
> >>>
> >>>
> >>> Matthew Weier O'Phinney-3 wrote:
> >>> >
> >>> > -- Artsemis  wrote
> >>> > (on Thursday, 17 September 2009, 01:28 PM -0700):
> >>> >> As implied by the subject, why do you config the base directory here
> >>> for
> >>> >> most
> >>> >> things (specifically controllers) but can't for pages? Where can you
> >>> >> change
> >>> >> the path to pages?
> >>> >
> >>> > What do you mean by "pages"? Since ZF is front controller driven, all
> >>> > "pages" of a ZF website are the result of controller actions...
> >>> >
> >>> > --
> >>> > Matthew Weier O'Phinney
> >>> > Project Lead| matt...@zend.com
> >>> > Zend Framework  | http://framework.zend.com/
> >>> >
> >>> >
> >>>
> >>> Thanks for the response. You're on the right track but sorry I wasn't
> >>> clear
> >>> -- I'm referring to the location of the pages that the controller
> >>> accesses.
> >>> You are required to specify in the config where the controllers are
> >>> located
> >>> but not the base directory that holds all of the pages -- they default
> >>> to
> >>> /views/scripts. Is this changeable anywhere?
> >>>
> >>> Thanks!
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/application.ini---config-controllers-and-layouts%2C-but-not-pages--tp25492249p25501912.html
> >>> Sent from the Zend Framework mailing list archive at Nabble.com.
> >>>
> >>>
> >>
> >>
> >> --
> >> Shaun J. Farrell
> >> Washington, DC
> >> (202) 713-5241
> >> www.farrelley.com
> >>
> >>
> >
> > Perfect, thanks for this :)  I still think it's odd that controllers
> > require a config entry and views have a hard-coded start path but this is
> > what I was wanting. Thanks!
> >
>
> Inside your controller you are able to do something like:
> $this->view->addScriptPath(APPLICATION_PATH . '/my/new/script/path/'). I
> haven't had the need to change it globally but you could probably do
> something like resources.view.scriptPath. = "PATH". Correct me if I'm
> wrong someone.
>
> --
> View this message in context:
> http://www.nabble.com/application.ini---config-controllers-and-layouts%2C-but-not-pages--tp25492249p25508994.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


Re: [fw-general] Odd issue with new install regarding version number

2009-09-18 Thread Shaun Farrell
you zend tool maybe pointed at a different version of the framework that
your app is acutally running.

Try echoing  Zend_Version::version(); in your app and see what that gives
you.

if it shows your the version you downloaded and your Zf tool is a different
version you need to update your zf tool code.



On Fri, Sep 18, 2009 at 12:54 AM, Artsemis  wrote:

>
>
>
> Artsemis wrote:
> >
> > I was working through the quickstart and got to the part where I had to
> > create a controller -- which gave an error about finding the project
> file.
> > I did a quick Google and this was a problem with 1.9.0 that many people
> > seemed to have experienced on Windows.
> >
> > I went ahead and re-downloaded ZF and got the same result... I was sure
> to
> > download the "latest" (1.9.2). Here's the odd part... if I run "zf show
> > version", it says "Zend Framework Version 1.9.0"... my zip file and the
> > folder in it are even called ZendFramework-1.9.2.
> >
> > Any help would be GREATLY appreciated! :)
> >
> >
> > *edit*
> > Some additional information... that wrong version number seems to be
> > coming from C:\xampp\PEAR\Zend\Version.php. I have no idea why it's doing
> > this or how to fix it but I'm sure you guys will =)
> >
> > Thanks again
> >
>
>
> Well, I figured it out and I'll leave the answer here incase it helps
> someone else -- even though it's a bit embarrasing!  I remember seeing
> somewhere that your library include path should be placed at the beginning
> -- however, I didn't think much of it and placed it on the end. Simply move
> your library include to the beginning of include_path to give it priority
> over the xampp pear path that defaults in there and you should be good to
> go!
>
> --
> View this message in context:
> http://www.nabble.com/Odd-issue-with-new-install-regarding-version-number-tp25501965p25503102.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


Re: [fw-general] application.ini - config controllers and layouts, but not pages?

2009-09-18 Thread Shaun Farrell
Artsemis,

Check out this
http://framework.zend.com/manual/en/zend.view.controllers.html

I also think you can override the viewRenderer.  Below is an example from
framework.zend.com and shows how to use smarty.  I assume if you just change
the setViewBasePathSpec to your dir that might work.  haven't tested it but
worth a try


$view = new Zend_View_Smarty('/path/to/templates');
$viewRenderer =
new Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setView($view)
 ->setViewBasePathSpec($view->_smarty->template_dir)
 ->setViewScriptPathSpec(':controller/:action.:suffix')
 ->setViewScriptPathNoControllerSpec(':action.:suffix')
 ->setViewSuffix('tpl');



On Thu, Sep 17, 2009 at 9:45 PM, Artsemis  wrote:

>
>
>
> Matthew Weier O'Phinney-3 wrote:
> >
> > -- Artsemis  wrote
> > (on Thursday, 17 September 2009, 01:28 PM -0700):
> >> As implied by the subject, why do you config the base directory here for
> >> most
> >> things (specifically controllers) but can't for pages? Where can you
> >> change
> >> the path to pages?
> >
> > What do you mean by "pages"? Since ZF is front controller driven, all
> > "pages" of a ZF website are the result of controller actions...
> >
> > --
> > Matthew Weier O'Phinney
> > Project Lead| matt...@zend.com
> > Zend Framework  | http://framework.zend.com/
> >
> >
>
> Thanks for the response. You're on the right track but sorry I wasn't clear
> -- I'm referring to the location of the pages that the controller accesses.
> You are required to specify in the config where the controllers are located
> but not the base directory that holds all of the pages -- they default to
> /views/scripts. Is this changeable anywhere?
>
> Thanks!
> --
> View this message in context:
> http://www.nabble.com/application.ini---config-controllers-and-layouts%2C-but-not-pages--tp25492249p25501912.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


Re: [fw-general] Image Uplaod Validation Question

2009-08-06 Thread Shaun Farrell
I am pretty sure that is_valid() will catch this. Is worth testing though

On 8/6/09, ashoms0a  wrote:
>
> Hi there,
>
> I am just wondering how to verify that a given file is a valid image or not.
> I guess checking only the file extension & MIME type is not enough. What if
> someone rename for example a file from evil.php to something like
> flower.gif. Will this pass the validations? I just want to prevent such
> thing.
>
> Any help is highly appreciated.
> --
> View this message in context:
> http://www.nabble.com/Image-Uplaod-Validation-Question-tp24853528p24853528.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

-- 
Sent from my mobile device

Shaun J. Farrell
Washington, DC
(202) 713-5241
www.farrelley.com


[fw-general] SubForms | MultiPage Forms | Validation

2009-07-15 Thread Shaun Farrell
Question about multi page forms using subforms.

Ok so I have been looking at the example on
http://framework.zend.com/manual/en/zend.form.advanced.html#zend.form.advanced.multiPage
<http://framework.zend.com/manual/en/zend.form.advanced.html#zend.form.advanced.multiPage%20>which
is all good.

However, when you move to the next subform it validates the previous subform
to see if it isValid().  If so it checks to see if the whole form (all the
subforms) are isValid() and if it's not it moves onto the next subform in
the list.  It all works but the problem is when you move to the next form
which is a isPost() it automatically checks the validation on the full form
and subsequently displays the errors on the form that is the new next form.

The problem is that you are already posting when you display the next form
and I don't want the errors to display!  anyone know a good way to remove
validation errors when initially loading the 2nd and *n *subforms?

I am using this code
http://framework.zend.com/manual/en/zend.form.advanced.html#zend.form.advanced.multiPage


Thanks,
Shaun Farrell


Re: [fw-general] Confusion with Request object methods in ErrorController

2009-06-10 Thread Shaun Farrell
Dmity,

If getParam('module') is looking for URL/module/moduleValue/ while
getModuleName() returns the actual name of the module you are operating on.

http://www.example.com/view/list/module/test

controller = view
action = list
module is a param key (getParam('module'))
test is param value.


On Wed, Jun 10, 2009 at 11:25 AM, dmitrybelyakov
wrote:

>
> Hello,
>
> I just wonder - what's wrong with doing like this in my (default module's)
> ErrorController:
>
>$currentModule = $this->getRequest()->getParam('module');
>$currentModule = $this->getRequest()->getModuleName();
>
> Because I don't get the same results with these two functions.
>
> First one returns current module that produced an Exception, the second one
> just returns the default module that is handling the Exceptions.
>
> Why is that happening?
>
> Dmitry.
>
>
> --
> View this message in context:
> http://www.nabble.com/Confusion-with-Request-object-methods-in-ErrorController-tp23964756p23964756.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>


-- 
---
Shaun J. Farrell
Washington, DC
http://www.livinginthedistrict.com/
http://www.kapustabrothers.com/


[fw-general] Display images from db in view

2009-05-29 Thread Shaun Farrell
What is the easiest way to display base64 encoded images from a db in
a partial loop view file.   I have been having trouble trying to
figure out how to set its header to read the image.

Any suggestions?

-- 
Sent from my mobile device

---
Shaun J. Farrell
Washington, DC
http://www.livinginthedistrict.com/
http://www.kapustabrothers.com/


Re: [fw-general] Survey: Development environment for PHP/ZFW

2009-05-03 Thread Shaun Farrell
   1. What OS you are using during development? Windows? Mac? Linux?
  1. Mac with xampp installed.
   2. Do you edit source code on localhost or remote? i.e. is your testing
   environment reside on localhost or remote?
  1. Development --> Localhost (xampp)
   3. What tool or IDE you are using? Ultraedit? Apanta? Eclipse PDT?
  1. Zend Studio  and TextWrangler
   4. Which versioning system your are using? svn? git?
  1. SVN
   5. Do you use PHPUnit or other testing tools?
  1. PHP Unit but Not as much as I should  Have done some stuff with
  seleniun

Shaun Farrell


Re: [fw-general] Open Source Applications using Zend Framework?

2009-04-09 Thread Shaun Farrell
Try doing a search on github for zend or zendframework.

On 4/8/09, Yannick Mortier  wrote:
> Hello!
>
> I have got a question for the list... I hope it wasn't asked
> already... (I googled around a little bit but didn't find much.)
>
> I wanted to ask if there are some finished open source applications
> that use Zend Framework. Because I really need to look into the code
> deeper to get a bigger picture how some real-life applications are
> built with Zend Framework. The tutorials and blog posts always only
> treat an atomic part and I really want to learn the "Zend Way" like
> where to put functions that validate inputs that came from the users
> etc. I know there is Zend Validate but it seems like it should only be
> used for forms. And I need to verify the same thing for every method
> of the model. Copy and Paste is of course no option. But where to put
> the validation? A function in the model? But I want to use it in other
> models, too? An extra class? I don't know!
>
> Such are my probles right now and it would be great to have a code
> base of some bigger projects that I can use until I stand on my feet
> firmly.
>
> Thanks a lot in advance!
>
> Yannick Mortier
>
> --
> Currently developing a browsergame...
> http://www.p-game.de
> Trade - Expand - Fight
>
> Follow me on twitter!
> http://twitter.com/moortier
>

-- 
Sent from my mobile device

---
Shaun J. Farrell
Washington, DC
http://www.livinginthedistrict.com/
http://www.kapustabrothers.com/


[fw-general] Re: Zend_Form Decorators | Multiple Buttons On One Line

2009-04-02 Thread Shaun Farrell
That worked. If I am working with dojo forms with custom decorators is
there a different class I have to extend or does zend form decorator
abstract work.

I am having problems with errors displaying the dojo validation and
combobox elements with prepopulated data.   I am trying to use a
custom decorator.

-- thanks

On 4/1/09, Matthew Weier O'Phinney  wrote:
> -- Shaun Farrell  wrote
> (on Wednesday, 01 April 2009, 07:20 PM -0400):
>> I am just starting to figure out Zend_Form_Decorators and have a question
>> on
>> the best way to have Multiple buttons on one line all surround in one
>> > div>
>>
>> Here is what I have and it works but I am wondering is this the best way
>> to do
>> this?
>
> Group them in a DisplayGroup. :)
>
> Really -- that's what display groups are for. Have your buttons simply
> do a ViewHelper decorator, and then have the display group do a
> FormElements and HtmlTag decorator:
>
> $form->addElement('submit', 'submit', array(
> 'label' => 'Submit Button',
> 'decorators' => array(
> 'ViewHelper',
> ),
> ));
> $form->addElement('submit', 'cancel', array(
> 'label' => 'Cancel Button',
> 'decorators' => array(
> 'ViewHelper',
> ),
> ));
> $form->addElement('submit', 'submit1', array(
> 'label' => 'Submit One Button',
> 'decorators' => array(
> 'ViewHelper',
> ),
> ));
>
> $form->addDisplayGroup(array('submit', 'cancel, 'submit1'),
> 'submitButtons', array(
> 'decorators' => array(
> 'FormElements',
> array('HtmlTag', array('tag' => 'div', 'class' => 'element')),
> ),
> ));
>
> The above will create create the buttons one after another, and then
> group them in a  with the class of "element".
>
>
>> I have three decorators
>>
>> // adds the > public $openButtonDecorators = array(
>> 'ViewHelper',
>> array('HtmlTag', array('tag' => 'div', 'class' => 'element',
>> 'openOnly'
>> =>true))
>> );
>>
>> // just outputs a button no decorator
>> public $noButtonDecorators = array(
>>'ViewHelper',
>> );
>>
>> //closes the div on the last button.
>> public $closeButtonDecorators = array(
>> 'ViewHelper',
>> array('HtmlTag', array('tag' => 'div', 'class' => 'element',
>> 'closeOnly'=>true))
>> );
>>
>> Then I take the buttons and add the decorators to them.
>>
>> $form->addElement('submit', 'submit', array(
>> 'Name'=> 'Submit Button',
>> 'decorators' => $this->openButtonDecorators,
>> ));
>> $form->addElement('reset', 'cancel', array(
>> 'Name'=> 'Cancel Button',
>> 'decorators' => $this->noButtonDecorators,
>> ));
>> $form->addElement('submit', 'submit1', array(
>> 'Name'=> 'Submit One Button',
>> 'decorators' => $this->closeButtonDecorators,
>> ));
>>
>>
>> Is this the best way to do this?
>
> --
> Matthew Weier O'Phinney
> Software Architect  | matt...@zend.com
> Zend Framework  | http://framework.zend.com/
>

-- 
Sent from my mobile device

---
Shaun J. Farrell
Washington, DC
http://www.livinginthedistrict.com/
http://www.kapustabrothers.com/


[fw-general] Zend_Form Decorators | Multiple Buttons On One Line

2009-04-01 Thread Shaun Farrell
I am just starting to figure out Zend_Form_Decorators and have a question on
the best way to have Multiple buttons on one line all surround in one


Here is what I have and it works but I am wondering is this the best way to
do this?

I have three decorators

// adds the  'div', 'class' => 'element',
'openOnly'=>true))
);

// just outputs a button no decorator
public $noButtonDecorators = array(
   'ViewHelper',
);

//closes the div on the last button.
public $closeButtonDecorators = array(
'ViewHelper',
array('HtmlTag', array('tag' => 'div', 'class' => 'element',
'closeOnly'=>true))
);

Then I take the buttons and add the decorators to them.

$form->addElement('submit', 'submit', array(
'Name'=> 'Submit Button',
'decorators' => $this->openButtonDecorators,
));
$form->addElement('reset', 'cancel', array(
'Name'=> 'Cancel Button',
'decorators' => $this->noButtonDecorators,
));
$form->addElement('submit', 'submit1', array(
'Name'=> 'Submit One Button',
'decorators' => $this->closeButtonDecorators,
));


Is this the best way to do this?

Shaun J. Farrell
Washington, DC
http://www.livinginthedistrict.com/
http://www.kapustabrothers.com/


Re: [fw-general] Where to put my front controller plugin?

2009-03-04 Thread Shaun Farrell
Yeah that's where I have put mine too!  I'm not sure if this is the right
spot but seems to be the easiest and if located here it can be used in all
modules if i am not mistaken.

On a side note i have been looking around for a full app in ZF as a
reference guide.  It seems there are a ton of ways to do things.  Is there a
standard way to initialize items and get everything running with the
initializer.php file?



On Wed, Mar 4, 2009 at 4:04 AM, Robert Castley wrote:

>  Hi,
>
> I put mine in my library directory ( library is on my include path).
>
> e.g.
>
> library -> JotBug -> Plugin -> Language.php
>
> The plugin then starts with :
>
> class JotBug_Plugin_Language extends Zend_Controller_Plugin_Abstract
> {
>
>
>
>  --
> *From:* Dan Ballance [mailto:tzewang.do...@googlemail.com]
> *Sent:* 03 March 2009 17:30
> *To:* fw-general@lists.zend.com
> *Subject:* [fw-general] Where to put my front controller plugin?
>
>  Hiya folks,hopefully this will be a simple one. Have been googling like
> nuts but can't work out where I should place the actual file containing a
> front controller plugin in a default installation? Heeelp!
>
> Dan :-)
>
> 
> This email has been scanned for all known viruses by the MessageLabs Email
> Security Service and the Macro 4 plc internal virus protection system.
> 
>
> 
> This email has been scanned for all known viruses by the MessageLabs Email
> Security Service and the Macro 4 plc internal virus protection system.
> 
>



-- 
---
Shaun J. Farrell
Washington, DC
http://www.livinginthedistrict.com/
http://www.kapustabrothers.com/


[fw-general] Blog Platform | Zend Framework

2009-02-12 Thread Shaun Farrell
I know I saw one somewhere but does anyone know of a blog platform built off
of Zend Framework?

-- 
---
Shaun J. Farrell
Washington, DC
http://www.livinginthedistrict.com/
http://www.kapustabrothers.com/


Re: [fw-general] Getting Text from a PDF

2009-02-07 Thread Shaun Farrell
I used XPDF - http://www.foolabs.com/xpdf/ for indexing PDFs with Zend
http://www.kapustabrothers.com/2008/01/20/indexing-pdf-documents-with-zend_search_lucene/

Shaun

On Fri, Feb 6, 2009 at 9:08 AM, Matthias Buesing <
matthias.bues...@mediaraum.com> wrote:

> Hi Jonathan,
> I found pdftohtml which is exactly what I've been searching for.
>
> Thank you very much.
> Matthias
>
>
>
> Jonathan Maron schrieb:
> > Hello Matthias
> >
> > If you are running Linux, have you considered 'pdftotext'?
> >
> > http://linux.die.net/man/1/pdftotext
> >
> > If would be trivial to shell out using exec() and convert the text that
> way.
> >
> > If you choose this route, it is very important to ensure all
> > parameters being sent to exec() have not been manipulated.
> >
> > Jonathan Maron
> >
> >
> >
> > On Fri, Feb 6, 2009 at 12:44 PM, Matthias Buesing
> >  wrote:
> >> Hello,
> >> is there any way to get the Text from inside of a PDF with Zend_PDF?
> >> Or does anybody know a _free_ tool to do this?
> >>
> >> Greetings
> >> Matthias
> >>
> >>
>
>


-- 
---
Shaun J. Farrell
Washington, DC
http://www.livinginthedistrict.com/
http://www.kapustabrothers.com/