[fw-general] Zend studio and zend framework ?

2007-05-09 Thread Lepidosteus

Hello,

I'm using zend studio (5.5) for my php programming, and I wanted to
try the latest release release of the zend framework.

I've updated my files in %Zend Studio directory%\bin\ZendFramework
(I'm using the internal debugger).

When debugging everything works fine, the framework is updated.

My problem is about the code completion; while the new elements seems
to be listed (zend_version and zend_loader are shown, for exemple),
older (now non-existing) elements are still there.

For exemple, the code completion still list the Zend class and it's
method, which is a bit disturbing (in addition to being counter
productive).

Is there any think special to do to "refresh" the code completion of
zend studio ?

Thanks in advance
--
Lepidosteus


Re: [fw-general] Zend_Search_Lucene - Best Practices for Indexing 100k+ articles

2007-05-09 Thread webshark27

Hi,

I am running MaxMergeDocs with 1500 the rest with default (10 and 10);

The script online runs out of memory when I try to force an Optimize but
still it indexes the articles.

I currently have around 90 .cfs files

But now if I try to search I always get (a var dump of the Exception error)

Object(Zend_Search_Lucene_Exception)#4 (6) {
  ["message:protected"]=>
  string(156) "fopen(/path to the file/ab_index/index.lock) [ function.fopen
function.fopen ]: failed to open stream: Permission denied"
  ["string:private"]=>
  string(0) ""
  ["code:protected"]=>
  int(0)
  ["file:protected"]=>
  string(100) "/path to the
file/public_html/Zend/Search/Lucene/Storage/File/Filesystem.php"
  ["line:protected"]=>

Thanks,

Simon


Alexander Veremyev wrote:
> 
> Hi,
> 
> Zend_Search_Lucene uses memory for:
> 1. preloaded term dictionary index for reach index segment;
> So large number of segments increases memory usage.
> Segments may be merged into one with Zend_Search_Lucene::optimize()
> method.
> Segments are also partially auto-merged with auto-optimization process. 
> Auto-optimization behavior depends on MergeFactor and MaxMergeDocs 
> parameters.
> 
> 2. buffered docs (documents, which are indexed, but not dumped into new 
> segment);
> When number of buffered docs reaches MaxBufferedDocs parameter, new 
> segment is dumped into disk. It frees memory used for buffered docs.
> 
> Did you changed MergeFactor, MaxMergeDocs or MaxBufferedDocs parameters? 
> Or did you use default settings?
> 
> Which number of segments (number of .cfs files in index directory) do 
> you have when script crashes?
> 
> With best regards,
> Alexander Veremyev.
> 

-- 
View this message in context: 
http://www.nabble.com/Zend_Search_Lucene---Best-Practices-for-Indexing-100k%2B-articles-tf3712199s16154.html#a10403823
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Search index creating spider

2007-05-09 Thread Alexander Veremyev

Hi!

Zend_Search_Lucene_Document_Html::loadHTMLFile($file) may also take 
document from an URL.


Zend_Search_Lucene_Document_Html also may help to extract links from 
requested document:


$doc = Zend_Search_Lucene_Document_Html::loadHTMLFile($url);

$links   = $doc->getLinks();
$headerLinks = $doc->getHeaderLinks();


Zend_Http may also be useful for more delicate work with HTTP.


With best regards,
   Alexander Veremyev.

Ralph Schindler wrote:
Does anyone have a good reference for creating or using a spider to 
create an index of ones site for use with Zend_Search_Lucene?  I see 
where I can create an indexer in php, but I suppose I am looking for 
something that will do auto link discovery and be able to run via cron 
periodically.



Thanks,
Ralph






Re: [fw-general] Zend_Search_Lucene - Best Practices for Indexing 100k+ articles

2007-05-09 Thread Alexander Veremyev

Hi,

Zend_Search_Lucene uses memory for:
1. preloaded term dictionary index for reach index segment;
So large number of segments increases memory usage.
Segments may be merged into one with Zend_Search_Lucene::optimize() method.
Segments are also partially auto-merged with auto-optimization process. 
Auto-optimization behavior depends on MergeFactor and MaxMergeDocs 
parameters.


2. buffered docs (documents, which are indexed, but not dumped into new 
segment);
When number of buffered docs reaches MaxBufferedDocs parameter, new 
segment is dumped into disk. It frees memory used for buffered docs.


Did you changed MergeFactor, MaxMergeDocs or MaxBufferedDocs parameters? 
Or did you use default settings?


Which number of segments (number of .cfs files in index directory) do 
you have when script crashes?


With best regards,
   Alexander Veremyev.

webshark27 wrote:

Hello,

I am trying to create a new index.

I have over 130,000 full text articles in a MySQL database ranging from 300
- 1000 words.

I am trying to figure out the best practice to create the index as I am
running in to issues with Max memory exhausted errors when I get to around
15,000 articles.

I read http://framework.zend.com/manual/en/zend.search.index-creation.html

So I am basically doing this:

addField(Zend_Search_Lucene_Field::Text('title', sanitize($title)));
  $doc->addField(Zend_Search_Lucene_Field::Text('author',
sanitize($pname)));
  $doc->addField(Zend_Search_Lucene_Field::UnStored('contents', 
sanitize($content)));

  $index->addDocument($doc);
}
$index->commit();
?>

This crashes with memory exhausted for a PHP script (I have it set at 40MB).

I am trying to figure out what is being loaded in to memory and what would
the best way to run a script for a few hours that will index my whole DB
from the start to end.

Any help would be appreciated.





Re: [fw-general] TinyMCE, jQuery and ZF

2007-05-09 Thread Stuardo -StR- Rodríguez
On Wednesday 09 May 2007 06:36:35 Chris Hartjes wrote:
> Thank you all for your great help and suggestions.  I'm going to try
> FCKEditor and make sure to put that .htaccess file in there so that
> the rewrite engine doesn't mess things up.  Thanks again.

What we are using to help everything to find the right path un our systems is 
to have:

http://domain.tld/where/my/projectShouldBe/"; />

We need to have the full path so it works in IE and firefox, because JS in IE 
does not understand relative paths

-- 
Stuardo -StR- Rodríguez
http://strgt.cjb.net
<[EMAIL PROTECTED]>


[fw-general] Zend_Filter_Input is in the incubator

2007-05-09 Thread Bill Karwin
Hi,

I have committed a significant update to the proposed new
Zend_Filter_Input class.  
Unit tests provide 100% code coverage, and I have written documentation
content.
It's now ready for more review, as of revision 4776.

The code, tests, and docs are in the incubator.

Please post replies to [EMAIL PROTECTED], or in the proposal page:
http://framework.zend.com/wiki/x/D2k

Regards,
Bill Karwin


RE: [fw-general] validation using Zend_Validate_xxx

2007-05-09 Thread Bill Karwin
> -Original Message-
> From: Jur Jean [mailto:[EMAIL PROTECTED] 
> 
> This allows a user to create the filter in the parent 
> controller, and reset
> / add the rules in the actions on the fly.

An alternative would be to create the $filters and $validators arrays in
the controller, and simply manipulate them in the standard way because
they are arrays.  Then use them in actions to create new
Zend_Filter_Input objects.

> Also Zend_Filter_Input::isSubmitted() or something like that 
> can be useful.

I can't tell based on that description.  Can you elaborate on what the
function would do?

Regards,
Bill Karwin


Re: [fw-general] Zend_Db: SQL Functions in where clause

2007-05-09 Thread James Dempster

You need to create a Zend_Db_Expr so ZF doesnt try to escape the value.

See
http://framework.zend.com/manual/en/zend.db.select.html#zend.db.select.building.columns-expr.example

On 5/9/07, Tony Harrison <[EMAIL PROTECTED]> wrote:


Hello, how do you put a function as a field value in a where clause? Like:

UPDATE table SET date = NOW() WHERE

I can't work out how to do it with the Zend_Db update() method.



Re: [fw-general] TinyMCE, jQuery and ZF

2007-05-09 Thread James Dempster

I also found FCKEditor best, but it does come down to personal choice they
both can work with ZF with no problems provided they are setup correctly.

On 5/9/07, Jeunejean Pierre <[EMAIL PROTECTED]> wrote:


I used TinyMCE in my CMS (based on ZF) but I was very unhappy with the
generated HTML code quality.
I use now FCKeditor http://www.fckeditor.net/, and I must say it's a
must have, easy to integrate, to configure, good documentation, most
complete editor I have seen.



Chris Hartjes wrote:
> I was wondering if anyone out there has had any luck getting TinyMCE
> to work properly using jQuery and Ajax within ZF.  I'm basically
> trying to use some Ajax techniques to dynamically display a form with
> a TinyMCE instance in it.  Can't seem to get it to work properly, and
> are having a hard time figuring out where to load the TinyMCE stuff,
> and where the TinyMCE initialization goes, etc.  Haven't been able to
> find much help with google (points to a plugin that seems to no longer
> exist).
>
> Any help would be appreciated.
>


--
Pierre Jeunejean
gérant

[EMAIL PROTECTED]
www.adnexus.be

Wirtzfeld 3a, B-4760 Büllingen
Tel: 0478556586

A D N E X U S
Solutions informatiques Internet en sous-traitance pour les agences
publicitaires.
Solutions informatiques de gestion sur mesure pour les entreprises.






Re: [fw-general] Invoke Arg in Plugin

2007-05-09 Thread Matthew Weier O'Phinney
-- Rob Allen <[EMAIL PROTECTED]> wrote
(on Wednesday, 09 May 2007, 03:22 PM +0100):
> Matthew Weier O'Phinney wrote:
> > -- Rob Allen <[EMAIL PROTECTED]> wrote
> > (on Tuesday, 08 May 2007, 07:01 AM +0100):
> > > Todd Wolaver wrote:
> > > > Yes, I've just run into this myself and I ended up using
> > > > the Zend_Controller_Front::getInstance()
> > > >
> > > > i.e.
> > > > $this->_config  = 
> > > > Zend_Controller_Front::getInstance()->getParam('config');
> > > >
> > > > Todd
> > > >
> > > Isn't this just like treating the front controller as if it's a
> > > registry? If so, I would have thought that using Zend_Registry would
> > > make it more explicit that this is what you are doing?
> > >
> > > i.e. what's the benefit of using the FC's setParam() in these cases over
> > > Zend_Registry?
> > 
> > The idea of adding parameter handling to the front controller arose out
> > of a desire to reduce the number of dependencies in the front controller
> > (loose coupling), as well as allow the ability to pass *any* type of
> > variable through the front controller chain. Zend_Registry is an
> > object-only registry, so it fails in the second case, and introduces a
> > dependency in the first.,
> 
> I'm nearly sure Zend_Registry is no longer object-only.

Oh, interesting! I get so wrapped up in components I work on, I often don't
look under the hood at others. I see that Zend_Registry now extends
ArrayObject, and that set() no longer checks that the $value passed is
an object... so, I stand corrected.



> > As to the benefit of using the front controller params instead of a
> > registry, it helps keep such objects in a specific domain. Were these
> > registered in a general global registry, it wouldn't be clear that they
> > are meant for use with the MVC components specifically. It's really a
> > matter of preference, but that's certainly one argument I've used.
> 
> Yeah - definitely a toss-up; especially for params that aren't used
> until you get to the action function itself. I just wanted to ensure
> that I wasn't missing a clearly better way of doing it :)
> 
> Personally, I wouldn't pass config or the database adapter around as a
> front controller param, but that's just me!

It's basically a matter of preference. Do you need a global registry in
your application, or are you simply doing an MVC app? If your code isn't
going to be re-used in cronjobs, services, or other arenas, pushing the
database connection and config objects into the front controller (and
hence the router, dispatcher, and action controllers) might make as much
sense as using a registry, and save you the effort of loading and
calling on the registry within your code. If you *will* be re-using such
objects in other types of scripts, though, then passing them into the
registry probably makes more sense.

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


[fw-general] Zend_Db: SQL Functions in where clause

2007-05-09 Thread Tony Harrison
Hello, how do you put a function as a field value in a where clause? Like:

UPDATE table SET date = NOW() WHERE

I can't work out how to do it with the Zend_Db update() method.


Re: [fw-general] Invoke Arg in Plugin

2007-05-09 Thread Rob Allen
Matthew Weier O'Phinney wrote:
> -- Rob Allen <[EMAIL PROTECTED]> wrote
> (on Tuesday, 08 May 2007, 07:01 AM +0100):
>> Todd Wolaver wrote:
>>> Yes, I've just run into this myself and I ended up using
>>> the Zend_Controller_Front::getInstance()
>>>
>>> i.e.
>>> $this->_config  = Zend_Controller_Front::getInstance()->getParam('config');
>>>
>>> Todd
>>>
>> Isn't this just like treating the front controller as if it's a
>> registry? If so, I would have thought that using Zend_Registry would
>> make it more explicit that this is what you are doing?
>>
>> i.e. what's the benefit of using the FC's setParam() in these cases over
>> Zend_Registry?
> 
> The idea of adding parameter handling to the front controller arose out
> of a desire to reduce the number of dependencies in the front controller
> (loose coupling), as well as allow the ability to pass *any* type of
> variable through the front controller chain. Zend_Registry is an
> object-only registry, so it fails in the second case, and introduces a
> dependency in the first.,

I'm nearly sure Zend_Registry is no longer object-only.

> As for the need for arbitrary data, as an example, internally there are
> several boolean flags you can pass via setParam() that are picked up by
> the dispatcher and router in order to customize their behaviours.

Oh, I 100% agree with setParam for setting stuff to be picked up by the
dispatcher/router.

> 
> As to the benefit of using the front controller params instead of a
> registry, it helps keep such objects in a specific domain. Were these
> registered in a general global registry, it wouldn't be clear that they
> are meant for use with the MVC components specifically. It's really a
> matter of preference, but that's certainly one argument I've used.

Yeah - definitely a toss-up; especially for params that aren't used
until you get to the action function itself. I just wanted to ensure
that I wasn't missing a clearly better way of doing it :)

Personally, I wouldn't pass config or the database adapter around as a
front controller param, but that's just me!

Regards,

Rob...




Re: [fw-general] request life cycle

2007-05-09 Thread Matthew Weier O'Phinney
-- Hoopes <[EMAIL PROTECTED]> wrote
(on Tuesday, 08 May 2007, 11:12 PM -0400):
> I'm just getting started with zend framework, so please go easy on me
> if my question is...newbish. Anyway, i'm screwing around with the
> request lifecycle, and it would just be a lot easier if i knew what
> went on with the various routers, plugins, controllers, dispatches,
> etc. Is the process general to all MVC frameworks? If so, is there a
> walkthrough of what each of these classes does, and when they do what
> they do? Or am I better off waiting for the 1.0 release, which should
> hopefully come with the "web application howto" docs?

I rewrote the docs for Zend_Controller for the 0.9.3 release, and the
main thrust of it was to detail the dispatch process as a whole, and
then give greater detail on each of the subcomponents.

The process is not necessarily the same in all MVC frameworks, though
the basic principals are the same (separating display and business
logic; using a controller to determine what models are in play and which
views to use).

Check out the new documentation:

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

and give feedback where things are unclear, either to the list or via
the issue tracker.

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


Re: [fw-general] TinyMCE, jQuery and ZF

2007-05-09 Thread Jeff Busby




Chris you might want to have a look at Xinha as well, I'm currently
using it in a project with ZF and so far it's working great.  I used
WysiwygPro in my last project it worked well too, although it's not
free.

Chris Hartjes wrote:
Thank you all for your great help and suggestions.  I'm
going to try
  
FCKEditor and make sure to put that .htaccess file in there so that
  
the rewrite engine doesn't mess things up.  Thanks again.
  
  
  


-- 



Jeff Busby

[EMAIL PROTECTED] 



h. 905.635.9737  
c. 905.407.4359  
http://www.jeffbusby.ca 







Re: [fw-general] RE: Zend_Search_Lucene - Best Practices for Indexing 100k+ articles

2007-05-09 Thread Craig Slusher

webshark27,

When you get your articles indexed, it would be really great if you
can share your experience with searching against it. I would love to
know how well the Zend implementation of Lucene handles the load.

On 5/8/07, webshark27 <[EMAIL PROTECTED]> wrote:


Hi Chris,

Thanks for the quick response.

Doesn't the "$doc = new Zend_Search_Lucene_Document();" just overwrite the
old one?

Also I think the $index->addDocument($doc) is filling up the memory fast, I
don't know exactly how to play with the MergeFactor, MaxMergeDocs and
MaxBufferedDocs effects this issue.

I am running 10,000 each time and then commit changes - load the script
again and running 


Chris Blaise wrote:
>
>
>   It's been a few months since I worked with this but I had some weird
> errors that I'm not sure if I figured out was due to running out of memory
> or it if it was due to some weird corruption I was seeing that caused the
> script to exit.
>
>   The fix to my problem was to free memory.  In your case try setting
> $doc to null when you're finished with it in the loop, right after the
> $index->addDocument($doc).
>
>  Chris
>
>

--
View this message in context: 
http://www.nabble.com/Zend_Search_Lucene---Best-Practices-for-Indexing-100k%2B-articles-tf3712199s16154.html#a10385215
Sent from the Zend Framework mailing list archive at Nabble.com.





--
Craig Slusher
[EMAIL PROTECTED]


Re: [fw-general] TinyMCE, jQuery and ZF

2007-05-09 Thread Chris Hartjes

Thank you all for your great help and suggestions.  I'm going to try
FCKEditor and make sure to put that .htaccess file in there so that
the rewrite engine doesn't mess things up.  Thanks again.


--
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard


Re: [fw-general] TinyMCE, jQuery and ZF

2007-05-09 Thread Bastian Gerhard

Chris,

Vice versa - I used FCKeditor in a CMS project and was not  
overwhelmingly happy with it.
I find TinyMCE much more usable, faster and less error-prone in terms  
of cross-browser issues.


What exactly is your problem with TinyMCE?

Not sure how this is related to ZF, however, I utilize TinyMCE  
together with the Dojo scripting framework.
Actually my code is much more complex and it took quite a while to  
get TinyMCE to work properly.

The following example should give a basic clue though:


tinyMCE.init({
mode: "exact",
theme: "advanced",
theme_advanced_buttons1: "bold,italic,underline,separator,strikethrough,bullist,numlist,undo,redo ,link,unlink",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_path_location: false
});
var i = tinyMCE;
i.execCommand('mceAddControl', true, 'text')






One more thing: For some odd reason Firefox 2(?) doesnt seem to  
instantiate TinyMCE properly, unless we give it some time to think  
things over.
The following workaround creates the instance with a short delay.  
Works fine for me.



window.setTimeout(
  function() {
i.tinyInstance.execCommand('mceAddControl', true, 'text');
  }
  , 1000
);




Cheers
Bastian



On May 9, 2007, at 5:51 PM, Jeunejean Pierre wrote:

I used TinyMCE in my CMS (based on ZF) but I was very unhappy with  
the generated HTML code quality.
I use now FCKeditor http://www.fckeditor.net/, and I must say it's  
a must have, easy to integrate, to configure, good documentation,  
most complete editor I have seen.




Chris Hartjes wrote:

I was wondering if anyone out there has had any luck getting TinyMCE
to work properly using jQuery and Ajax within ZF.  I'm basically
trying to use some Ajax techniques to dynamically display a form with
a TinyMCE instance in it.  Can't seem to get it to work properly, and
are having a hard time figuring out where to load the TinyMCE stuff,
and where the TinyMCE initialization goes, etc.  Haven't been able to
find much help with google (points to a plugin that seems to no  
longer

exist).

Any help would be appreciated.




---

Bastian Gerhard
Technology Group, Ashley Associates Ltd.

Minami-Aoyama First Building 8F,
7-8-1 Minami-Aoyama,
Minato-ku,
Tokyo 107-0062,
JAPAN





Re: [fw-general] validation using Zend_Validate_xxx

2007-05-09 Thread Jur Jean


Dale McNeill wrote:
> 
> I'd like to propose a way to override the default Zend_Validate_xxx 
> error message.  Possibly as an optional constructor argument. 
> 

Same here.

Dunno if I'm to early with this stuff (as it is in the incubator) but it may
be an idea to add the following functions.

Zend_Filter_Input::setFilterRules();
Zend_Filter_Input::addFilterRules();
Zend_Filter_Input::setValidationRules();
Zend_Filter_Input::addValidationRules();

This allows a user to create the filter in the parent controller, and reset
/ add the rules in the actions on the fly.

Also Zend_Filter_Input::isSubmitted() or something like that can be useful.
-- 
View this message in context: 
http://www.nabble.com/validation-using-Zend_Validate_xxx-tf3694179s16154.html#a10390943
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] TinyMCE, jQuery and ZF

2007-05-09 Thread Jeunejean Pierre
I used TinyMCE in my CMS (based on ZF) but I was very unhappy with the 
generated HTML code quality.
I use now FCKeditor http://www.fckeditor.net/, and I must say it's a 
must have, easy to integrate, to configure, good documentation, most 
complete editor I have seen.




Chris Hartjes wrote:

I was wondering if anyone out there has had any luck getting TinyMCE
to work properly using jQuery and Ajax within ZF.  I'm basically
trying to use some Ajax techniques to dynamically display a form with
a TinyMCE instance in it.  Can't seem to get it to work properly, and
are having a hard time figuring out where to load the TinyMCE stuff,
and where the TinyMCE initialization goes, etc.  Haven't been able to
find much help with google (points to a plugin that seems to no longer
exist).

Any help would be appreciated.




--
Pierre Jeunejean
gérant

[EMAIL PROTECTED]
www.adnexus.be

Wirtzfeld 3a, B-4760 Büllingen
Tel: 0478556586

A D N E X U S
Solutions informatiques Internet en sous-traitance pour les agences 
publicitaires.
Solutions informatiques de gestion sur mesure pour les entreprises.