Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
edelm committed Aug 30, 2016
2 parents 0faf6a1 + bfea23c commit f6ce09b
Show file tree
Hide file tree
Showing 91 changed files with 3,674 additions and 781 deletions.
12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@ sudo: false
language: php
php:
- 5.4
- 5.5
- 5.6
- 7.0

env:
- VUFIND_HOME=$PWD VUFIND_LOCAL_DIR=$PWD/local

before_script:
# Note: locked phpcs to 2.3.4 due to a bug in 2.4.0; can relax restriction after next release.
- pear install pear/PHP_CodeSniffer-2.3.4
- pear install pear/Http_Request2
- pear channel-discover pear.phing.info
- pear install phing/phing
- composer global require fabpot/php-cs-fixer
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- phpenv config-rm xdebug.ini
- phpenv rehash

script:
- phing composer
- phpunit --stderr --configuration module/VuFind/tests/phpunit.xml
- phpcs --standard=PEAR --ignore=*/config/*,*/tests/* --extensions=php $PWD/module
- phing php-cs-fixer-dryrun
- phing composer phpunitfast phpcs-console php-cs-fixer-dryrun
30 changes: 18 additions & 12 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
<property name="pgsqlhost" value="localhost" />
<property name="pgsqlrootuser" value="postgres" />
<property name="phpunit_extra_params" value="" />
<property name="composer_extra_params" value="" />
<property name="mink_driver" value="zombiejs" /><!-- may also be set to selenium -->
<property name="snooze_multiplier" value="1" /><!-- can be used to slow down tests (selenium only) -->
<property name="php-cs-fixers" value="no_blank_lines_before_namespaces,function_call_space,trailing_spaces,unused_use,lowercase_keywords,encoding,parenthesis,php_closing_tag,visibility,duplicate_semicolon,extra_empty_lines,no_blank_lines_after_class_opening,no_empty_lines_after_phpdocs,operators_spaces,spaces_before_semicolon,ternary_spaces,concat_with_spaces,short_array_syntax,phpdoc_no_access,remove_leading_slash_use,eof_ending" />


<property name="version" value="3.0.1" />
<property name="version" value="3.0.3" />

<!-- We only need the -p switch if the password is non-blank -->
<if><not><equals arg1="${mysqlrootpass}" arg2="" /></not><then>
Expand Down Expand Up @@ -68,35 +69,38 @@

<!-- Report rule violations with PHPMD (mess detector) -->
<target name="phpmd">
<exec command="phpmd ${srcdir}/module xml ${srcdir}/tests/phpmd.xml --exclude ${srcdir}/module/VuFind/tests,${srcdir}/module/VuDL/tests,${srcdir}/module/VuFindSearch/tests --reportfile ${builddir}/reports/phpmd.xml" />
<exec command="${srcdir}/vendor/bin/phpmd ${srcdir}/module xml ${srcdir}/tests/phpmd.xml --exclude ${srcdir}/module/VuFind/tests,${srcdir}/module/VuDL/tests,${srcdir}/module/VuFindSearch/tests --reportfile ${builddir}/reports/phpmd.xml" />
</target>

<!-- Measure project with phploc -->
<target name="phploc">
<exec command="phploc --log-csv ${builddir}/reports/phploc.csv ${srcdir}/module" />
<exec command="${srcdir}/vendor/bin/phploc --log-csv ${builddir}/reports/phploc.csv ${srcdir}/module" />
</target>

<!-- PHP_Depend code analysis -->
<target name="pdepend">
<exec command="pdepend --jdepend-xml=${builddir}/reports/jdepend.xml --jdepend-chart=${builddir}/reports/dependencies.svg --overview-pyramid=${builddir}/reports/pdepend-pyramid.svg ${srcdir}/module" />
<exec command="${srcdir}/vendor/bin/pdepend --jdepend-xml=${builddir}/reports/jdepend.xml --jdepend-chart=${builddir}/reports/dependencies.svg --overview-pyramid=${builddir}/reports/pdepend-pyramid.svg ${srcdir}/module" />
</target>

<!-- PHP copy-and-paste detection -->
<target name="phpcpd">
<exec command="phpcpd --log-pmd ${builddir}/reports/pmd-cpd.xml --exclude tests ${srcdir}/module" />
<exec command="${srcdir}/vendor/bin/phpcpd --log-pmd ${builddir}/reports/pmd-cpd.xml --exclude tests ${srcdir}/module" />
</target>

<!-- PHP CodeSniffer -->
<target name="phpcs">
<exec command="phpcs --standard=PEAR --ignore=*/config/*,*/tests/* --extensions=php --report=checkstyle ${srcdir}/module &gt; ${builddir}/reports/checkstyle.xml" escape="false" />
<exec command="${srcdir}/vendor/bin/phpcs --standard=PEAR --ignore=*/config/*,*/tests/* --extensions=php --report=checkstyle ${srcdir}/module &gt; ${builddir}/reports/checkstyle.xml" escape="false" />
</target>
<target name="phpcs-console">
<exec command="${srcdir}/vendor/bin/phpcs --standard=PEAR --ignore=*/config/*,*/tests/* --extensions=php ${srcdir}/module" escape="false" passthru="true" checkreturn="true" />
</target>

<!-- php-cs-fixer (first task applies fixes, second task simply checks if they are needed) -->
<target name="php-cs-fixer">
<exec command="php-cs-fixer fix ${srcdir}/module --fixers=${php-cs-fixers} --verbose" passthru="true" escape="false" />
<exec command="${srcdir}/vendor/bin/php-cs-fixer fix ${srcdir}/module --fixers=${php-cs-fixers} --verbose" passthru="true" escape="false" />
</target>
<target name="php-cs-fixer-dryrun">
<exec command="php-cs-fixer fix ${srcdir}/module --fixers=${php-cs-fixers} --dry-run --verbose --diff" passthru="true" escape="false" checkreturn="true" />
<exec command="${srcdir}/vendor/bin/php-cs-fixer fix ${srcdir}/module --fixers=${php-cs-fixers} --dry-run --verbose --diff" passthru="true" escape="false" checkreturn="true" />
</target>

<!-- PHP API Documentation -->
Expand All @@ -112,18 +116,18 @@

<!-- PHPUnit -->
<target name="phpunit" description="Run tests">
<exec dir="${srcdir}/module/VuFind/tests" command="NODE_PATH=${nodepath} VUFIND_MINK_DRIVER=${mink_driver} VUFIND_SNOOZE_MULTIPLIER=${snooze_multiplier} VUFIND_LOCAL_DIR=${srcdir}/local VUFIND_URL=${vufindurl} phpunit -dzend.enable_gc=0 --log-junit ${builddir}/reports/phpunit.xml --coverage-clover ${builddir}/reports/coverage/clover.xml --coverage-html ${builddir}/reports/coverage/ ${phpunit_extra_params}" passthru="true" checkreturn="true" />
<exec dir="${srcdir}/module/VuFind/tests" command="NODE_PATH=${nodepath} VUFIND_MINK_DRIVER=${mink_driver} VUFIND_SNOOZE_MULTIPLIER=${snooze_multiplier} VUFIND_LOCAL_DIR=${srcdir}/local VUFIND_URL=${vufindurl} ${srcdir}/vendor/bin/phpunit -dzend.enable_gc=0 --log-junit ${builddir}/reports/phpunit.xml --coverage-clover ${builddir}/reports/coverage/clover.xml --coverage-html ${builddir}/reports/coverage/ ${phpunit_extra_params}" passthru="true" checkreturn="true" />
</target>

<!-- PHPUnit without logging output -->
<target name="phpunitfast" description="Run tests">
<exec dir="${srcdir}/module/VuFind/tests" command="NODE_PATH=${nodepath} VUFIND_MINK_DRIVER=${mink_driver} VUFIND_SNOOZE_MULTIPLIER=${snooze_multiplier} VUFIND_LOCAL_DIR=${srcdir}/local VUFIND_URL=${vufindurl} phpunit -dzend.enable_gc=0 ${phpunit_extra_params}" passthru="true" checkreturn="true" />
<exec dir="${srcdir}/module/VuFind/tests" command="NODE_PATH=${nodepath} VUFIND_MINK_DRIVER=${mink_driver} VUFIND_SNOOZE_MULTIPLIER=${snooze_multiplier} VUFIND_LOCAL_DIR=${srcdir}/local VUFIND_URL=${vufindurl} ${srcdir}/vendor/bin/phpunit -dzend.enable_gc=0 ${phpunit_extra_params}" passthru="true" checkreturn="true" />
</target>

<target name="composer" description="Install dependencies with Composer">
<httpget url="https://getcomposer.org/composer.phar" sslVerifyPeer="false" dir="${srcdir}" />
<echo message="Installing dependencies..." />
<exec command="php ${srcdir}/composer.phar install" passthru="true" checkreturn="true" />
<exec command="php ${srcdir}/composer.phar install ${composer_extra_params}" passthru="true" checkreturn="true" />
</target>

<target name="composer" description="Install dependencies with Composer">
Expand Down Expand Up @@ -278,7 +282,9 @@
<mkdir dir="${builddir}/export/vufind/usr/local/vufind" />

<!-- load the relevant files into the work area -->
<phingcall target="composer" />
<phingcall target="composer">
<property name="composer_extra_params" value="--no-dev" />
</phingcall>
<exec command="git archive HEAD --format=tar | tar -x -C ${builddir}/export/vufind/usr/local/vufind" />
<copy todir = "${builddir}/export/vufind/usr/local/vufind/vendor">
<fileset dir="${srcdir}/vendor" defaultexcludes="false" />
Expand Down
94 changes: 47 additions & 47 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
{
"name": "vufind/vufind",
"description": "A flexible discovery layer.",
"authors": [
{
"name": "Demian Katz",
"email": "demian.katz@villanova.edu"
}
],
"license": "GPL-2.0",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/zendframework/zendservice_amazon"
}
],
"require": {
"aferrandini/phpqrcode": "1.0.1",
"jasig/phpcas": "1.3.3",
"cap60552/php-sip2": "1.0.0",
"los/losrecaptcha": "1.0.0",
"ahand/mobileesp": "dev-master",
"ocramius/proxy-manager": "1.0.2",
"oyejorge/less.php": "1.7.0.9",
"pear/file_marc": "1.1.2",
"pear/validate_ispn": "dev-master",
"serialssolutions/summon": "1.0.0",
"symfony/yaml": "2.7.6",
"vufind-org/vufindcode": "1.0.3",
"vufind-org/vufindharvest": "2.1.0",
"vufind-org/vufindhttp": "2.1.0",
"zendframework/zendframework": "2.4.6",
"zendframework/zendrest": "2.0.2",
"zendframework/zendservice-amazon": "2.0.4",
"zf-commons/zfc-rbac": "2.5.2"
},
"require-dev": {
"behat/mink": "1.7.0",
"behat/mink-selenium2-driver": "1.3.0",
"friendsofphp/php-cs-fixer": "1.11.5",
"phploc/phploc": "2.0.6",
"phpmd/phpmd": "1.5.0",
"phpunit/phpunit": "4.8.4",
"sebastian/phpcpd": "2.0.0",
"squizlabs/php_codesniffer": "2.6.0"
}
}
{
"name": "vufind/vufind",
"description": "A flexible discovery layer.",
"authors": [
{
"name": "Demian Katz",
"email": "demian.katz@villanova.edu"
}
],
"license": "GPL-2.0",
"repositories": [
{
"type": "composer",
"url": "https://packages.zendframework.com/"
}
],
"require": {
"aferrandini/phpqrcode": "1.0.1",
"jasig/phpcas": "1.3.3",
"cap60552/php-sip2": "1.0.0",
"los/losrecaptcha": "1.0.0",
"ahand/mobileesp": "dev-master",
"ocramius/proxy-manager": "1.0.2",
"oyejorge/less.php": "1.7.0.9",
"pear/file_marc": "1.1.2",
"pear/validate_ispn": "dev-master",
"serialssolutions/summon": "1.0.0",
"symfony/yaml": "2.7.6",
"vufind-org/vufindcode": "1.0.2",
"vufind-org/vufindhttp": "2.0.0",
"zendframework/zendframework": "2.4.6",
"zendframework/zendrest": "2.0.2",
"zendframework/zendservice-amazon": "2.0.4",
"zf-commons/zfc-rbac": "2.5.2"
},
"require-dev": {
"behat/mink": "1.7.0",
"behat/mink-selenium2-driver": "1.3.0",
"behat/mink-zombie-driver": "1.3.0",
"fabpot/php-cs-fixer": "1.11.2",
"phploc/phploc": "2.0.6",
"phpmd/phpmd": "1.5.0",
"phpunit/phpunit": "4.8.4",
"sebastian/phpcpd": "1.4.3",
"squizlabs/php_codesniffer": "2.6.0"
}
}
62 changes: 31 additions & 31 deletions config/vufind/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ showBulkOptions = false
; Should users be allowed to save searches in their accounts?
allowSavedSearches = true
; Generator value to display in an HTML header <meta> tag:
generator = "VuFind 3.0.1"
generator = "VuFind 3.0.3"

; This section allows you to configure the mechanism used for storing user
; sessions. Available types: File, Memcache, Database.
Expand Down Expand Up @@ -674,7 +674,36 @@ authors = Wikipedia

; You can select from Google, OpenLibrary, HathiTrust. You should consult
; http://code.google.com/apis/books/branding.html before using Google Book Search.
; previews = Google,OpenLibrary,HathiTrust
;previews = Google,OpenLibrary,HathiTrust

; Possible HathiRights options = pd,ic,op,orph,und,umall,ic-world,nobody,pdus,cc-by,cc-by-nd,
; cc-by-nc-nd,cc-by-nc,cc-by-nc-sa,cc-by-sa,orphcand,cc-zero,und-world,icus
; Default is "pd,ic-world" if unset here.
; See www.hathitrust.org/rights_database#Attributes for full details
;HathiRights = pd,ic-world,cc-by,cc-by-nd,cc-by-nc-nd,cc-by-nc,cc-by-nc-sa,cc-by-sa,cc-zero,und-world

; Possible GoogleBooks options full,partial,noview
; options can be set for each / either of link or tab
; Link makes a button appear in search results / record view
; Tab makes a tab with an embedded preview appear on record view
; Default is "GoogleOptions['link'] = full,partial" if nothing
; is set here.
; see https://developers.google.com/books/docs/dynamic-links#json-results-format
;GoogleOptions['link'] = full,partial
;GoogleOptions['tab'] = partial

; OpenLibrary currently offers the same options/default as GoogleBooks (above):
;OpenLibraryOptions = full,partial

; An API key is needed to interact with the Europeana API (see the EuropeanaResults
; recommendation module in searches.ini for more information)
;europeanaAPI = INSERTKEY

; If this is set, a new map tab will show on the record page for records which
; have long_lat data (see import/marc_local.properties for more information).
; The setting specifies the type of map; currently, the only supported value is
; "google"
;recordMap = google

; This section controls the behavior of the cover generator when makeDynamicCovers
; above is non-false.
Expand Down Expand Up @@ -754,35 +783,6 @@ authors = Wikipedia
url = "https://api.vlb.de/api/v1/cover/"
; token = "XXXXXX-XXXX-XXXXX-XXXXXXXXXXXX"

; Possible HathiRights options = pd,ic,op,orph,und,umall,ic-world,nobody,pdus,cc-by,cc-by-nd,
; cc-by-nc-nd,cc-by-nc,cc-by-nc-sa,cc-by-sa,orphcand,cc-zero,und-world,icus
; Default is "pd,ic-world" if unset here.
; See www.hathitrust.org/rights_database#Attributes for full details
;HathiRights = pd,ic-world,cc-by,cc-by-nd,cc-by-nc-nd,cc-by-nc,cc-by-nc-sa,cc-by-sa,cc-zero,und-world

; Possible GoogleBooks options full,partial,noview
; options can be set for each / either of link or tab
; Link makes a button appear in search results / record view
; Tab makes a tab with an embedded preview appear on record view
; Default is "GoogleOptions['link'] = full,partial" if nothing
; is set here.
; see https://developers.google.com/books/docs/dynamic-links#json-results-format
;GoogleOptions['link'] = full,partial
;GoogleOptions['tab'] = partial

; OpenLibrary currently offers the same options/default as GoogleBooks (above):
;OpenLibraryOptions = full,partial

; An API key is needed to interact with the Europeana API (see the EuropeanaResults
; recommendation module in searches.ini for more information)
;europeanaAPI = INSERTKEY

; If this is set, a new map tab will show on the record page for records which
; have long_lat data (see import/marc_local.properties for more information).
; The setting specifies the type of map; currently, the only supported value is
; "google"
;recordMap = google

[QRCode]
; This setting controls the image to display when no qrcode is available.
; The path is relative to the base of your theme directory.
Expand Down
6 changes: 3 additions & 3 deletions import/index_scripts/author.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,9 @@ public String processInitials(String authorName) {
if (name.length() > 0) {
String initial = name.substring(0,1);
// if there is a hyphenated name, use both initials
if (name.indexOf('-') > 0) {
int pos = name.indexOf('-');
String extra = name.substring(pos+1,pos+2);
int pos = name.indexOf('-');
if (pos > 0 && pos < name.length() - 1) {
String extra = name.substring(pos+1, pos+2);
initial = initial + " " + extra;
}
result += " " + initial;
Expand Down
2 changes: 1 addition & 1 deletion local/config/vufind/Summon.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ snippets = true
; When you filter a search using facets, VuFind will present a checkbox that can
; be used to apply those filters to the next search you perform. This setting
; controls its default state: on (true) or off (false).
retain_filters_by_default = false
retain_filters_by_default = true

; Summon has a fixed cap on how many results you can page through. Even though
; it may report more results than this number, you can't actually access results
Expand Down
2 changes: 1 addition & 1 deletion local/config/vufind/searches.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ override_full_sections = Sorting,RSS,Basic_Searches,Advanced_Searches,Autocomple
limit_options = 5,10,20,40,60,80,100
default_limit = 20
multiValuedFRBRField = false
retain_filters_by_default = false
retain_filters_by_default = true
result_limit = 20000

[Sorting]
Expand Down
2 changes: 1 addition & 1 deletion local/config/vufind/searches_jusbib.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default_sort = publishDateSort desc
limit_options = 5,10,20,40,60,80,100
default_limit = 20
multiValuedFRBRField = false
retain_filters_by_default = false
retain_filters_by_default = true

[Sorting]
relevance = sort.relevance
Expand Down
Loading

0 comments on commit f6ce09b

Please sign in to comment.