<?php
/*

RC - Research Catalogue

Version 1
(c) Copyright 2012 Karlsruhe University of Arts and Design, Institut für Digitales Gedächtnis

http://www.hfg.edu/rc
info@hfg.edu

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
*/

/**
* @}
*/

/**
* config for dilps, other conifg values are in table $db_prefix.'config'
*/
use dilps\helper\IPv6Net;

if (!defined('APPLICATION_PATH')) {
require_once dirname(__FILE__) . '/../../lib/AuthUserRc.php';
}

$dilps_config = array();

define('DILPS_COMPAT', FALSE);

$dilps_config['media_password'] = 'secret password';

$dilps_config['guest_user'] = 'rc/guest'; //!< guest user is used if no one is logged in
$dilps_config['guest_groups'] = array('rc/reader'); //!< groups, the guest user is belonging to
$dilps_config['guest_pwd'] = 'guest'; //!< password for automatic guest login

$dilps_config['admin_uid'] = 'rc/admin'; //!< adminstrator
$dilps_config['admin_groups'] = array('rc/admin'); //!< group, admins are belonging to

$dilps_config['domains'] = '1'; //!< number of authentication domains
$dilps_config['domainclass1'] = 'AuthUserRc';
$dilps_config['domainname1'] = 'rc';

$dilps_config['user_group'] = '1:1'; //!< base group for all user groups
$dilps_config['basecollection'] = '2'; //!< default collection
$dilps_config['default_lang'] = 'ger'; //!< default language

$dilps_config['upload_dir'] = '/path/to/upload/dir'; //!< base directory for file uploads

$dilps_config['exec'] = "timeout.sh -t 60 CMD 2>/dev/null"; //!< Execution wrapper command
$dilps_config['file'] = 'file -b -i SOURCE';
$dilps_config['gvfs-info'] = 'gvfs-info -a standard::content-type SOURCE';
$dilps_config['gvfs-info_regex'] = '/standard::content-type: (.*\/.*)$/';
$dilps_config['convert_watermark'] = "convert SOURCE PARAM -font Courier -pointsize 14 -fill black -annotate 270x270+TLEFT0+TTOP0 WATERMARK -fill white -annotate 270x270+TLEFT1+TTOP1 WATERMARK ADDITIONAL TARGET 2>&1";
$dilps_config['convert'] = "convert SOURCE PARAM ADDITIONAL TARGET 2>&1";
$dilps_config['sha256'] = "sha256sum -b SOURCE";
$dilps_config['identify'] = 'identify -format \'Format: %m; Geometry: %wx%h; xres: %x; yres: %y; Type: %[type]; Colorspace: %[colorspace];\' SOURCE[0]';
$dilps_config['identify_regex'] = "/.*Format: (\S+);.*Geometry: ([0-9]+)x([0-9]+);.*xres: ([^;]*);.*yres: ([^;]*);.*Type: ([^;]*);.*Colorspace: ([^;]*);.*/";
$dilps_config['exif'] = 'exif SOURCE';
$dilps_config['tiffinfo'] = 'tiffinfo SOURCE';
$dilps_config['pdfinfo'] = 'pdfinfo -meta SOURCE';
$dilps_config['pdftotext'] = 'pdftotext SOURCE > TARGET';
$dilps_config['ffmpeg'] = 'ffmpeg -i SOURCE 2>&1';
$dilps_config['atomicparsley'] = 'AtomicParsley SOURCE -t';
$dilps_config['ffmpeg_convert'] = 'ffmpeg -ss STARTSEC -i SOURCE -f image2 -vframes 1 TARGET 2>&1';
$dilps_config['ffmpeg_convert_sequence'] = 'ffmpeg -ss STARTSEC -i SOURCE -f image2 -r 1/DISTSEC TARGET 2>&1';
$dilps_config['ffmpeg_convert_sequence_init'] = 'ffmpeg -ss 1 -i SOURCE -f image2 -r 1 -vframes NUM TARGET 2>&1';
// maximum number of shots for video sequence
$dilps_config['ffmpeg_convert_sequence_max'] = 120;

// distance between shots multiple of x sec
$dilps_config['ffmpeg_convert_sequence_sec'] = 5;

// second, the default videoshot will be taken
$dilps_config['ffmpeg_convert_startsec'] = 10;

$dilps_config['imagetemp'] = APPLICATION_PATH . '/../data/tmp/';
$dilps_config['storage_base'] = '/path/to/storage/dir';
$dilps_config['url_base'] = 'http://media.base.url.sample/';

$dilps_config['cachedir'] = 'cache';
$dilps_config['masterdir'] = 'master';

// Groups for role based rights
$dilps_config['roles'] = array(
'viewer' => 'reader',
'editor' => 'editor',
'manager' => 'manager',
);
$dilps_config['roledomain'] = 'local';

$dilps_config['pdfinfo'] = 'pdfinfo -meta';

/* Icon Set */
$dilps_config['iconset'] = 'aquablend';

$dilps_config['titlefield'] = array(
'dc.title.original::string',
'dc.title::string',
'dc.title.original::string',
'wdr.M022::string',
'wdr.ME26::string',
'wdr.R021::string',
'wdr.P021::string'
);

/* default number of entities per page */
$dilps_config['default_page_size'] = '500';

$dilps_config['db_prefix'] = 'd3_';
$dilps_config['basepath'] = APPLICATION_PATH . '/../library/dilps';
$dilps_config['libpath'] = $dilps_config['basepath'] . '/lib';
$dilps_config['includepath'] = $dilps_config['basepath'] . '/include';
$dilps_config['adodbpath'] = APPLICATION_PATH . '/../library/adodb5';
$dilps_config['urnbuilder'] = APPLICATION_PATH . '/configs/dilps/urnbuilder.xml';

$dilps_config['db_type'] = 'mysqli';
$dilps_config['db_host'] = 'localhost';
$dilps_config['db_user'] = 'user name';
$dilps_config['db_pwd'] = 'user password';
$dilps_config['db_db'] = 'database name';

$dilps_config['config_table'] = 'd3_config3';
$dilps_config['search_engine'] = 'solr';
$dilps_config['solr_server'] = 'localhost';
$dilps_config['solr_port'] = '8983';
$dilps_config['instance'] = 'rc';

// mediawiki stuff
$dilps_config['wikiext_includepath'] = $dilps_config['basepath'] . '/include';
$dilps_config['operationpath'] = $dilps_config['basepath'] . '/Operation';
$dilps_config['specialpagepath'] = $dilps_config['basepath'] . '/SpecialPage';
$dilps_config['web_cache'] = '/data/dilps/cache';

global $wgScriptPath;
$dilps_config['scriptpath'] = $wgScriptPath . '/extensions/dilps';

$dilps_config['remote_addr'] = array_key_exists('REMOTE_ADDR', $_SERVER) ? $_SERVER['REMOTE_ADDR'] : '';
if (!strlen($dilps_config['remote_addr']))
$dilps_config['remote_addr'] = '127.0.0.1';
$dilps_config['server_name'] = array_key_exists('SERVER_NAME', $_SERVER) ? strtolower($_SERVER['SERVER_NAME']) : '';
if (!strlen($dilps_config['server_name']))
$dilps_config['server_name'] = 'localhost';

$dilps_config['loglevel'] = 0;
#$dilps_config['loglevel'] = 31;
#$dilps_config['logfile'] =  APPLICATION_PATH . "/../log/dilps/dilps-{$dilps_config['server_name']}-{$dilps_config['remote_addr']}.log";
#$dilps_config['resource_logfile'] = APPLICATION_PATH . "/../log/dilps/dilps-resource-{$dilps_config['server_name']}-{$dilps_config['remote_addr']}.log";

$formats_suffix = array(
"image/jpeg" => "jpg",
"image/png" => "png",
"image/gif" => "gif",
"image/tiff" => "tif",
"image/x-photoshop" => "psd",
"image/x-ms-bmp" => "bmp",
"image/bmp" => "bmp",
"application/pdf" => "pdf",
);

$dilps_config['filetype'] = array(
'/image\//' => 'GenericItem',
'/video\//' => 'VideoItem',
'/audio\//' => 'AudioItem',
'/application\/pdf/' => 'PdfItem',
);

$dilps_config['sequencedigits'] = 5;
$dilps_config['defaulttemplate'] = 'GenericItem';

/**
* @}
*/

?>