From: Jeff D. <da...@da...> - 2001-11-27 17:23:01
|
On Tue, 27 Nov 2001 02:11:46 -0500 "Carsten Klapp" <car...@ma...> wrote: > I tried to move some files in phpwiki but it isn't working as I expected. > Would you help? Sure. Glad to. The root of the problem, I think, is that CVS really doesn't support moving files. The only way to do it is to delete ("remove") the old file, and create ("add") a new one. (I'd guess that your CVS client is trying to be smart, and offering to fake the process for you --- but it's not smart enough to pull it off correctly...) (This also explains why the revision gets reset to 1.0. Don't worry about that --- it's unavoidable.) Try just "removing" the old file and "adding" the new one. ====== As for the changes you're making, I think generally they're fine ideas. I do have a few comments/suggestions, though: There are two sorts of files which need to be "found" during the execution of PhpWiki: 1. PHP source files (including non-PHP code which gets read by the PHP code like the templates, interwiki.map, pgsrc, and the entire locale subtree) 2. Files which need to be directly accessible via HTTP. The two sets do not overlap (except for index.php, sort of). It is somewhat dangerous, security-wise, to have the PHP source code directly accesible via HTTP, so it's best if things can be easily arranged to deny that. Currently (pre your changes) the only files which needed to be HTTP accessible were in the top PhpWiki install directory and in images. I think it would be best to keep these two classes of files in separate directories (as much as possible) specifically so that it's easier to administer, security-wise. (This would argue against putting the style sheets in the templates sub-tree.) > 2. Move nonessentials out of the root directory into a subdirectory > already known to wiki. We can eliminate the extra code for data_path vs. > virtual-path, and hopefully make it easier to use virtual paths. I think moving the style sheets into a subdirectory is a fine idea. (Perhaps the 'images' subdirectory should be renamed 'data' for this purpose.) (As a nit, I think the first theme should be called 'default' rather than 'vanilla'.) I don't think we can eliminate data_path vs virtual_path in all cases though. Not everyone has access to apache's Alias directive (it has to go in httpd.conf, and therefore requires root privs; and, not everyone runs on an apache server...) There are several other ways to get the "nice" URLs. Most involve being able to set DATA_PATH. > Alias /wiki3/ "/Library/WebServer/Documents/phpwiki-1. > 3/index.php/" > Alias /wiki3 "/Library/WebServer/Documents/phpwiki-1. > 3/index.php" Just as an aside: aren't these two lines redundant? I think if you have the latter, you don't need the former. (I haven't tested this though.) > Alias /wiki3admin/ > "/Library/WebServer/Documents/phpwiki-1.3/admin.php/" > Alias /wiki3admin > "/Library/WebServer/Documents/phpwiki-1.3/admin.php" (There is no admin.php in 1.3.) > - define(data_path..) and associated code is eliminated or reduced, now > resolves to Virtual_Path/templates. As I said, some people will still need DATA_PATH. I should rewrite the comments in index.php. I no longer use the SetHandler method (though it works). Here's what I do (assumes Apache with appropriate permissions): 1) Assuming /htdocs is the document root for the web server, install PhpWiki in e.g. /htdocs/phpwiki-1.3 2) Copy (or symlink) /htdocs/phpwiki-1.3/index.php to /htdocs/wiki. 3) Add the following to /htdocs/.htaccess: <Files wiki> SetHandler application/x-httpd-php </Files> (This tells apache that /htdocs/wiki is really a php script.) 4) Edit /htdocs/wiki: Set PHP's 'include_path' so that the rest of the PHP code can be found: ini_set('include_path', '/htdocs/phpwiki-1.3:/path/to/pear/code'); Set DATA_PATH so data can be found: define('DATA_PATH', '/phpwiki-1.3'); This method has the advantage, that one can run several different wikis sharing all the PhpWiki code. (E.g. copy /htdocs/wiki to /htdocs/wiki2. Edit $DBParams in wiki2 so that it uses a different database. Now you have two wikis running off the same code.) Another thing to keep in mind is that style-sheets will, in the future, probably become user selectable --- each wiki user can set in their preferences which style sheet they like best.... (Themes, as I understand them, will probably not be user selectable, but rather one will be chosen (then customized) by the wiki-admin when setting up the wiki.) (i.e. I foresee selection of style sheets will become somewhat orthogonal to selection of theme.) Also, think about how the theme selection is going to interact with the i18n support in PhpWiki. Currently templates are in locale/$LANG/templates for each of the supported non-english languages. (Currently all the non-english templates are severely broken --- but that's neither here nor there.... :-) Would it be best to do away with the templates in the locale subtree, and instead have each theme be language specific? E.g. there will be themes with names like 'default', (or 'vanilla'), 'default-de', 'default-sv', 'psychedelic', 'psychedelic-nl', etc. (The locale subtree would still contain the pgsrc and gettext stuff for the different languages.) ===== Having rambled through all this now, here's how I would refactor things: 1) Rename the 'images' subdirectory to 'data'. 2) Move phpwiki.css to data/default.css, phpwiki-heavy.css to data/default-heavy.css. If there are HTTP accessible files which are specific to certain themes, put them in appropriately named subdirectories of data. Wikibase.png, on the other hand, I would guess would be used by several themes, so I'm not sure it should go in a theme-specific subdirectory. 3) Move the theme specific parts of index.php into themes/<theme-name>.php. This would include pretty much everything in "Part Three" and "Part Four" of index.php. I'm assuming here that themes will be language specific --- otherwise the language config stuff should stay in index.php (or move to lang/<lang-name>.php?). 4) Templates for different themes would be in subdirectories templates/<theme-name>/. This does do away with your "one directory per theme" paradigm, which is attractive... (I've posted this note to phpwiki-talk too, as I'm sure others will have useful comments to make on the matter. If you're not subscribed to phpwiki-talk, you should be... http://lists.sourceforge.net/lists/listinfo/phpwiki-talk ) |