Thanks alec for the support. If code is compliant with an standard and "symlinked" installations, it will facilitate things a lot.
In this sense, there is still an issue that need to be fixed before everybody could enjoy this fast and easy.
The point is that "/tools" (like upgrade.php or runScheduledTasks.php) are failing when are called from php-cli.
This is the error I get:
Code: Select all
redi:~/ojs# php /home/ojs/htdocs/ojs-dag/tools/runScheduledTasks.php
<h1>DB Error: Access denied for user 'ojs'@'localhost' (using password: YES)</h1>ojs2: DB Error: Access denied for user 'ojs'@'localhost' (using password: YES)
From my understanding, this happens because tools folder is symlinked so php is unable to find the right config.inc.php and perform the tasks.
First and fast solution will be a /tools folder duplications but this is against the idea of code sharing (less caching, code mantainance...) so I was asking myself if /tools code could be patched to suggest a config.inc.php or a working folder.
As always, if you drive me to the right direction, I love to give a first try.
I will improve and update the script to be republish.
About the magazine's script I'm developing, I'm unsure if this is the right approach as far it was done to accomplish the task and not to be elegant or fit well with OJS. I mean that probably a php-cli aplication (like you guys did with "tools") will be better to do the job than a bash-script.
Any case, the script is growing and right now this is what could be done:
Code: Select all
Syntax: ./magazine.sh <action> <shortname> [<contact-mail> [<owner-name> [<magazine-title>]]]
<action>: help: Script syntax.
list: Lists all the magazines of the service.
createall: Creates a full ojs-magazine from the BASE template.
deleteall: Deletes the folder structure and DB of an ojs-magazine.
createdb: Creates the DB of an ojs-magazine from BASE template.
delete: Backups and deletes the folder structure of an ojs-magazine.
htaccess: Recreates the global htaccess file.
crontab: Recreates the global crontab file.
r-links: Recover symlinks for an specific site (for instance, relinks to ojs-2.3.6 to instead of ojs-2.3.4)
setdomain: Recreates config files to let the magazine respond under a domain like www.example.com
<magazine-tag>: Short name of the magazine that will be used as an ID
(folders and DB) and as an URL (pe: magazine01).
Comment: The tag ALL is reserved to operate against every magazine
of the system (Not implemented yet).
<mail>: (opcional) Email prefix (without @uab.cat) of the main magazine contact
I like to extend it with backup, restore and upgrade actions.
Please, let me know if somebody wants/needs the last version so I will repackage it all.