This repository contains only an incomplete sample of the project. It does not contain templates, css files nor other static resouces, which are stored in another private repository.
Pan Wywrotek is a content managment system used for managing Wywrota.pl website.
cgi-bin
- Perl FastCGI scripts, project libraries and configuration filesdoc
- some documentation and project historyresources
- static files - JavaSctipt, images, fonts etc.templates
- site templates in Template-Toolkit formattest
- test data for incoming interfacesutils
- various perl and bash scripts
You can follow this steps to set up local development environment on Linux/Mac/Windows. This setup is slightly different than production environment.
-
Clone sources from Git
git clone git@bitbucket.org:wywrota/wywrotek.git
-
Install Apache, MySQL, Perl, NodeJS, Grunt
- on Linux use standard system packages
- on Mac use Xcode
- on Windows you can use WAMP and ActivePerl
- on Windows create folder
C:\usr\bin\
and copy thereperl.exe
file to allow cross-platform cgi scripts
-
Set environment variable
WYWROTEK_SITE_CONFIG
(ie.windows
,mac
,dev
)export WYWROTEK_SITE_CONFIG=mac
-
Edit file
./config/config.xml
. In the section<mode name="mac">
set all necessary paths and passwords. -
Install required Perl libaries. The script
./utils/list_dependencies.pl
will get the full list of missing dependencies for you. It gives you a command you should run to install the modules returned by the script, ie:sudo cpan Astro::MoonPhase CGI::Ajax CGI::Fast Cache::Memcached ...
- In case of problems with installing MySQL libraries on Windows use the package manager provided by ActivePerl
Start > Active State Perl > Perl Package Manager
, search fordbd-mysql
and install. - In case of problems with C++ compilier on windows
'dmake' is not recognized as an internal or external command
install MinGW
- In case of problems with installing MySQL libraries on Windows use the package manager provided by ActivePerl
-
Import database. You will need production or development dapabase dump. To import the database you can use the script
utils/import_db.sh
-
Verify installation by running
perl cgi-bin/db.fcgi
. You should see a message"Status: 302 Found Location: http://www.wywrota.pl"
or similar. -
Set up Apache. In the file
conf\httpd.conf
make the following changes:- uncomment
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
- uncomment
LoadModule cgi_module libexec/apache2/mod_cgi.so
- copy the file
wywrota-apache-mac.conf
to apache conf directory and adjust the paths in this file - add
Include /conf/wywrota-apache-mac.conf
at the end of theconf\httpd.conf
file
- uncomment
-
Edit the
hosts
file. It can be found in the following locations/etc/hosts
or%systemroot%\system32\drivers\etc\hosts
. Add the following lines127.0.0.1 wywrota.local 127.0.0.1 www.wywrota.local 127.0.0.1 teksty.wywrota.local 127.0.0.1 literatura.wywrota.local
-
Install Grunt CLI and generate static files
npm install -g grunt-cli npm install grunt
-
Restart Apache. After accessing
http://www.wywrota.local/
you should see the home page.
To enable debugging you need to adjust <debug_level>
parameter in config.xml
file.
You can set it to one of the following values: "all, trace, debug, warn, error, none"
Use the following functions to add debugging points to your code:
Wywrota->trace("Starting to load data");
Wywrota->debug("You can pass objects too", $object);
Wywrota->warn("Something went wrong with this file", $file);
Wywrota->error("Something went really wrong with this file!", $file);