Extension talk:Foxway
Add topic| This page used the LiquidThreads extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
I like this idea, but...
[edit]Hey, I would love to as my local admin to install this extension. He'll never go for it though due to security concerns. Now, "if" this extension only allowed php in a certain namespace that was only accessible/editable by people with a special user group right, then I could talk him into it. Something like the way that Extension:Widget allows special code to be entered in the "Widget:" namespace and requires editwidgets to edit in that namespace.. Technical 13 (talk) 12:31, 5 June 2013 (UTC)
- Hi, thanks for the feedback!
- Why are you concerned about the security with this extension? This extension does not allows run php code! It works the same way as other extensions like Extension:ParserFunctions, but instead of using wiki syntax, uses the syntax of PHP.
- I try to make sure that the output of this extension was very similar to the output of PHP. I use own PHP interpreter and never use direct run custom code in PHP interpreter installed on your computer.
- Extension:Widget allows the creation of raw HTML pages. Therefore, for safety reasons, are allowed to use this extension is just to name space with limited access. Foxway does not allow creation of raw HTML pages, because MediaWiki parser processes the foxway outputs like any other text.
- In any case, I will add the ability to specify the namespaces, which enable the extension foxway. Pastakhov (talk) 04:25, 6 June 2013 (UTC)
- You can test the safety of extension Foxway in this sandbox Pastakhov (talk) 05:49, 6 June 2013 (UTC)
- Hi, here's an example for giving permission to use Foxway extension is just a special user group:
- (Place it in LocalSettings.php)
- Pastakhov (talk) 08:43, 11 June 2013 (UTC)
// Define new Namespace define("NS_PHP", 1000); define("NS_PHP_TALK", 1001); $wgExtraNamespaces[NS_PHP] = "PHP"; $wgExtraNamespaces[NS_PHP_TALK] = "PHP_Talk"; // Protect this namespace $wgNamespaceProtection[NS_PHP] = array( 'php_editor' ); $wgGroupPermissions['sysop']['php_editor'] = true; // Allow Foxway only in this namespace // Placing it AFTER the inclusion of Foxway!!! $wgNamespacesWithFoxway = array( NS_PHP );
Performance (in comparison to Scribuntu/LUA)
[edit]Interesting approach! I would be interested in performance comparison to Scribunto/LUA. Did you do any comparison so far? Danwe (talk) 15:02, 10 June 2013 (UTC)
- I am also very interested in the performance compared to Lua :-) but I did not do comparisons...
- I try to provide a high performance, but the main emphasis is on simplicity and versatility. I have a few ideas with the management of caching that can greatly improve performance, but I have not been thinking seriously about it. Pastakhov (talk) 16:01, 10 June 2013 (UTC)
- Did you also think about implementing this as extension for Scribuntu? I did not really look into this much, but as I understand, it should be possible to implement support for other languages than LUA with Scribuntu. Could be an interesting approach. Danwe (talk) 20:15, 10 June 2013 (UTC)
- For working this extension does not need framework like Scribunto. Also, such a union reduce the performance and limit the opportunities of this extension, so I do not see the point in the implementation of this.
- The main idea of this extension is to use PHP syntax, instead parser functions and like. This is great for me and has a high performance.
- But that's not all I want to do. :-)
- In the future I plan to add objects that will work like extensions Semantic Forms, Semantic Result Formats, Maps, CategoryTree, etc.
- How will it work? something like this:
- Pastakhov (talk) 04:38, 11 June 2013 (UTC)
$bar = new Query(); $bar->getPages(['Namespace'=>'Extension', 'limit'=>10, 'category'='Parser extensions', 'properties'=>'Lasteditor']); echo new Table($bar);
- Did you also think about implementing this as extension for Scribuntu? I did not really look into this much, but as I understand, it should be possible to implement support for other languages than LUA with Scribuntu. Could be an interesting approach. Danwe (talk) 20:15, 10 June 2013 (UTC)
- I tried to compare performance Scribunto/LUA vs Foxway. It's like comparing warm vs soft :-)
- Lua takes a step faster than Foxway, but Foxway can make big steps. Maybe I'm wrong, but that's what I think about it.
- Foxway allows the use of a large number of functions PHP, especially for arrays that run very fast.
- Next I want to add objects, such as HTMLTable. This will avoid bottlenecks, such as the use of cycles in Foxway.
- This will allow foxway make giant steps and if lua will not give the same opportunity, will never catch up Foxway.
- In general, it all depends on the implementation. This makes it impossible to make a fair test. Pastakhov (talk) 04:45, 26 June 2013 (UTC)
- I have done a comparative test m:Grants:IEG/Magic_expression#Compared_to_LUA_scripting Pastakhov (talk) 05:05, 27 March 2014 (UTC)
English grammar unclear in lead at least
[edit]The lead needs grammatical editing, especially a boldfaced sentence in which the second clause is either a warning against our doing something or is a declaration that the extension doesn't do it and I can't tell which was intended. Since editing the grammar requires knowing the intent and I don't know the intent, I'm not qualified to edit the page. I didn't read the rest of the page. If anyone knows what is meant, please edit. Thanks. Nick Levinson (talk) 16:44, 9 August 2013 (UTC)
- Thank you for your comment. I tried to fix it. Pastakhov (talk) 06:38, 15 August 2013 (UTC)
Date
[edit]Hello, having date() would be very useful. Is there any plan to implement it in this extension? 85.26.186.141 08:26, 22 October 2013 (UTC)
- Never mind, i see it's on the To do list. 85.26.186.141 09:19, 22 October 2013 (UTC)
- Yes, it will be done in the next release.
- For solving performance issues had to rewrite the code.
- There's still a lot of work, so I can not tell time. Pastakhov (talk) 10:19, 22 October 2013 (UTC)
- The PhpTags extension is the successor of this extension and contains functions for working with dates in PhpTags Functions extension. Pastakhov (talk) 09:24, 9 July 2014 (UTC)
Where is the 'Debug view'
[edit]Where is this debug view? How do i reach it? 85.26.184.152 17:03, 22 October 2013 (UTC)
- You need add
debugin foxway tag. - Example:
- <foxway debug>echo 2+2;</foxway> Pastakhov (talk) 06:12, 23 October 2013 (UTC)
Configuration parameters
[edit]Hi so I was going to test this extension and was wondering what the optimal configuration parameters are? What do you have them set at? Thanks Christharp (talk) 23:24, 26 March 2014 (UTC)
- Hi, don't use this extension. It's prototype only.
- You can use the development version of extension PhpTags and PhpTags Functions.
- PhpTags has better performance, but has no debug feature and some string functions yet. In others it is similar.
- There is a detailed description of this solution.
- Feel free to ask me and please let me know the test results. Thank you in advance. Pastakhov (talk) 04:43, 27 March 2014 (UTC)
- There is no any special parameters.
- Now, PhpTags has only two parameters:
- $wgPhpTagsMaxLoops
- limits the number of loops
- $wgPhpTagsNamespaces
- limits the namespaces where PhpTags can be used
- I'm going to make the time limit and limit of function groups.
- I think this will be enough for convenient and safe use. Pastakhov (talk) 04:58, 27 March 2014 (UTC)