Re: [fw-general] router question - how to hide default module, controller and action in url?
ok now I created: $router-addRoute( 'url', new Zend_Controller_Router_Route(':lang/:module/:category/:controller/:action/:test', array('module'='default', 'controller' = 'index', 'action' = 'index', 'lang' = 'en', 'category'= 'categ1', 'test'='somevalue')) ); but the problem remains. For example i write: http://domain/there_should_be_category/ and result is: [_params:protected] = array(6) { [lang] = string(24) there_should_be_category [module] = string(7) default [controller] = string(5) index [action] = string(5) index [category] = string(6) categ1 [test] = string(9) somevalue } or url:http://domain/en/there_should_be_category/there_should_be_test_value result: _params:protected] = array(6) { [lang] = string(2) en [module] = string(24) there_should_be_category [category] = string(26) there_should_be_test_value [controller] = string(5) index [action] = string(5) index [test] = string(9) somevalue } I don't want everytime in my url include default language parameter and same with default model, controllers and action. -- View this message in context: http://www.nabble.com/router-question---how-to-hide-default-module%2C-controller-and-action-in-url--tp14948082s16154p14993974.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Warning: Significant issues with Zend_Search_Lucene (index corruption is easy...)
Hi Everybody... First of all let me start of by saying that I am very grateful to all ZF contributors. While testing Zend_Search_Lucene for production use I have found what I believe is a major bug in concurrency: If two threads are updating the index at the same time the index is easily corrupted and unusable. Some specific situations that cause Exceptions + index corruption: - two different threads adding and/or deleting different documents at the same time - calling the $index-optimize() command while another thread is adding and/or deleting documents. An exception thrown, usually something like: 'Zend_Search_Lucene_Exception' with message 'File '[some_index_file_in_the_data_directory]' is not readable.'... The index remains unusable/corrupted for all future requests. I am not familiar with the deep inner workings of Zend_Search_Lucene but I believe there to be a bug in how flock is being used by Zend/Search/Lucene/Storage/File/Filesystem.php I have tested the latest code from SVN with no luck (and the code from release 1.03 fails for different bugs/reasons). I know some of you may suggest that my filesystem or kernel may not support the flock feature - but I checked that as well. PHP's flock() function works as expected (tested on a fresh standard Fedora Core 4). It should also be noted that certain aspects of the locking *do* work: - if a single thread is writing (updating) the index, and other threads are just reading (searching) the index, the writing/reading threads seem to block each other properly, without any problems. I would hate to see developers affected by this major (IMHO) problem. Especially if your indexes are large and take several minutes or hours to rebuild. To help the ZF contributors I can post a working example that demonstrates all of the above. Thanks - DM -- View this message in context: http://www.nabble.com/Warning%3A-Significant-issues-with-Zend_Search_Lucene-%28index-corruption-is-easy...%29-tp14994669s16154p14994669.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] google indexing site
i have developed a zf based cms. for some reason google can not recognize any of the links on the site. i tried a robot emulator, and it shows no pages. i installed the lynx text browser, and all of the links / navigation are visible. is this something new with google or is there something else i need to do (htaccess?). -- View this message in context: http://www.nabble.com/google-indexing-site-tp14995990s16154p14995990.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Zend Helpers
Matt Apologies the stuff I needed was in the docs. However still no joy, this is my stack output for the view - and I assume if the new path was registered correctly then it would show up in here Zend_View Object ( [_path:private] = Array ( [script] = Array ( [0] = sites\admintrianglesolutions\views\scripts\ ) [helper] = Array ( [0] = Array ( [prefix] = Zend_View_Helper_ [dir] = sites\admintrianglesolutions\views\helpers\ ) [1] = Array ( [prefix] = Zend_View_Helper_ [dir] = D:\AWebEnvironment\ZendFramework-1.0.3\library\Zend\View\Helper\ ) ) Registering the path - tried in controller and a few other places. $view = new Zend_View(); // Add /other/path/to/helpers with class prefix 'Your_View_Helper' $view-addHelperPath('D:\AWebEnvironment\htdocs\Site_Template\library\Common\Components', 'Common_Components'); My helper class taken from the example. ?php class Common_Components_SpecialPurpose { protected $_count = 0; public function specialPurpose() { $this-_count++; $output = I have you {$this-_count} time(s).; return htmlspecialchars($output); } } Ok having debugged the View files in the Framework it seems that I am instantiating the View class adding the helpers - below is an output of _path Array ( [script] = Array ( ) [helper] = Array ( [0] = Array ( [prefix] = Common_Components_ [dir] = library\Common\Components\ ) [1] = Array ( [prefix] = Common_Components_ [dir] = D:\AWebEnvironment\htdocs\Site_Template\library\Common\Components\ ) ) but then the view is getting instantiated again somewhere and killing my adding paths with its own SetPath Same output of _path [helper] = Array ( [0] = Array ( [prefix] = Zend_View_Helper_ [dir] = sites\admintrianglesolutions\views\helpers\ ) [1] = Array ( [prefix] = Zend_View_Helper_ [dir] = D:\AWebEnvironment\ZendFramework-1.0.3\library\Zend\View\Helper\ ) ) So its basicalyl getting overwritten later on. Should this happen? I am not calling new Zend_View anywhere else in my code - so it must be when the viewRenderer is automatically instantiated find this very wierd Ian Matthew Weier O'Phinney wrote: -- Ian Warner [EMAIL PROTECTED] wrote (on Sunday, 20 January 2008, 07:54 PM +): $view = new Zend_View(); // Add /other/path/to/helpers with class prefix 'Your_View_Helper' $view-setHelperPath('D:\AWebEnvironment\htdocs\Site_Template\library\Zend\View\Helper', 'Common_Components'); I have tried the above and also with addHelperPath and still no luck - tried this on my ubuntu machine also. whats the naming convention for helpers, the docs dont give any advice on what the actual file name should be Not to be mean, but they *do* spell it out, several times: http://framework.zend.com/manual/en/zend.view.helpers.html Second paragraph: A helper is simply a class. Let's say we want a helper named 'fooBar'. By default, the class is prefixed with 'Zend_View_Helper_' (you can specify a custom prefix when setting a helper path), and the last segment of the class name is the helper name; this segment should be TitleCapped; the full class name is then: Zend_View_Helper_FooBar. And further in that same page: 37.4.3. Writing Custom Helpers Writing custom helpers is easy; just follow these rules: * The class name must, at the very minimum, end with the helper name itself, using CamelCaps. E.g., if you were writing a helper called specialPurpose, the class name would minimally need to be SpecialPurpose. You may, and should, give the class name a prefix, and it is recommended that you use 'View_Helper' as part of that prefix: My_View_Helper_SpecialPurpose. (You will need to pass in the prefix, with or without the trailing underscore, to addHelperPath() or setHelperPath()). There's also one other place it's mentioned, in the section detailing helper paths. So, in your example, if you have the prefix Common_Components as your view helper class prefix, and your library code is in D:\AWebEnvironment\htdocs\Site_Template\Library\', the most logical place to put these helpers would be in the Common\Components\
Re: [fw-general] Zend Helpers
-- Ian Warner [EMAIL PROTECTED] wrote (on Monday, 21 January 2008, 12:24 PM +): However still no joy, this is my stack output for the view - and I assume if the new path was registered correctly then it would show up in here snip Registering the path - tried in controller and a few other places. $view = new Zend_View(); // Add /other/path/to/helpers with class prefix 'Your_View_Helper' $view-addHelperPath('D:\AWebEnvironment\htdocs\Site_Template\library\Common\Components', 'Common_Components'); My helper class taken from the example. ?php class Common_Components_SpecialPurpose { protected $_count = 0; public function specialPurpose() { $this-_count++; $output = I have you {$this-_count} time(s).; return htmlspecialchars($output); } } The above looks good... Ok having debugged the View files in the Framework it seems that I am instantiating the View class adding the helpers - below is an output of _path snip -- path looked good but then the view is getting instantiated again somewhere and killing my adding paths with its own SetPath Same output of _path [helper] = Array ( [0] = Array ( [prefix] = Zend_View_Helper_ [dir] = sites\admintrianglesolutions\views\helpers\ ) [1] = Array ( [prefix] = Zend_View_Helper_ [dir] = D:\AWebEnvironment\ZendFramework-1.0.3\library\Zend\View\Helper\ ) ) So its basicalyl getting overwritten later on. Should this happen? I am not calling new Zend_View anywhere else in my code - so it must be when the viewRenderer is automatically instantiated I see what's going on. Yes, the ViewRenderer instantiates its own view unless it is provided one -- so if you want to add a global helper path, you need to tell the ViewRenderer. (The view object is not a singleton, so if you set the helper path on one instance, it doesn't propagate to other instances.) You have a couple of ways of doing this. In your bootstrap, you can create your view object, and inject it into the ViewRenderer: $view = new Zend_View(); $view-addHelperPath('path/to/Common/Components/', 'Common_Components'); Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer') -setView($view); (I broke the last statement over two lines to make it readable.) The next option is to take the view out of the ViewRenderer and alter it. The method for doing so varies, based on whether the ViewRenderer will have initialized the view object or not. The ViewRenderer first initializes its view when its internal init() method is called -- which is triggered the first time a controller is dispatched. So, let's say you want to do the above in an early running plugin -- in which case the view won't have been initialized. Here's one example of how that might work: class ViewPlugin extends Zend_Controller_Plugin_Abstract { public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) { $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer') $viewRenderer-initView(); $viewRenderer-view-addHelperPath( 'path/to/Common/Components', 'Common_Components'); } } If you wanted to set it from within a controller or an action helper, the view will have been initialized, and you can just do the following: $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer') $viewRenderer-view-addHelperPath( 'path/to/Common/Components', 'Common_Components'); Hope that helps. Matthew Weier O'Phinney wrote: -- Ian Warner [EMAIL PROTECTED] wrote (on Sunday, 20 January 2008, 07:54 PM +): $view = new Zend_View(); // Add /other/path/to/helpers with class prefix 'Your_View_Helper' $view-setHelperPath('D:\AWebEnvironment\htdocs\Site_Template\library\Zend\View\Helper', 'Common_Components'); I have tried the above and also with addHelperPath and still no luck - tried this on my ubuntu machine also. whats the naming convention for helpers, the docs dont give any advice on what the actual file name should be Not to be mean, but they *do* spell it out, several times: http://framework.zend.com/manual/en/zend.view.helpers.html Second paragraph: A helper is simply a class. Let's say we want a helper named 'fooBar'. By default, the class is prefixed with 'Zend_View_Helper_' (you can specify a custom prefix when setting a helper path), and the last segment of the class name is the helper name; this segment should be TitleCapped; the full class name is then: Zend_View_Helper_FooBar. And further in that same page: 37.4.3.
[fw-general] Zend_Acl MVC Integration is ready for review
Hi, I just finished the work in this component, comments about it are welcome. http://framework.zend.com/wiki/pages/viewpage.action?pageId=39025 Aldemar
Re: [fw-general] Zend Lucene Search - find() best Practices?
When you use the $index-find() method with a string, special characters such as *, ? and keywords such as and are parsed as part of the Lucene query language. As such, misplacing them will cause an exception. What you probably want to do is to take the input and treat it as a literal string, and use the query API (see docs) to build a query object out of it. Good luck, Shahar. On Mon, 2008-01-21 at 05:19 -0800, boopfm523 wrote: $query = $_GET['query']; $hits = $index-find($query); signature.asc Description: This is a digitally signed message part
Re: [fw-general] google indexing site (update)
You'll probably be better off creating a static robots.txt file and altering your .htaccess rewrite rule to allow direct access to .txt files: RewriteEngine on RewriteRule !\.(js|ico|gif|jpg|png|css|txt)$ index.php Performance wise, this will be much smarter, as I doubt you need a dynamic robots.txt. Shahar. On Mon, 2008-01-21 at 05:07 -0800, digitalus_media wrote: I analyzed the robots.txt file and found it was returning this error: Fatal error: Uncaught exception 'Zend_Locale_Exception' with message 'Autodetection of Locale has been failed!' i have set the locale in index.php: $locale = new Zend_Locale('en_US'); and have set a static route to the robots file: //robots.txt $route = new Zend_Controller_Router_Route_Static( 'robots.txt', array( 'module' = 'public', 'controller' = 'systemPages', 'action' = 'robots' ) ); $router-addRoute('robots.txt', $route); action: function robotsAction() { $this-getResponse()-setHeader('Content-Type', 'text/plain'); $disallow = $this-_config-robots-toArray(); if(is_array($disallow)){ echo User-agent: * \n; foreach ($disallow as $dir) { echo Disallow: . $dir . \n; } } } signature.asc Description: This is a digitally signed message part
Re: [fw-general] Zend Helpers
Matt Thanks for your patience and persistance :) That indeed worked. I utilised the first method. As I am basically creating an area for global helpers - actually mostly for Facebook Common Tasks such as there Form rendering and other components such as the Wall. Is there a repository of Helpers that other users have created? i would find this very helpful to either draw from or submit too - this kind of thing would not need to be monitored very much as the code snippets would be small and isolated I would think in most cases. Again thank you Cheers Ian Matthew Weier O'Phinney wrote: -- Ian Warner [EMAIL PROTECTED] wrote (on Monday, 21 January 2008, 12:24 PM +): However still no joy, this is my stack output for the view - and I assume if the new path was registered correctly then it would show up in here snip Registering the path - tried in controller and a few other places. $view = new Zend_View(); // Add /other/path/to/helpers with class prefix 'Your_View_Helper' $view-addHelperPath('D:\AWebEnvironment\htdocs\Site_Template\library\Common\Components', 'Common_Components'); My helper class taken from the example. ?php class Common_Components_SpecialPurpose { protected $_count = 0; public function specialPurpose() { $this-_count++; $output = I have you {$this-_count} time(s).; return htmlspecialchars($output); } } The above looks good... Ok having debugged the View files in the Framework it seems that I am instantiating the View class adding the helpers - below is an output of _path snip -- path looked good but then the view is getting instantiated again somewhere and killing my adding paths with its own SetPath Same output of _path [helper] = Array ( [0] = Array ( [prefix] = Zend_View_Helper_ [dir] = sites\admintrianglesolutions\views\helpers\ ) [1] = Array ( [prefix] = Zend_View_Helper_ [dir] = D:\AWebEnvironment\ZendFramework-1.0.3\library\Zend\View\Helper\ ) ) So its basicalyl getting overwritten later on. Should this happen? I am not calling new Zend_View anywhere else in my code - so it must be when the viewRenderer is automatically instantiated I see what's going on. Yes, the ViewRenderer instantiates its own view unless it is provided one -- so if you want to add a global helper path, you need to tell the ViewRenderer. (The view object is not a singleton, so if you set the helper path on one instance, it doesn't propagate to other instances.) You have a couple of ways of doing this. In your bootstrap, you can create your view object, and inject it into the ViewRenderer: $view = new Zend_View(); $view-addHelperPath('path/to/Common/Components/', 'Common_Components'); Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer') -setView($view); (I broke the last statement over two lines to make it readable.) The next option is to take the view out of the ViewRenderer and alter it. The method for doing so varies, based on whether the ViewRenderer will have initialized the view object or not. The ViewRenderer first initializes its view when its internal init() method is called -- which is triggered the first time a controller is dispatched. So, let's say you want to do the above in an early running plugin -- in which case the view won't have been initialized. Here's one example of how that might work: class ViewPlugin extends Zend_Controller_Plugin_Abstract { public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) { $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer') $viewRenderer-initView(); $viewRenderer-view-addHelperPath( 'path/to/Common/Components', 'Common_Components'); } } If you wanted to set it from within a controller or an action helper, the view will have been initialized, and you can just do the following: $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer') $viewRenderer-view-addHelperPath( 'path/to/Common/Components', 'Common_Components'); Hope that helps. Matthew Weier O'Phinney wrote: -- Ian Warner [EMAIL PROTECTED] wrote (on Sunday, 20 January 2008, 07:54 PM +): $view = new Zend_View(); // Add /other/path/to/helpers with class prefix 'Your_View_Helper' $view-setHelperPath('D:\AWebEnvironment\htdocs\Site_Template\library\Zend\View\Helper', 'Common_Components'); I have tried the above and also with addHelperPath and still no luck - tried this on my ubuntu machine also. whats the naming convention for helpers, the docs dont give any advice on what the actual file name should be
AW: [fw-general] Zend_Factory/Zend_Loader addition suggestion
Sounds cool! This would make testing in ZF much easier. In my opinion the Zend_Factory should somehow be integrated into Zend_Loader, to integrate easy in auto loaded environments. Probably Zend_Factory can even be a solution to replace components in the system without subclassing and copying a lot of code. But for this it should be possible to replace classes not only by object but also by other names. Cheers, leo Von: Pádraic Brady [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Januar 2008 22:21 An: Zend Framework General Betreff: [fw-general] Zend_Factory/Zend_Loader addition suggestion Hi guys, I'm currently working on a project to implement Zend Framework controller and model testing and specification. I'm looking for opinions on whether this is feasible - the main problem I have is that directly instantiating objects within controllers makes it impossible for any testing suite from isolating the controller action from it's carrying objects. Without requiring some perverse parameter acrobatics or requiring configuration heavy injectors like Pico or Phemto a simple solution (I think) is to enable a simplified object loader of a few dozen lines to be added for use. This could be added either as a separate class Zend_Factory, or appended to Zend_Loader (which seems appropriate). I've copied the current sample code and unit tests below. In use, it would require a simple call of: Zend_Factory::create('Zend_Mail'); Then a unit test or BDD spec could mock this object result (before the create() call of course) using: Zend_Factory::replaceClass('Zend_Mail', new ZMail_Mock); Here's the suggested source code and unit tests. Any comments or criticisms most welcome - not sure if it's worth an actual proposal given it's size but it's of immense value to my ongoing work. If you prefer online viewing it's at: http://svn.astrumfutura.org/zendframework/trunk/library/Proposed/Zend/Factory.php Zend/Factory.php: ?php require_once 'Zend/Loader.php'; require_once 'Zend/Registry.php'; /** * Abstract object instantiation with minimal setup and allow for replacement * of created object return values by preceding unit tests or BDD specifications * */ class Zend_Factory { /** * Registry instance for holding replacement objects * * @var Zend_Registry */ protected static $_registry = null; /** * Create a new object based on the referenced class name and construction * parameters. If a registered replacement object exists, this will be * returned instead. * * @param object $className * @param array $constructionParams * @return object */ public static function create($className, array $constructionParams = null) { if (!class_exists($className, true)) { Zend_Loader::loadClass($className); } if (isset(self::$_registry-$className)) { return self::$_registry-$className; } if ($constructionParams !== null) { $refClass = new ReflectionClass($className); $createdObject = $refClass-newInstanceArgs($constructionParams); } else { $createdObject = new $className; } return $createdObject; } /** * Replace the return value of any call for an instance of the referenced * class name with an alternative object. * * @param string $className * @param object $withObject */ public static function replaceClass($className, $withObject) { if (self::$_registry == null) { self::$_registry = new Zend_Registry(array(), ArrayObject::ARRAY_AS_PROPS); } self::$_registry-$className = $withObject; } /** * Clear the registry of replacement objects * */ public static function clearRegistry() { if(isset(self::$_registry)) { self::$_registry = null; } } } Unit Tests: FactoryTest.php ?php /** * @packageZend_Factory * @subpackage UnitTests */ require_once dirname(dirname(__FILE__)) . '/TestHelper.php'; /** Zend_Factory */ require_once 'Zend/Factory.php'; /** PHPUnit_Framework_TestCase */ require_once 'PHPUnit/Framework/TestCase.php'; // pre included class used in tests require_once 'Zend/Mail.php'; /** * @packageZend_Factory * @subpackage UnitTests */ class FactoryTest extends PHPUnit_Framework_TestCase { public function testFactoryInstantiatesZendObjectAfterIncluded() { $mail = Zend_Factory::create('Zend_Mail'); $this-assertTrue($mail instanceof Zend_Mail); } public function testFactoryInstantiatesZendObjectBeforeIncluded() { $gdata = Zend_Factory::create('Zend_Gdata_Photos_AlbumEntry'); $this-assertTrue($gdata instanceof Zend_Gdata_Photos_AlbumEntry); } public function testFactoryThrowsExceptionIfClassDoesNotExist() { try { $mail =
[fw-general] php|architect's Guide to Programming with ZF - Should I?
Hi guys, It seems to be out now. http://www.phparch.com/c/books/id/9780973862157 Just wondering if you all have looked at it, and if it is worth the purchase. -Ryan
Re: [fw-general] php|architect's Guide to Programming with ZF - Should I?
On Jan 21, 2008 5:26 PM, [EMAIL PROTECTED] wrote: Hi guys, It seems to be out now. http://www.phparch.com/c/books/id/9780973862157 Just wondering if you all have looked at it, and if it is worth the purchase. I bought the book and already posted a comment on the books website (zfguide.com) If you are new to ZF it is a good point to start with. regards, Chris
Re: [fw-general] php|architect's Guide to Programming with ZF - Should I?
Not exactly new (been using since 0.2)... I saw your comments on ZF guide; is it worthwhile buying for those that aren't new to it? On Mon, 21 Jan 2008 17:47:05 +0100, Christian Schmidt [EMAIL PROTECTED] wrote: On Jan 21, 2008 5:26 PM, [EMAIL PROTECTED] wrote: Hi guys, It seems to be out now. http://www.phparch.com/c/books/id/9780973862157 Just wondering if you all have looked at it, and if it is worth the purchase. I bought the book and already posted a comment on the books website (zfguide.com) If you are new to ZF it is a good point to start with. regards, Chris
[fw-general] A simple plugin manager class to handle all plugins by request or more
Hi @ll, inspired by some postings about plugins on zfforum.de, i decided to write a plugin manager class handles my plugins by request. This means, e.g. my Plugin_Auth class does not load, when there is a request on a site which does not need an authentication. I could write much text now about how to implement the plugin manager in your bootstrap and about the many possibilities and options, but i don't. Feel free to copy the source and edit it if you want. I would be happy, about some feedback and suggestions for improvement. http://sources.online-skripte.de/Mtd_Plugin_Plugger.phps highlighted source code http://php.online-skripte.de/Mtd_Plugin_Plugger/api/ API and Documentation in one ;) -- View this message in context: http://www.nabble.com/A-simple-plugin-manager-class-to-handle-all-plugins-by-request-or-more-tp15001950s16154p15001950.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] Zend Locale - getCountryTranslation()
Hi Can someone help with this function? getCountryTranslation($what, $locale = null); It's missing a small example about this function in the docs. Best regards holo
[fw-general] Ralph Schindler
I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) ,Wil
Re: [fw-general] Ralph Schindler
Ralph, I was expecting this! Good luck, and congratulations! Best, Andries Wil Sinclair schreef: I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) ,Wil
Re: [fw-general] Ralph Schindler
Congrats to Ralph. What area will he be working on specifically. The MVC Core? Kevin Wil Sinclair wrote: I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) ,Wil
Re: [fw-general] Zend Locale - getCountryTranslation()
From the API: Returns the localized country name array getCountryTranslation (string $what, [string $locale = null]) string $what: Name to get detailed information about string $locale: OPTIONAL locale for country translation $locale = new Zend_Locale('de_CH'); print $locale-getLanguageTranslation('nl') prints Niederländisch greets On Jan 21, 2008 6:41 PM, holografix . [EMAIL PROTECTED] wrote: Hi Can someone help with this function? getCountryTranslation($what, $locale = null); It's missing a small example about this function in the docs. Best regards holo
RE: [fw-general] Ralph Schindler
I believe he has some work to finish for 1.5, then he'll be giving me some *much needed* help on CLI tooling. ,Wil -Original Message- From: Kevin McArthur [mailto:[EMAIL PROTECTED] Sent: Monday, January 21, 2008 9:54 AM To: Wil Sinclair Cc: Zend Framework General Subject: Re: [fw-general] Ralph Schindler Congrats to Ralph. What area will he be working on specifically. The MVC Core? Kevin Wil Sinclair wrote: I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) ,Wil
[fw-general] Zend_Acl dynamic loading is ready for review
Hi again all, I also finished the documentation and UCs coding on this other proporsal, feel free to post your comments. http://framework.zend.com/wiki/display/ZFPROP/Zend_Acl+dynamic+loading+-+Aldemar+Bernal Aldemar
[fw-general] Zend_Build is ready for final review. . .
Have at it: http://framework.zend.com/wiki/x/65s ,Wil
Re: [fw-general] Ralph Schindler
Congratulations, Ralph! 2008/1/21, Wil Sinclair [EMAIL PROTECTED]: I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) ,Wil
Re: [fw-general] Zend Locale - getCountryTranslation()
If you wait some days for the release you will get the new additional documentation to this and related functions. Generally as can be seen by the method name you will get a country translation which means give a Country in ISO and get the translated string for this country returned. $loc = new Zend_Locale(); print $loc-getCountryTranslation('DE', 'en_US'); Generally I don't think that an explicit example is needed for a simple string returning function... Greetings Thomas Weidner, I18N Team Leader http://www.thomasweidner.com - Original Message - From: holografix . [EMAIL PROTECTED] To: fw-general@lists.zend.com Sent: Monday, January 21, 2008 6:41 PM Subject: [fw-general] Zend Locale - getCountryTranslation() Hi Can someone help with this function? getCountryTranslation($what, $locale = null); It's missing a small example about this function in the docs. Best regards holo
[fw-general] Zend_Cache :Need a little help for an any hack attack issue
Hi Out there, I am searching for an solution for an issue to prevent Zend_cache to write a lot of unnecessary Files if someone Changes the request in a Loop. Example: for($id=0;$id10;$id++) { someGet(www.website.com?Unknown_nonesense=.$id); } As you may already expected I am using the querystring as ID for caching I am currently thinking about some complicated solutions but maybe somebody found a simple one *g Some site Problems : - No MVC (old Typo3) - GET Params can change every day - list of allowed Params is not possible Thanks guys Christoph Hagenbrock Current Implementation: ?php //AGEBROCK IMPLEMENTIERUNG ZEND CACHE ---CACHE start -// require_once 'Zend/Cache.php'; /** * Cache Mock Objekt um den cache zu deaktvieren * alle dc_Methoden lösen destroyCache aus wenn TRUE * * Mock Cache Object to deaktivate Caching * all dc_methods will dispatch destroyCache id TRUE */ class CacheMock { function start($id) { return false; } function end() { return true; } static function destoryCache() { global $cache; $cache = new CacheMock(); } /** * duchsucht das $_GET nach Vorkommen im $config Array * * kann als wildcard genutzt werden. * * @param Array $config */ static function dc_checkGet($config) { foreach ($config as $key = $value) { if(isset($_GET[$key])) { if($_GET[$key] == $value || $_GET[$key] == '*') { self::destoryCache(); return; } } } } static function dc_notEmpty($array) { if(!empty($array)) { self::destoryCache(); } } } ---CACHE CONFIG -// $frontendOptions = array( 'lifetime' = 30, // caching for x secs 'automatic_serialization' = false ); $backendOptions = array( 'cache_dir' = 'fileadmin/zendcache/' ); $cache = Zend_Cache::factory('Output', 'File', $frontendOptions, $backendOptions); --- NO CACHE OPTIONS -/ //liste von ID's die nicht gecached werden sollen $noGetConfig = array( 'id' = 363 ); CacheMock::dc_checkGet($noGetConfig); CacheMock::dc_notEmpty($_POST); --- NO CACHE HACKS ;) -/ //tradedoubler correction if(isset($_GET['tduid'])) { $_SERVER['QUERY_STRING'] = 'agent=td'; } $id = md5($_SERVER['QUERY_STRING']); --- ENDE CACHE CONTROL -/ /* Start Sitebuilding [CODE START] if (!($cache-start($id))) { ///SITE CREATION $cache-end(); } [CODE ENDE] */ ?
Re: [fw-general] Ralph Schindler
Congrats, Ralph! -Matt On Mon, January 21, 2008 9:42 am, Wil Sinclair wrote: I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) ,Wil
Re: [fw-general] Ralph Schindler
-- Wil Sinclair [EMAIL PROTECTED] wrote (on Monday, 21 January 2008, 09:42 AM -0800): I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) Welcome aboard, Ralph -- it's about stinkin' time! And I have a ton of stuff for you to work on ... ;-) -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
[fw-general] PluginLoader::load() invoking autoload?
Hello all, While profiling my application I discovered that the pluginloader invokes autoload when it calls class_exists() in the load method. Was this intentional? It could lead to some unexpected behaviour, by loading an ambiguously named class from the wrong location, and it means that Zend_Loader::isReadable() is being called twice as often as is necessary. I've created an issue in the tracker and even posted a patch (as frivolous as that may be) in hopes that this might be fixed before the code freeze tomorrow. http://framework.zend.com/issues/browse/ZF-2458 Thanks for your time, Nathan Wright
Re: [fw-general] Ralph Schindler
No rest for the wicked, Ralph ;) Congratulations and best of luck! Paddy Pádraic Brady http://blog.astrumfutura.com http://www.patternsforphp.com OpenID Europe Foundation - Original Message From: Matthew Weier O'Phinney [EMAIL PROTECTED] To: fw-general@lists.zend.com Sent: Monday, January 21, 2008 8:33:47 PM Subject: Re: [fw-general] Ralph Schindler -- Wil Sinclair [EMAIL PROTECTED] wrote (on Monday, 21 January 2008, 09:42 AM -0800): I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) Welcome aboard, Ralph -- it's about stinkin' time! And I have a ton of stuff for you to work on ... ;-) -- Matthew Weier O'Phinney PHP Developer| [EMAIL PROTECTED] Zend - The PHP Company | http://www.zend.com/
Re: [fw-general] google indexing site
I doubt this is related to ZF. Maybe you need to use robots.txt http://www.robotstxt.org/ http://en.wikipedia.org/wiki/Robots.txt Good luck! - Amr On Jan 21, 2008 1:51 PM, digitalus_media [EMAIL PROTECTED] wrote: i have developed a zf based cms. for some reason google can not recognize any of the links on the site. i tried a robot emulator, and it shows no pages. i installed the lynx text browser, and all of the links / navigation are visible. is this something new with google or is there something else i need to do (htaccess?). -- View this message in context: http://www.nabble.com/google-indexing-site-tp14995990s16154p14995990.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: AW: [fw-general] Zend_Factory/Zend_Loader addition suggestion
Hi Leo! In catching up (been off the ZF scene for a while deep in client work) I was referred to the Zend_Di (Dependency Injection) proposal on the Wiki which IMO is quite possibly my most looked-forward-to component (besides Zend_Rtf) right now. I've requested the author append the Zend_Factory methods as a simple light alternative for those who don't intend using the full Zend_Di capabilities but still require the minimum amount of injection needed to substitute Mock Objects or Stubs without requiring configuration files. Seems the most suitable location other than Zend_Loader assuming Zend_Di is eventually accepted into the Incubator or that new Extras Incubator... If anyone from Zend is reading, review already ;). It's a solid piece of work that is invaluable in applying TDD/BDD/unit testing in general to the ZF MVC architecture - and that's only the most obvious benefit from my selfish perspective! Best regards, Paddy Pádraic Brady http://blog.astrumfutura.com http://www.patternsforphp.com OpenID Europe Foundation - Original Message From: Leo Büttiker [EMAIL PROTECTED] To: Pádraic Brady [EMAIL PROTECTED]; Zend Framework General fw-general@lists.zend.com Sent: Monday, January 21, 2008 4:21:06 PM Subject: AW: [fw-general] Zend_Factory/Zend_Loader addition suggestion Sounds cool! This would make testing in ZF much easier. In my opinion the Zend_Factory should somehow be integrated into Zend_Loader, to integrate easy in auto loaded environments. Probably Zend_Factory can even be a solution to replace components in the system without subclassing and copying a lot of code. But for this it should be possible to replace classes not only by object but also by other names. Cheers, leo Von: Pádraic Brady [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 17. Januar 2008 22:21 An: Zend Framework General Betreff: [fw-general] Zend_Factory/Zend_Loader addition suggestion Hi guys, I'm currently working on a project to implement Zend Framework controller and model testing and specification. I'm looking for opinions on whether this is feasible - the main problem I have is that directly instantiating objects within controllers makes it impossible for any testing suite from isolating the controller action from it's carrying objects. Without requiring some perverse parameter acrobatics or requiring configuration heavy injectors like Pico or Phemto a simple solution (I think) is to enable a simplified object loader of a few dozen lines to be added for use. This could be added either as a separate class Zend_Factory, or appended to Zend_Loader (which seems appropriate). I've copied the current sample code and unit tests below. In use, it would require a simple call of: Zend_Factory::create('Zend_Mail'); Then a unit test or BDD spec could mock this object result (before the create() call of course) using: Zend_Factory::replaceClass('Zend_Mail', new ZMail_Mock); Here's the suggested source code and unit tests. Any comments or criticisms most welcome - not sure if it's worth an actual proposal given it's size but it's of immense value to my ongoing work. If you prefer online viewing it's at: http://svn.astrumfutura.org/zendframework/trunk/library/Proposed/Zend/Factory.php Zend/Factory.php: ?php require_once 'Zend/Loader.php'; require_once 'Zend/Registry.php'; /** * Abstract object instantiation with minimal setup and allow for replacement * of created object return values by preceding unit tests or BDD specifications * */ class Zend_Factory { /** * Registry instance for holding replacement objects * * @var Zend_Registry */ protected static $_registry = null; /** * Create a new object based on the referenced class name and construction * parameters. If a registered replacement object exists, this will be * returned instead. * * @param object $className * @param array $constructionParams * @return object */ public static function create($className, array $constructionParams = null) { if (!class_exists($className, true)) { Zend_Loader::loadClass($className); } if (isset(self::$_registry-$className)) { return self::$_registry-$className; } if ($constructionParams !== null) { $refClass = new ReflectionClass($className); $createdObject = $refClass-newInstanceArgs($constructionParams); } else { $createdObject = new $className; } return $createdObject; } /** * Replace the return value of any call for an instance of the referenced * class name with an alternative object. * * @param string $className * @param object $withObject */ public static function replaceClass($className, $withObject) { if (self::$_registry == null) { self::$_registry = new
Re: [fw-general] google indexing site
i was able to get it to load the robots.txt file. it looked from the error like it was not able to get the default locale from google's request. Amr Mostafa wrote: I doubt this is related to ZF. Maybe you need to use robots.txt http://www.robotstxt.org/ http://en.wikipedia.org/wiki/Robots.txt Good luck! - Amr On Jan 21, 2008 1:51 PM, digitalus_media [EMAIL PROTECTED] wrote: i have developed a zf based cms. for some reason google can not recognize any of the links on the site. i tried a robot emulator, and it shows no pages. i installed the lynx text browser, and all of the links / navigation are visible. is this something new with google or is there something else i need to do (htaccess?). -- View this message in context: http://www.nabble.com/google-indexing-site-tp14995990s16154p14995990.html Sent from the Zend Framework mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/google-indexing-site-tp14995990s16154p15007500.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] google indexing site
Hello, Try adding your site to Google Webmaster Tools. After you verify your site you gonna get error messages, aso. Indeed, ZF is not very good (as other frameworks) on some things as making URL's very SEO friendly but i don't think that's your problem. I can take a look on your site compatibility with SE if you want. Email me if so. -- Best regards, Cristian Bichis www.zftutorials.com | www.zfforums.com | www.zflinks.com | www.zftalk.com i was able to get it to load the robots.txt file. it looked from the error like it was not able to get the default locale from google's request. Amr Mostafa wrote: I doubt this is related to ZF. Maybe you need to use robots.txt http://www.robotstxt.org/ http://en.wikipedia.org/wiki/Robots.txt Good luck! - Amr On Jan 21, 2008 1:51 PM, digitalus_media [EMAIL PROTECTED] wrote: i have developed a zf based cms. for some reason google can not recognize any of the links on the site. i tried a robot emulator, and it shows no pages. i installed the lynx text browser, and all of the links / navigation are visible. is this something new with google or is there something else i need to do (htaccess?). -- View this message in context: http://www.nabble.com/google-indexing-site-tp14995990s16154p14995990.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Ralph Schindler
Wil Sinclair wrote: I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) ,Wil Hearty congratulations and a warm welcome to you, Ralph! It's been a pleasure working with you since you started contributing to ZF as an invaluably active community member, and I continue to look forward to working with you as a fellow Zender! :) Best regards, Darby
Re: [fw-general] Ralph Schindler
Congratulations, Ralph! Ádám On Jan 21, 2008 6:42 PM, Wil Sinclair [EMAIL PROTECTED] wrote: I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) ,Wil
Re: [fw-general] Ralph Schindler
Hey everyone, Its awesome to be on-board! I am pretty excited that I will be able to contribute to this project on a full time basis as I've always had more ideas than time. I took a pretty nice vacation last week in the Caribbean (which is why alot of you might have seen me go completely MIA) and am totally ready to get cooking ;) Thanks all! Wil Sinclair wrote: I couldn't be happier to announce that as of this morning, Ralph Schindler has joined the Zend team to work on ZF full time! Congrats, Ralph! Now get back to work. :) ,Wil
Re: [fw-general] google indexing site
Cristian Bichis pisze: Hello, Try adding your site to Google Webmaster Tools. After you verify your site you gonna get error messages, aso. Indeed, ZF is not very good (as other frameworks) on some things as making URL's very SEO friendly but i don't think that's your problem. I can take a look on your site compatibility with SE if you want. Email me if so. -- Best regards, Cristian Bichis www.zftutorials.com | www.zfforums.com | www.zflinks.com | www.zftalk.com i was able to get it to load the robots.txt file. it looked from the error like it was not able to get the default locale from google's request. Amr Mostafa wrote: I doubt this is related to ZF. Maybe you need to use robots.txt http://www.robotstxt.org/ http://en.wikipedia.org/wiki/Robots.txt Good luck! - Amr On Jan 21, 2008 1:51 PM, digitalus_media [EMAIL PROTECTED] wrote: i have developed a zf based cms. for some reason google can not recognize any of the links on the site. i tried a robot emulator, and it shows no pages. i installed the lynx text browser, and all of the links / navigation are visible. is this something new with google or is there something else i need to do (htaccess?). -- View this message in context: http://www.nabble.com/google-indexing-site-tp14995990s16154p14995990.html Sent from the Zend Framework mailing list archive at Nabble.com. Look here : http://www.nabble.com/Zend_Locale_Exception-when-wget-ing-to14948086s16154.html
[fw-general] it's a problem to using Zend_Debug::Dump when I'm using xdebug
xdebug would process var_dump(),and Zend_Debug process it twice.
[fw-general] Zend_Form | Zend_Validate_StringLength::setMessage() Bug?
I apologize if this is the wrong place to post this, but I cant find where the applicable place would be. In my experimentation with Zend_Form, I have found a possible bug or simple lack of knowledge(myself) with Zend_Form::addValidator() or Zend_Validate_StringLength Example Code: - //Create Validator $validator = new Zend_Validate_StringLength(1,5); $validators-setMessage(Custom Error); //Create Form Element $formElement = new Zend_Form_Element_Textarea('description'); $formElement-setLabel('Name') -addValidator($validator); When processing this Zend_Form_Element with data that is less than one character long (0), the custom error message Custom Error is shown, but if the data is greater than 5 characters the default Zend_Validate_StringLength message is shown. I was under the assumption that the Zend_Validate_StringLength::setMessage($customMessage, null) set all the error messages of the validator to the $customMessage. It appears I am wrong(1*) or there is a bug(2). I understand that I can pass in an array with the message constants Zend_Validate_StringLength::TOO_LONG etc..., but it gets redundant, so is there a way to set all messages of a validator in a single instance? Can anyone set me straight on this? Thanks, Brandon -- View this message in context: http://www.nabble.com/Zend_Form-%7C-Zend_Validate_StringLength%3A%3AsetMessage%28%29-Bug--tp15013739s16154p15013739.html Sent from the Zend Framework mailing list archive at Nabble.com.