Re: [Wikitech-l] Commons ZIP file upload for admins
On Tue, Nov 30, 2010 at 8:48 AM, Dmitriy Sintsov ques...@rambler.ru wrote: * Bryan Tong Minh bryan.tongm...@gmail.com [Tue, 30 Nov 2010 08:44:43 +0100]: I think that the most recent version should be sufficient. I don't think Java would break backwards compatibility: users wouldn't be happy if their old jar suddenly stops working on a new JVM. Why an outdated and inefficient ZIP format, after all? 7zip is incompatible to JVM, should it be a better choice for archive uploads? Or, that is too hard to parse on PHP side (I gueses console exec is required)? You can create a zip easily on all major OSes with drag'n'drop. Windows supports it IIRC from Win 98 SE and up, a standard Linux by the tools the desktop installs (for KDE, it once was Ark), and MacOS also delivers ZIP out of the box. For ZIP, there are even built-in PHP functions to handle it. 7zip is, though open source, requiring third-party plugins, both for the OS and servers, and 7zip is not really widespread. RAR and ZIP are the dominant formats in cross-platform data exchange. Marco -- VMSoft GbR Nabburger Str. 15 81737 München Geschäftsführer: Marco Schuster, Volker Hemmert http://vmsoft-gbr.de ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Commons ZIP file upload for admins
* Marco Schuster ma...@harddisk.is-a-geek.org [Tue, 30 Nov 2010 11:05:09 +0100]: You can create a zip easily on all major OSes with drag'n'drop. Windows supports it IIRC from Win 98 SE and up, a standard Linux by the tools the desktop installs (for KDE, it once was Ark), and MacOS also delivers ZIP out of the box. For ZIP, there are even built-in PHP functions to handle it. 7zip is, though open source, requiring third-party plugins, both for the OS and servers, and 7zip is not really widespread. RAR and ZIP are the dominant formats in cross-platform data exchange. There is console version, which might be executed at server side to get contents of archive or to analyze it http://sourceforge.net/projects/p7zip/ MediaWiki already relies on running external executables such as convert (ImageMagik) and texvc. I should admit that using ImageMagik for image resamping is faster, takes less RAM and gives better results than PHP built-in image handling modules (although ImageMagik should also be available as PHP module, however not everywhere and increases footprint a little bit). Dmitriy ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Commons ZIP file upload for admins
* Marco Schuster ma...@harddisk.is-a-geek.org [Tue, 30 Nov 2010 11:05:09 +0100]: You can create a zip easily on all major OSes with drag'n'drop. Windows supports it IIRC from Win 98 SE and up, a standard Linux by the tools the desktop installs (for KDE, it once was Ark), and MacOS also delivers ZIP out of the box. For ZIP, there are even built-in PHP functions to handle it. 7zip is, though open source, requiring third-party plugins, both for the OS and servers, and 7zip is not really widespread. RAR and ZIP are the dominant formats in cross-platform data exchange. Also, I remember seeing 7z streams recently implemented in 1.17, somewhere, already (with external piping, probably).. ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Commons ZIP file upload for admins
2010/11/30 Dmitriy Sintsov ques...@rambler.ru: * Bryan Tong Minh bryan.tongm...@gmail.com [Tue, 30 Nov 2010 08:44:43 +0100]: I think that the most recent version should be sufficient. I don't think Java would break backwards compatibility: users wouldn't be happy if their old jar suddenly stops working on a new JVM. Why an outdated and inefficient ZIP format, after all? 7zip is incompatible to JVM, should it be a better choice for archive uploads? Or, that is too hard to parse on PHP side (I gueses console exec is required)? We don't necessarily want ZIP uploads at Wikimedia, but it's not unreasonable to want to upload OpenOffice documents. Since the OO formats are ZIP-like, blocking ZIPs blocks those too. Roan Kattouw (Catrope) ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
[Wikitech-l] No more syntax errors!
Hi everybody, It's kind of silly when we commit php syntax errors to SVN (I've done it too). Of course we should all test our code before committing, but sometimes we don't--especially when it's a one line change and there's No Way It Could Break. To help us stop making these silly mistakes (and to avoid the inevitable complaint and followup), I've added a pre-commit hook to SVN. All changed/added files ending in .inc/.php/.php5 are now checked with php -l prior to the transaction completing. You should get a fun error message on your local console if you commit bad code :) Let me know if you have any problems with it. -Chad ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
On Tue, Nov 30, 2010 at 10:04 AM, Chad innocentkil...@gmail.com wrote: Hi everybody, It's kind of silly when we commit php syntax errors to SVN (I've done it too). Of course we should all test our code before committing, but sometimes we don't--especially when it's a one line change and there's No Way It Could Break. To help us stop making these silly mistakes (and to avoid the inevitable complaint and followup), I've added a pre-commit hook to SVN. All changed/added files ending in .inc/.php/.php5 are now checked with php -l prior to the transaction completing. You should get a fun error message on your local console if you commit bad code :) Let me know if you have any problems with it. -Chad Disabled temporarily, I'm hitting issues when doing a svn del. -Chad ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
On Tue, Nov 30, 2010 at 10:19 AM, Chad innocentkil...@gmail.com wrote: On Tue, Nov 30, 2010 at 10:04 AM, Chad innocentkil...@gmail.com wrote: Hi everybody, It's kind of silly when we commit php syntax errors to SVN (I've done it too). Of course we should all test our code before committing, but sometimes we don't--especially when it's a one line change and there's No Way It Could Break. To help us stop making these silly mistakes (and to avoid the inevitable complaint and followup), I've added a pre-commit hook to SVN. All changed/added files ending in .inc/.php/.php5 are now checked with php -l prior to the transaction completing. You should get a fun error message on your local console if you commit bad code :) Let me know if you have any problems with it. -Chad Disabled temporarily, I'm hitting issues when doing a svn del. -Chad Syntax errors in the pre-commit file. Oh the irony. -Chad ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
On Tue, Nov 30, 2010 at 10:19 AM, Chad innocentkil...@gmail.com wrote: On Tue, Nov 30, 2010 at 10:04 AM, Chad innocentkil...@gmail.com wrote: Hi everybody, It's kind of silly when we commit php syntax errors to SVN (I've done it too). Of course we should all test our code before committing, but sometimes we don't--especially when it's a one line change and there's No Way It Could Break. To help us stop making these silly mistakes (and to avoid the inevitable complaint and followup), I've added a pre-commit hook to SVN. All changed/added files ending in .inc/.php/.php5 are now checked with php -l prior to the transaction completing. You should get a fun error message on your local console if you commit bad code :) Let me know if you have any problems with it. -Chad Disabled temporarily, I'm hitting issues when doing a svn del. -Chad Syntax errors in the pre-commit file. Oh the irony. -Chad if/when this is enabled. Does this require anything from the commiters ? Do I need to install something or run a command in addition to or instead of 'svn commit -m ' ? Sounds nice as an additional check :) -- Krinkle ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
With my limited svn knowledge I'd say no. Postcommit hooks are a part of svn itself, IIRC I could also be wrong. -X! On Nov 30, 2010, at 10:34 AM, Krinkle krinklem...@gmail.com wrote: On Tue, Nov 30, 2010 at 10:19 AM, Chad innocentkil...@gmail.com wrote: On Tue, Nov 30, 2010 at 10:04 AM, Chad innocentkil...@gmail.com wrote: Hi everybody, It's kind of silly when we commit php syntax errors to SVN (I've done it too). Of course we should all test our code before committing, but sometimes we don't--especially when it's a one line change and there's No Way It Could Break. To help us stop making these silly mistakes (and to avoid the inevitable complaint and followup), I've added a pre-commit hook to SVN. All changed/added files ending in .inc/.php/.php5 are now checked with php -l prior to the transaction completing. You should get a fun error message on your local console if you commit bad code :) Let me know if you have any problems with it. -Chad Disabled temporarily, I'm hitting issues when doing a svn del. -Chad Syntax errors in the pre-commit file. Oh the irony. -Chad if/when this is enabled. Does this require anything from the commiters ? Do I need to install something or run a command in addition to or instead of 'svn commit -m ' ? Sounds nice as an additional check :) -- Krinkle ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
Nope, committers can continue doing what they do. You should only notice a change if you try to commit broken code :) -Chad On Nov 30, 2010 10:34 AM, Krinkle krinklem...@gmail.com wrote: On Tue, Nov 30, 2010 at 10:19 AM, Chad innocentkil...@gmail.com wrote: On Tue, Nov 30, 20... if/when this is enabled. Does this require anything from the commiters ? Do I need to install something or run a command in addition to or instead of 'svn commit -m ' ? Sounds nice as an additional check :) -- Krinkle ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
Hey, Awesome work Chad! This just saved me from doing a release without noticing there was an issue :) Cheers -- Jeroen De Dauw http://blog.bn2vs.com Don't panic. Don't be evil. -- ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
On Tue, Nov 30, 2010 at 10:04 AM, Chad innocentkil...@gmail.com wrote: All changed/added files ending in .inc/.php/.php5 are now checked with php -l prior to the transaction completing. You should get a fun error message on your local console if you commit bad code :) This assumes that all .inc files are actually PHP. Probably they are right now, but I can foresee this potentially breaking years down the line and confusing someone. Maybe for .inc files, you should check if they start with ?php before trying php -l. ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
On Tue, Nov 30, 2010 at 11:55 AM, Aryeh Gregor simetrical+wikil...@gmail.com wrote: This assumes that all .inc files are actually PHP. Probably they are right now, but I can foresee this potentially breaking years down the line and confusing someone. Maybe for .inc files, you should check if they start with ?php before trying php -l. That's one option. Another would be to stop using .inc files ;-) -Chad ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
Aryeh Gregor simetrical+wikil...@gmail.com wrote in message news:aanlkti=sgdvuc7f4r_usfya7e=cecfse7by-txcn3...@mail.gmail.com... On Tue, Nov 30, 2010 at 10:04 AM, Chad innocentkil...@gmail.com wrote: All changed/added files ending in .inc/.php/.php5 are now checked with php -l prior to the transaction completing. You should get a fun error message on your local console if you commit bad code :) This assumes that all .inc files are actually PHP. Probably they are right now, but I can foresee this potentially breaking years down the line and confusing someone. Maybe for .inc files, you should check if they start with ?php before trying php -l. Surely if there is no opening ?php tag then there is no parsing todo, and therefore the file will always pass validation. You may need to set short_open_tag to false to enforce this, I guess (it's good practice, anyhow, so that'd be no bad thing). - Mark Clements (HappyDog) ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
On Tue, Nov 30, 2010 at 12:22 PM, Mark Clements (HappyDog) gm...@kennel17.co.uk wrote: You may need to set short_open_tag to false to enforce this, I guess (it's good practice, anyhow, so that'd be no bad thing). I'm inclined to check with short open tags off. I know the Zend style guide recommends having against them (ours as well, I think...). Enforcing that style with a pre-commit hook is kind of nice :p -Chad ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
On Tue, Nov 30, 2010 at 12:22 PM, Mark Clements (HappyDog) gm...@kennel17.co.uk wrote: Surely if there is no opening ?php tag then there is no parsing todo, and therefore the file will always pass validation. Good point. I forgot how crazy PHP is there for a second. :) A non-PHP file in our repo that contains ?php and ends with .inc seems implausible enough to ignore. ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
Chad, You are my hero. Thank you so much for doing this! Arthur On 11/30/2010 07:04 AM, Chad wrote: Hi everybody, It's kind of silly when we commit php syntax errors to SVN (I've done it too). Of course we should all test our code before committing, but sometimes we don't--especially when it's a one line change and there's No Way It Could Break. To help us stop making these silly mistakes (and to avoid the inevitable complaint and followup), I've added a pre-commit hook to SVN. All changed/added files ending in .inc/.php/.php5 are now checked with php -l prior to the transaction completing. You should get a fun error message on your local console if you commit bad code :) Let me know if you have any problems with it. -Chad ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
On 30/11/10 16:04, Chad wrote: All changed/added files ending in .inc/.php/.php5 are now checked with php -l prior to the transaction completing. One step toward quality! Thanks Chad. Is the next one running parser tests ? -- Ashar Voultoiz ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] No more syntax errors!
On Tue, Nov 30, 2010 at 5:27 PM, Ashar Voultoiz hashar+...@free.fr wrote: On 30/11/10 16:04, Chad wrote: All changed/added files ending in .inc/.php/.php5 are now checked with php -l prior to the transaction completing. One step toward quality! Thanks Chad. Is the next one running parser tests ? We had parser tests running in code review on each commit, but it was sluggish so we chucked the feature. This is what ci.tesla does. We just need to fine tune it some more and make it run after every commit. -Chad ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Commons ZIP file upload for admins
On Tue, Nov 30, 2010 at 9:40 PM, Roan Kattouw roan.katt...@gmail.com wrote: We don't necessarily want ZIP uploads at Wikimedia, but it's not unreasonable to want to upload OpenOffice documents. Since the OO formats are ZIP-like, blocking ZIPs blocks those too. Roan Kattouw (Catrope) Although this feature(/s) should they get implemented in code would probably be wanted more than just at WMF and we shouldn't focus discussion on features such as this a Yes or No just because it's something the foundation may or may not want. -Peachey ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l