Skip to content

Commit

Permalink
Update to use new YAML config files
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Apr 18, 2017
1 parent 4b55843 commit c1d362e
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 147 deletions.
2 changes: 1 addition & 1 deletion Gemini/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CREATE TABLE gemini.Gemini (

## Configuration

Gemini accepts [configuration for Doctrine's DBAL](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html) as the `db.options` array in [its config file](./cfg/cfg.php) file. Reasonable defaults provided are for a MySQL installation. Do not commit the configuration file with your credentials into Git!
Gemini accepts [configuration for Doctrine's DBAL](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html) as the `db.options` array in [its config file](./cfg/config.yaml) file. Reasonable defaults provided are for a MySQL installation. Do not commit the configuration file with your credentials into Git!

## Usage

Expand Down
33 changes: 0 additions & 33 deletions Gemini/cfg/cfg.php

This file was deleted.

24 changes: 24 additions & 0 deletions Gemini/cfg/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---

db.options:
driver: pdo_mysql
host: 127.0.0.1
port: 3306
dbname: gemini
user: changeme
password: changeme

log:
# Valid log levels are:
# DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY, NONE
# log level none won't open logfile
level: DEBUG
file: ../gemini.log

security:
# toggles JWT security for service
enable: false
# Path to the syn config file for authentication.
# example can be found here:
# https://github.com/Islandora-CLAW/Syn/blob/master/conf/syn-settings.example.xml
config: ../syn-settings.xml
11 changes: 6 additions & 5 deletions Gemini/src/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

require_once __DIR__.'/../vendor/autoload.php';

use Islandora\Crayfish\Commons\IslandoraServiceProvider;
use Islandora\Crayfish\Commons\Provider\IslandoraServiceProvider;
use Islandora\Crayfish\Commons\PathMapper\PathMapper;
use Islandora\Crayfish\Commons\Provider\YamlConfigServiceProvider;
use Islandora\Gemini\Controller\GeminiController;
use Silex\Application;

$config = require_once(__DIR__ . '/../cfg/cfg.php');

$app = new Application();
$app->register(new IslandoraServiceProvider($config));

$app['gemini.controller'] = function () use ($app) {
$app->register(new IslandoraServiceProvider());
$app->register(new YamlConfigServiceProvider('../cfg/config.yaml'));

$app['gemini.controller'] = function ($app) {
return new GeminiController(
new PathMapper($app['db'])
);
Expand Down
2 changes: 1 addition & 1 deletion Houdini/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

## Configuration

If your imagemagick installation is not on your path, then you can configure Houdini to use a specific executable by editing `executable` entry in [cfg.php](./cfg/cfg.php).
If your imagemagick installation is not on your path, then you can configure Houdini to use a specific executable by editing `executable` entry in [config.yaml](./cfg/config.yaml).

You also will need to set the `fedora base url` entry to point to your Fedora installation.

Expand Down
29 changes: 0 additions & 29 deletions Houdini/cfg/cfg.php

This file was deleted.

30 changes: 30 additions & 0 deletions Houdini/cfg/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

fedora:
base_url: http://localhost:8080/fcrepo/rest

log:
# Valid log levels are:
# DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY, NONE
# log level none won't open logfile
level: DEBUG
file: ../houdini.log

houdini:
# path to the convert executable
executable: convert
formats:
valid:
- image/jpeg
- image/png
- image/tiff
- image/jp2
default: image/jpeg

security:
# toggles JWT security for service
enable: false
# Path to the syn config file for authentication.
# example can be found here:
# https://github.com/Islandora-CLAW/Syn/blob/master/conf/syn-settings.example.xml
config: ../syn-settings.xml
7 changes: 7 additions & 0 deletions Houdini/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@
"squizlabs/php_codesniffer": "^2.0",
"sebastian/phpcpd": "^3.0"
}
,
"repositories": [
{
"type": "path",
"url": "../../Crayfish-Commons"
}
]
}
16 changes: 9 additions & 7 deletions Houdini/src/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

require_once __DIR__.'/../vendor/autoload.php';

use Islandora\Crayfish\Commons\IslandoraServiceProvider;
use Islandora\Crayfish\Commons\Provider\IslandoraServiceProvider;
use Islandora\Crayfish\Commons\Provider\YamlConfigServiceProvider;
use Islandora\Houdini\Controller\HoudiniController;
use Silex\Application;

$config = require_once(__DIR__ . '/../cfg/cfg.php');
$app = new Application();
$app->register(new IslandoraServiceProvider($config));

$app['houdini.controller'] = function ($app) use ($config) {
$app->register(new IslandoraServiceProvider());
$app->register(new YamlConfigServiceProvider('../cfg/config.yaml'));

$app['houdini.controller'] = function ($app) {
return new HoudiniController(
$app['crayfish.cmd_execute_service'],
$config['valid formats'],
$config['default format'],
$config['executable'],
$app['crayfish.houdini.formats.valid'],
$app['crayfish.houdini.formats.default'],
$app['crayfish.houdini.executable'],
$app['monolog']
);
};
Expand Down
38 changes: 0 additions & 38 deletions Hypercube/.github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

2 changes: 1 addition & 1 deletion Hypercube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This will put the Hypercube at the /hypercube endpoint on the webserver.

## Configuration

If your tesseract installation is not on your path, then you can configure Hypercube to use a specific executable by editing `executable` entry in [cfg.php](./cfg/cfg.php).
If your tesseract installation is not on your path, then you can configure Hypercube to use a specific executable by editing `executable` entry in [config.yaml](./cfg/config.yaml).

You also will need to set the `fedora base url` entry to point to your Fedora installation.

Expand Down
27 changes: 0 additions & 27 deletions Hypercube/cfg/cfg.php

This file was deleted.

23 changes: 23 additions & 0 deletions Hypercube/cfg/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---

fedora:
base_url: http://localhost:8080/fcrepo/rest

log:
# Valid log levels are:
# DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, EMERGENCY, NONE
# log level none won't open logfile
level: DEBUG
file: ../hypercube.log

hypercube:
# path to the convert executable
executable: tesseract

security:
# toggles JWT security for service
enable: false
# Path to the syn config file for authentication.
# example can be found here:
# https://github.com/Islandora-CLAW/Syn/blob/master/conf/syn-settings.example.xml
config: ../syn-settings.xml
11 changes: 6 additions & 5 deletions Hypercube/src/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

require_once __DIR__.'/../vendor/autoload.php';

use Islandora\Crayfish\Commons\IslandoraServiceProvider;
use Islandora\Crayfish\Commons\Provider\IslandoraServiceProvider;
use Islandora\Crayfish\Commons\Provider\YamlConfigServiceProvider;
use Islandora\Hypercube\Controller\HypercubeController;
use Silex\Application;

$config = require_once(__DIR__ . '/../cfg/cfg.php');
$app = new Application();
$app->register(new IslandoraServiceProvider($config));
$app->register(new IslandoraServiceProvider());
$app->register(new YamlConfigServiceProvider('../cfg/config.yaml'));

$app['hypercube.controller'] = function () use ($app, $config) {
$app['hypercube.controller'] = function ($app) {
return new HypercubeController(
$app['crayfish.cmd_execute_service'],
$config['executable']
$app['crayfish.hypercube.executable']
);
};

Expand Down

0 comments on commit c1d362e

Please sign in to comment.