This is a framework for deploying hooks in REDCap on a global or per-project basis.
This code is covered by a standard GPL license which means you can't hold me liable :-) In other words, it is YOUR responsiblity to ensure that the use of this code or any modifications to it meet your institutional security guidelines. Some of the code in this repository is intended as example code for learning REDCap and not necessarily as production-ready code. In other words, use at your own risk. Please also leave attribution to this repository in the code and push back and updates and enhancements.
The code contained in this repository is typically installed as a nested subfolder off your root redcap directory.
- redcap_vx.y.z
- edocs
- languages
- plugins
- hooks
- framework (this repository belongs here!)
- redcap_hooks.php (this is the file that should be referenced in your control center)_
- server (this is a per-instance folder where you add hooks to your server and projects)
- global (a folder for global hooks)
- pidxx (a folder for project-specific hooks)
- framework (this repository belongs here!)
- Start by creating the hooks folder in your root redcap directory
- Download the repository (example using ssh method). I then renamed the folder from redcap-hook-framework to framework. This isn't necessary.
andy123$ pwd
/var/www/redcap
andy123$ mkdir hooks
andy123$ cd hooks
andy123$ pwd
/var/www/redcap/hooks
andy123$ git clone [email protected]/123andy/redcap-hook-framework.git
Cloning into 'redcap-hook-framework'...
andy123$ mv redcap-hook-framework framework
- In your redcap control center, point to the redcap_hooks.php file. In the example above, the path would be
/var/www/redcap/hooks/framework/redcap_hooks.php
- Create the 'server' folder inside your hooks folder if it doesn't already exist. The reason for breaking this into a separate folder is so that you can version this separately from the framework files.