Re: [fw-general] Deployment tool?
On Jun 8, 2007, at 2:03 AM, oetting wrote: Year i know, it is rather cool. ZF is missing a database schema abstraction layer for this to be possible in the same way. There is a proposal for this. An alternative implementation could be done by automating the execution of raw SQL commands. The developer would specify files like this: # UP ALTER TABLE foo ADD COLUMN bar int(11); # DOWN ALTER TABLE foo DROP COLUMN bar; A script would then automate execution series of these migration files. This would not require any schema abstraction. I have made a proof of concept implementation of this, and would like to contribute in this area as well, if anyone finds it interesting. I want to complete this component, and asked Rob if he minded, of course he said he didn't, so I'll be looking at and hopefully submitting something to get this closer to being a reality :-D
Re: [fw-general] Deployment tool?
> I dont know if a deployment binary is needed as SVN hooks already do this > very well. You can have a SVN post-commit hook as simple as all commits > show > up on a beta.example.com url to complex scenarios like checking branches > etc. This is really a server admin/svnadmin preference. I have not looked at svn hooks. I will now, thanks. This implementation would not be a binary. I would be more like a flexible shell script written in php that would facilitate easier usage for standard setups. > $0.02 Thanks! -- View this message in context: http://www.nabble.com/Deployment-tool--tf3886709s16154.html#a11021035 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Deployment tool?
> This is something which RubyOnRails nicely manages with "migrations". > Each change to the database is versioned in a separate file which is > basically some ruby code to be executed. It knows about hooks like "up" > and "down" and within this hooks it e.g. creates the new columns with > default values or removes the column. Year i know, it is rather cool. ZF is missing a database schema abstraction layer for this to be possible in the same way. There is a proposal for this. An alternative implementation could be done by automating the execution of raw SQL commands. The developer would specify files like this: # UP ALTER TABLE foo ADD COLUMN bar int(11); # DOWN ALTER TABLE foo DROP COLUMN bar; A script would then automate execution series of these migration files. This would not require any schema abstraction. I have made a proof of concept implementation of this, and would like to contribute in this area as well, if anyone finds it interesting. > The "idea" for a flexible deployment tool is "good", but actually I > think it has nothing to do with the Zend Framework in any way. Whenever > you would create such a tool you wouldn't want it specific for ZF, do you? Perhaps it could utillize ZF components but it should not be specific to any apecific project layout. Jacob -- View this message in context: http://www.nabble.com/Deployment-tool--tf3886709s16154.html#a11020982 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Deployment tool?
> I am really curious as to why no one has mentioned Capistrano... I did. I know this would be kind of a clone. And that is one of the questions: Is it important to have a system that is purely php-based? I can't really make up my mind, and am looking for other peoples opinion. Jacob -- View this message in context: http://www.nabble.com/Deployment-tool--tf3886709s16154.html#a11020884 Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] TextNum not taking all numbers into account
Hi, In library/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum.php, there seem to be a bug where some numbers were not taken into account. In the nextToken method, the regex is /[a-zA-Z1-7]+/. Should it be /[a-zA-Z0-9]+/ instead? -- View this message in context: http://www.nabble.com/TextNum-not-taking-all-numbers-into-account-tf3887747s16154.html#a11020427 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Deployment tool?
I am really curious as to why no one has mentioned Capistrano... http://manuals.rubyonrails.com/read/book/17 http://devthatweb.com/view/automate-the-deployment-of-any-php-project- using-capistrano Regards, Eric On Jun 7, 2007, at 8:24 PM, Markus Fischer wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, oetting wrote: Other features: Deployment of database schema. This is something which RubyOnRails nicely manages with "migrations". Each change to the database is versioned in a separate file which is basically some ruby code to be executed. It knows about hooks like "up" and "down" and within this hooks it e.g. creates the new columns with default values or removes the column. What do you think. Is this a good idea? The "idea" for a flexible deployment tool is "good", but actually I think it has nothing to do with the Zend Framework in any way. Whenever you would create such a tool you wouldn't want it specific for ZF, do you? I'm currently also evaluation possibilities, yet nothing useful found. Deploying changesets which includes dir/file and database changes on multiple servers including dedicated testing and live servers can be quite complex. - - Markus -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGaKHU1nS0RcInK9ARAguYAJ95ynZayPU48FuheNnABA1+imMtugCfQwqi oXDH6WbB4nm67WZ2hF/JL+M= =IR1y -END PGP SIGNATURE-
Re: [fw-general] Deployment tool?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, oetting wrote: > Other features: > Deployment of database schema. This is something which RubyOnRails nicely manages with "migrations". Each change to the database is versioned in a separate file which is basically some ruby code to be executed. It knows about hooks like "up" and "down" and within this hooks it e.g. creates the new columns with default values or removes the column. > What do you think. Is this a good idea? The "idea" for a flexible deployment tool is "good", but actually I think it has nothing to do with the Zend Framework in any way. Whenever you would create such a tool you wouldn't want it specific for ZF, do you? I'm currently also evaluation possibilities, yet nothing useful found. Deploying changesets which includes dir/file and database changes on multiple servers including dedicated testing and live servers can be quite complex. - - Markus -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGaKHU1nS0RcInK9ARAguYAJ95ynZayPU48FuheNnABA1+imMtugCfQwqi oXDH6WbB4nm67WZ2hF/JL+M= =IR1y -END PGP SIGNATURE-
Re: [fw-general] Major headache trying to tweak or extend Zend_Cache
Find attached a patch file for this. Thanks, Tony On 6/7/2007 1:07 PM, Tony Ford wrote: Zend_Cache seemed very elegant to me at first, until I tried to make a customization. I have some apps that will be using memcached for objects. Thing is, some of my server farms will have multiple sites and networks, all using the same pool of memcached servers. Of course all the networks will cache similar named objects, like 'acl' for instance. So, to avoid namespace trampling, or rather to "create" namespaces, I thought it'd be very useful to have cache id prefixes. Now, instead of setting keys in memecached just called 'obj_name' they'd be 'uniquenetwork_obj_name'. This allows me to have an acl object for Network1 (network1_acl) and an acl object for network2 (network2_acl). I could just go ahead and setup a constant and pass it in along with the ids into every load(), save(), remove(), etc calls, but that seems like a lot of unnecessary crap. Instead, it makes a lot more sense to me to create a new backend option for my "cache id prefix", then have each one of those methods concat the prefix on to the front of ids automatically just before the real memcache calls are made. So, I went about this, and its a real mess. First of all, all options are hardcoded into the classes and get explicitly checked at object instantiation. OK, well, I extended Zend_Cache_Backend_Memcached and did this: public function __construct($options = array()) { // add cache id prefix as an allowed option, default nothing $this->_options['cache_id_prefix'] = null; // Call parent constructor parent::__construct($options); } Then each one of those methods now look basically like this: public function load($id, $doNotTestCacheValidity = false) { $id = $this->_options['cache_id_prefix'] . $id; parent::load($id, $doNotTestCacheValidity); } Overall, I didn't think that was too big of a deal, but then I realized that the backends are hardcoded and checked in Zend_Cache, just like the options, so I'd have to do the same thing for that. What's worse though, is only the name of the backend is passed in, and then class names are created and called with a hardcoded 'Zend_Cache_Backend' . $backend. Now I can't even call my class something different. Now I'd have to create my class file specifically in the /Zend/Cache/Backend directory, and call it something like CustomMemcached. Anyway, overall Zend_Cache is a very nice component with lots of options, and I appreciate all of them, its just that its very closed. Maybe that was the intention, and if so, maybe you would accept a patch file from me to officially add this feature to the memcache backend. Thanks in advance for reading, Tony Index: Memcached.php === --- Memcached.php (revision 264) +++ Memcached.php (working copy) @@ -64,6 +64,9 @@ * => (boolean) compression : * true if you want to use on-the-fly compression * + * => (string) cache_id_prefix : + * prefix for cache ids + * * @var array available options */ protected $_options = array( @@ -72,7 +75,8 @@ 'port' => Zend_Cache_Backend_Memcached::DEFAULT_PORT, 'persistent' => Zend_Cache_Backend_Memcached::DEFAULT_PERSISTENT )), -'compression' => false +'compression' => false, +'cache_id_prefix' => null ); /** @@ -98,6 +102,11 @@ Zend_Cache::throwException('The memcache extension must be loaded for using this backend !'); } parent::__construct($options); +if (isset($this->_options['cache_id_prefix'])) { // particular case for this option +if (!preg_match('~^[\w]+$~', $this->_options['cache_id_prefix'])) { +Zend_Cache::throwException('Invalid cache_id_prefix : must use only [a-zA-A0-9_]'); +} +} if (isset($this->_options['servers'])) { $value= $this->_options['servers']; if (isset($value['host'])) { @@ -131,7 +140,7 @@ if ($doNotTestCacheValidity) { $this->_log("Zend_Cache_Backend_Memcached::load() : \$doNotTestCacheValidity=true is unsupported by the Memcached backend"); } -$tmp = $this->_memcache->get($id); +$tmp = $this->_memcache->get($this->_id($id)); if (is_array($tmp)) { return $tmp[0]; } @@ -146,7 +155,7 @@ */ public function test($id) { -$tmp = $this->_memcache->get($id); +$tmp = $this->_memcache->get($this->_id($id)); if (is_array($tmp)) { return $tmp[1]; } @@ -173,7 +182,7 @@ } else { $flag = 0; } -$result = $this->_memcache->set($id, array($data, time()), $flag, $lifetime); +$result = $this->_memcache->set($this->_id($id)
Re: [fw-general] Deployment tool?
I dont know if a deployment binary is needed as SVN hooks already do this very well. You can have a SVN post-commit hook as simple as all commits show up on a beta.example.com url to complex scenarios like checking branches etc. This is really a server admin/svnadmin preference. I'm not sure we could offer much additional power to current shell scripting capabilities. $0.02 Kevin - Original Message - From: "oetting" <[EMAIL PROTECTED]> To: Sent: Thursday, June 07, 2007 4:10 PM Subject: [fw-general] Deployment tool? Hi all, I have been thinking about creating a system for deploying php applications. When i say deploy i mean updating php files on a server, not deployment as in distribution. The goal would be to accomplish something like what is possible with Capistrano. First question: Is deployment the correct word for this? The script i am using now assumes that I use SVN. It works something like this: Developer commits changes. Developer starts the script indicating which revision that should be activated on the server, defaults to HEAD. The script works on an extra local working copy: svn update to the specified revision. rsync working copy to the server into a folder that is specific to the revision. relink document root(that is a symlink) to the revision folder. A good implementation should be flexible and not make as many assumptions about the developers setup, e.g. allow usage of alternative transport methods. It should be implemented in a way that allow developers to combine tools to create a good solution for them. Other features: Deployment of database schema. Switching to an "offline" document root while updating database. I do not want to write all my ideas in this mail, just get your opinion: What do you think. Is this a good idea? Is it to difficult to create a general solution that is usefull for many? Are there other tools already doing this? (Should i just use Capistrano?) Jacob -- View this message in context: http://www.nabble.com/Deployment-tool--tf3886709s16154.html#a11017268 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Timezone List
Hi On 6/8/07, Thomas Weidner <[EMAIL PROTECTED]> wrote: (...) We are only as good as the response to us. ;-) >Another simple thing I want to create is a list of the language/territory >abbreviations and their full names. What do you mean with language and territory abbreviations ??? german is always german and can not be abbreviated to ger or something else... And Austria is always austria... Maybe he was talking about country codes (e.g. de, at, ...) Cheers, Till
[fw-general] Deployment tool?
Hi all, I have been thinking about creating a system for deploying php applications. When i say deploy i mean updating php files on a server, not deployment as in distribution. The goal would be to accomplish something like what is possible with Capistrano. First question: Is deployment the correct word for this? The script i am using now assumes that I use SVN. It works something like this: Developer commits changes. Developer starts the script indicating which revision that should be activated on the server, defaults to HEAD. The script works on an extra local working copy: svn update to the specified revision. rsync working copy to the server into a folder that is specific to the revision. relink document root(that is a symlink) to the revision folder. A good implementation should be flexible and not make as many assumptions about the developers setup, e.g. allow usage of alternative transport methods. It should be implemented in a way that allow developers to combine tools to create a good solution for them. Other features: Deployment of database schema. Switching to an "offline" document root while updating database. I do not want to write all my ideas in this mail, just get your opinion: What do you think. Is this a good idea? Is it to difficult to create a general solution that is usefull for many? Are there other tools already doing this? (Should i just use Capistrano?) Jacob -- View this message in context: http://www.nabble.com/Deployment-tool--tf3886709s16154.html#a11017268 Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] Timezone List
I am with Ian. There are a lot of things I envision doing with Zend_Locale but most of the examples are not useful. I know the Timezone list is incomplete but I get a useless list. The list: St. John’s Paris Dublin Jerusalem Tokyo Bucharest Singapore does not look anything like a timezone selection. See http://unicode.org/cldr/data/diff/supplemental/windows_tzid.html Well, when I am requesting the timezones for a locale I get an array where the key is the timezone and the value is the translated name for this timezone. I dont know from where you have your list but this is not from Zend_Locale. "; require_once 'Zend/Locale.php'; $locale = new Zend_Locale('de_AT'); $list = $locale->getTranslationList("timezone"); print_r ($list); Any my result is : Array ( [Antarctica/South_Pole] => Südpol [Antarctica/Vostok] => Wostok [America/St_Johns] => St. John's [Pacific/Easter] => Osterinsel [Europe/Berlin] => Berlin [Atlantic/Canary] => Kanaren [Asia/Ulaanbaatar] => Ulan-Bator [America/Mexico_City] => Mexiko-Stadt [Atlantic/Azores] => Azoren [Europe/Lisbon] => Lissabon [Europe/Moscow] => Moskau [Asia/Yekaterinburg] => Jekaterinburg [Asia/Novosibirsk] => Nowosibirsk [Asia/Krasnoyarsk] => Krasnojarsk [Asia/Yakutsk] => Jakutsk [Asia/Vladivostok] => Wladiwostok [Asia/Sakhalin] => Sachalin [Asia/Kamchatka] => Kamtschatka [Europe/Uzhgorod] => Uschgorod [Europe/Kiev] => Kiew [Europe/Zaporozhye] => Saporischja [Asia/Tashkent] => Taschkent ) This are the known timezones for the given locale (de_AT in my example) And the key is identical to the timezones which are known by php. I have been bouncing back to this Timezone issue for the last month thinking it was me. In the documentation some of the examples don't work and I am using Zend Framework RC1. The examples at http://framework.zend.com/manual/en/zend.locale.functions.html I am referring to are as follows: - Under Example 18.15., Similarly, getCountryTranslationList() and getRegionDisplay() could be used to create a table mapping your native language names for regions to the names of the regions shown in another language - Example 18.16. All Languages written in their native language getRegionDisplay() and getLanguageDisplay() don't even exist ... see http://framework.zend.com/apidoc/core/Zend_Locale/Zend_Locale.html#sec-method-summary I never said that I am perfect, did I ? Even me is not reading the docu every day. And I am not paid for doing this work for the Zend Framework, so please do not being angry when my work takes some time and is in need of feedback if something is wrong. We are only as good as the response to us. Another simple thing I want to create is a list of the language/territory abbreviations and their full names. What do you mean with language and territory abbreviations ??? german is always german and can not be abbreviated to ger or something else... And Austria is always austria... There are no abbreviations for languages and territorries. A list of full names is no problem... Just take a look at getTranslationList(); Greetings Thomas I18N Team Leader
[fw-general] reroute post requests
Hello! I’m very new to the zend framework and I’ve tried to write a Controller_Plugin to reroute post requests. Whenever a user submits a form I’d like to check, if there’s a method called $action.’Validate’ - if yes, call it, check the result and reroute the request to a method called $action.’Submit’ Here’s my code but I think there should be a much better solution for this task. class Buys_Controller_Plugin_ReroutePostRequest extends Zend_Controller_Plugin_Abstract { public function preDispatch($request) { if(!$request->isPost()) { return; } $response = Zend_Controller_Front::getInstance()->getResponse(); $dispatcher = Zend_Controller_Front::getInstance()->getDispatcher(); $controller = $dispatcher->loadClass( $dispatcher->getControllerClass($request) ); $action = $request->action; $actionValidate = $action.'Validate'; if(method_exists($controller, $actionValidate)) { $method = $action.'Submit'; $obj = new $controller($request, $response); $result = $obj->{$actionValidate}(); if($result && method_exists($controller, $method)) { $request->setActionName($action.'-Submit'); } } } } Thanks in advance, Jens -- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
[fw-general] Major headache trying to tweak or extend Zend_Cache
Zend_Cache seemed very elegant to me at first, until I tried to make a customization. I have some apps that will be using memcached for objects. Thing is, some of my server farms will have multiple sites and networks, all using the same pool of memcached servers. Of course all the networks will cache similar named objects, like 'acl' for instance. So, to avoid namespace trampling, or rather to "create" namespaces, I thought it'd be very useful to have cache id prefixes. Now, instead of setting keys in memecached just called 'obj_name' they'd be 'uniquenetwork_obj_name'. This allows me to have an acl object for Network1 (network1_acl) and an acl object for network2 (network2_acl). I could just go ahead and setup a constant and pass it in along with the ids into every load(), save(), remove(), etc calls, but that seems like a lot of unnecessary crap. Instead, it makes a lot more sense to me to create a new backend option for my "cache id prefix", then have each one of those methods concat the prefix on to the front of ids automatically just before the real memcache calls are made. So, I went about this, and its a real mess. First of all, all options are hardcoded into the classes and get explicitly checked at object instantiation. OK, well, I extended Zend_Cache_Backend_Memcached and did this: public function __construct($options = array()) { // add cache id prefix as an allowed option, default nothing $this->_options['cache_id_prefix'] = null; // Call parent constructor parent::__construct($options); } Then each one of those methods now look basically like this: public function load($id, $doNotTestCacheValidity = false) { $id = $this->_options['cache_id_prefix'] . $id; parent::load($id, $doNotTestCacheValidity); } Overall, I didn't think that was too big of a deal, but then I realized that the backends are hardcoded and checked in Zend_Cache, just like the options, so I'd have to do the same thing for that. What's worse though, is only the name of the backend is passed in, and then class names are created and called with a hardcoded 'Zend_Cache_Backend' . $backend. Now I can't even call my class something different. Now I'd have to create my class file specifically in the /Zend/Cache/Backend directory, and call it something like CustomMemcached. Anyway, overall Zend_Cache is a very nice component with lots of options, and I appreciate all of them, its just that its very closed. Maybe that was the intention, and if so, maybe you would accept a patch file from me to officially add this feature to the memcache backend. Thanks in advance for reading, Tony
[fw-general] Major headache trying to tweak or extend Zend_Cache
Zend_Cache seemed very elegant to me at first, until I tried to make a customization. I have some apps that will be using memcached for objects. Thing is, some of my server farms will have multiple sites and networks, all using the same pool of memcached servers. Of course all the networks will cache similar named objects, like 'acl' for instance. So, to avoid namespace trampling, or rather to "create" namespaces, I thought it'd be very useful to have cache id prefixes. Now, instead of setting keys in memecached just called 'obj_name' they'd be 'uniquenetwork_obj_name'. This allows me to have an acl object for Network1 (network1_acl) and an acl object for network2 (network2_acl). I could just go ahead and setup a constant and pass it in along with the ids into every load(), save(), remove(), etc calls, but that seems like a lot of unnecessary crap. Instead, it makes a lot more sense to me to create a new backend option for my "cache id prefix", then have each one of those methods concat the prefix on to the front of ids automatically just before the real memcache calls are made. So, I went about this, and its a real mess. First of all, all options are hardcoded into the classes and get explicitly checked at object instantiation. OK, well, I extended Zend_Cache_Backend_Memcached and did this: public function __construct($options = array()) { // add cache id prefix as an allowed option, default nothing $this->_options['cache_id_prefix'] = null; // Call parent constructor parent::__construct($options); } Then each one of those methods now look basically like this: public function load($id, $doNotTestCacheValidity = false) { $id = $this->_options['cache_id_prefix'] . $id; parent::load($id, $doNotTestCacheValidity); } Overall, I didn't think that was too big of a deal, but then I realized that the backends are hardcoded and checked in Zend_Cache, just like the options, so I'd have to do the same thing for that. What's worse though, is only the name of the backend is passed in, and then class names are created and called with a hardcoded 'Zend_Cache_Backend' . $backend. Now I can't even call my class something different. Now I'd have to create my class file specifically in the /Zend/Cache/Backend directory, and call it something like CustomMemcached. Anyway, overall Zend_Cache is a very nice component with lots of options, and I appreciate all of them, its just that its very closed. Maybe that was the intention, and if so, maybe you would accept a patch file from me to officially add this feature to the memcache backend. Thanks in advance for reading, Tony
[fw-general] How more correctly to organize a conclusion of several modules in uniform design (a conclusion - html) in system?
How more correctly to organize a conclusion of several modules in uniform design (a conclusion - html) in system? 1) Transfer of parameters in Zend_Controller_Response_Http 2) Assembly to make in Controller in everyone separate action 3) In each kind - concrete action to connect certain(determined) honour through require Example: Require ('header.phtml') The text received with action Require ('footer.phtml') -- View this message in context: http://www.nabble.com/How-more-correctly-to-organize-a-conclusion-of-several-modules-in-uniform-design-%28a-conclusion---html%29-in-system--tf3883666s16154.html#a11007264 Sent from the Zend Framework mailing list archive at Nabble.com.