Skip to content
Snippets Groups Projects
Commit 45f3c498 authored by Demian Katz's avatar Demian Katz
Browse files

Apply php-cs-fixer to config and public directories.

parent da8a8c74
No related merge requests found
<?php <?php
// Set up modules: // Set up modules:
$modules = array( $modules = [
'ZfcRbac', 'VuFindTheme', 'VuFindSearch', 'VuFind', 'VuFindAdmin', 'VuFindApi' 'ZfcRbac', 'VuFindTheme', 'VuFindSearch', 'VuFind', 'VuFindAdmin', 'VuFindApi'
); ];
if (PHP_SAPI == 'cli' && !defined('VUFIND_PHPUNIT_RUNNING')) { if (PHP_SAPI == 'cli' && !defined('VUFIND_PHPUNIT_RUNNING')) {
$modules[] = 'VuFindConsole'; $modules[] = 'VuFindConsole';
} }
...@@ -53,24 +53,24 @@ if (!is_dir($cacheDir)) { ...@@ -53,24 +53,24 @@ if (!is_dir($cacheDir)) {
$useCache = APPLICATION_ENV != 'development' && !defined('VUFIND_PHPUNIT_RUNNING'); $useCache = APPLICATION_ENV != 'development' && !defined('VUFIND_PHPUNIT_RUNNING');
// Build configuration: // Build configuration:
return array( return [
'modules' => array_unique($modules), 'modules' => array_unique($modules),
'module_listener_options' => array( 'module_listener_options' => [
'config_glob_paths' => array( 'config_glob_paths' => [
'config/autoload/{,*.}{global,local}.php', 'config/autoload/{,*.}{global,local}.php',
), ],
'config_cache_enabled' => $useCache, 'config_cache_enabled' => $useCache,
'module_map_cache_enabled' => $useCache, 'module_map_cache_enabled' => $useCache,
'check_dependencies' => (APPLICATION_ENV == 'development'), 'check_dependencies' => (APPLICATION_ENV == 'development'),
'cache_dir' => $cacheDir, 'cache_dir' => $cacheDir,
'module_paths' => array( 'module_paths' => [
'./module', './module',
'./vendor', './vendor',
), ],
), ],
'service_manager' => array( 'service_manager' => [
'use_defaults' => true, 'use_defaults' => true,
'factories' => array( 'factories' => [
), ],
), ],
); ];
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
/** /**
* Global Configuration Override * Global Configuration Override
* *
* You can use this file for overridding configuration values from modules, etc. * You can use this file for overridding configuration values from modules, etc.
* You would place values in here that are agnostic to the environment and not * You would place values in here that are agnostic to the environment and not
* sensitive to security. * sensitive to security.
* *
* @NOTE: In practice, this file will typically be INCLUDED in your source * @NOTE: In practice, this file will typically be INCLUDED in your source
* control, so do not include passwords or other sensitive information in this * control, so do not include passwords or other sensitive information in this
* file. * file.
*/ */
return array( return [
// ... // ...
); ];
<?php <?php
use Zend\Loader\AutoloaderFactory; use Zend\Loader\AutoloaderFactory;
use Zend\ServiceManager\ServiceManager;
use Zend\Mvc\Service\ServiceManagerConfig;
// If the XHProf profiler is enabled, set it up now: // If the XHProf profiler is enabled, set it up now:
$xhprof = getenv('VUFIND_PROFILER_XHPROF'); $xhprof = getenv('VUFIND_PROFILER_XHPROF');
if (!empty($xhprof)) { if (!empty($xhprof)) {
if (extension_loaded('xhprof')) { if (extension_loaded('xhprof')) {
xhprof_enable(); xhprof_enable();
} else if (extension_loaded('tideways')) { } elseif (extension_loaded('tideways')) {
tideways_enable(); tideways_enable();
} else { } else {
$xhprof = false; $xhprof = false;
...@@ -57,7 +55,7 @@ chdir(APPLICATION_PATH); ...@@ -57,7 +55,7 @@ chdir(APPLICATION_PATH);
// Ensure vendor/ is on include_path; some PEAR components may not load correctly // Ensure vendor/ is on include_path; some PEAR components may not load correctly
// otherwise (i.e. File_MARC may cause a "Cannot redeclare class" error by pulling // otherwise (i.e. File_MARC may cause a "Cannot redeclare class" error by pulling
// from the shared PEAR directory instead of the local copy): // from the shared PEAR directory instead of the local copy):
$pathParts = array(); $pathParts = [];
$pathParts[] = APPLICATION_PATH . '/vendor'; $pathParts[] = APPLICATION_PATH . '/vendor';
$pathParts[] = get_include_path(); $pathParts[] = get_include_path();
set_include_path(implode(PATH_SEPARATOR, $pathParts)); set_include_path(implode(PATH_SEPARATOR, $pathParts));
......
<?php <?php
$finder = PhpCsFixer\Finder::create()->in(__DIR__ . '/../module'); $finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/../config')
->in(__DIR__ . '/../module')
->in(__DIR__ . '/../public');
$rules = [ $rules = [
'align_multiline_comment' => true, 'align_multiline_comment' => true,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment