From c72981571d79ad184e25ae9ea9524d219ac5546e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Mo=CC=88ller?= Date: Mon, 19 Oct 2015 22:55:51 +0200 Subject: [PATCH 1/3] Fix: Merge global configuration files --- config/autoload/global.php | 16 ++ config/autoload/htmlpurifier.global.php | 6 - config/autoload/scn-social-auth.global.php | 33 ---- config/autoload/zfcuser.global.php | 195 --------------------- 4 files changed, 16 insertions(+), 234 deletions(-) delete mode 100644 config/autoload/htmlpurifier.global.php delete mode 100644 config/autoload/scn-social-auth.global.php delete mode 100644 config/autoload/zfcuser.global.php diff --git a/config/autoload/global.php b/config/autoload/global.php index 8bc724c1..45d24b0e 100644 --- a/config/autoload/global.php +++ b/config/autoload/global.php @@ -1,6 +1,11 @@ [ + 'aliases' => [ + 'ScnSocialAuth_ZendDbAdapter' => 'Zend\Db\Adapter\Adapter', + 'ScnSocialAuth_ZendSessionManager' => 'Zend\Session\SessionManager', + 'zfcuser_zend_db_adapter' => 'Zend\Db\Adapter\Adapter', + ], 'factories' => [ 'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory', ], @@ -35,4 +40,15 @@ ], ], ], + 'htmlpurifier' => [ + 'Cache.SerializerPath' => realpath('./data/cache'), + ], + 'scn-social-auth' => [ + 'github_enabled' => true, + 'github_scope' => 'user:email,read:org', + ], + 'zfcuser' => [ + 'user_entity_class' => 'User\Entity\User', + 'logout_redirect_route' => 'home', + ], ]; diff --git a/config/autoload/htmlpurifier.global.php b/config/autoload/htmlpurifier.global.php deleted file mode 100644 index e18301fd..00000000 --- a/config/autoload/htmlpurifier.global.php +++ /dev/null @@ -1,6 +0,0 @@ - [ - 'Cache.SerializerPath' => realpath('./data/cache'), - ], -]; diff --git a/config/autoload/scn-social-auth.global.php b/config/autoload/scn-social-auth.global.php deleted file mode 100644 index 01723db1..00000000 --- a/config/autoload/scn-social-auth.global.php +++ /dev/null @@ -1,33 +0,0 @@ - true, - 'github_scope' => 'user:email,read:org', - -]; - -/** - * You do not need to edit below this line - */ -return [ - 'scn-social-auth' => $settings, - 'service_manager' => [ - 'aliases' => [ - 'ScnSocialAuth_ZendDbAdapter' => (isset($settings['zend_db_adapter'])) ? $settings['zend_db_adapter'] : 'Zend\Db\Adapter\Adapter', - 'ScnSocialAuth_ZendSessionManager' => (isset($settings['zend_session_manager'])) ? $settings['zend_session_manager'] : 'Zend\Session\SessionManager', - ], - ], -]; diff --git a/config/autoload/zfcuser.global.php b/config/autoload/zfcuser.global.php deleted file mode 100644 index ea40f743..00000000 --- a/config/autoload/zfcuser.global.php +++ /dev/null @@ -1,195 +0,0 @@ - 'Zend\Db\Adapter\Adapter', - - /** - * User Model Entity Class - * - * Name of Entity class to use. Useful for using your own entity class - * instead of the default one provided. Default is ZfcUser\Entity\User. - */ - 'user_entity_class' => 'User\Entity\User', - - /** - * Enable registration - * - * Allows users to register through the website. - * - * Accepted values: boolean true or false - */ - //'enable_registration' => true, - - /** - * Enable Username - * - * Enables username field on the registration form, and allows users to log - * in using their username OR email address. Default is false. - * - * Accepted values: boolean true or false - */ - //'enable_username' => false, - - /** - * Enable Display Name - * - * Enables a display name field on the registration form, which is persisted - * in the database. Default value is false. - * - * Accepted values: boolean true or false - */ - //'enable_display_name' => true, - - /** - * Modes for authentication identity match - * - * Specify the allowable identity modes, in the order they should be - * checked by the Authentication plugin. - * - * Default value: array containing 'email' - * Accepted values: array containing one or more of: email, username - */ - //'auth_identity_fields' => array( 'email' ), - - /** - * Login form timeout - * - * Specify the timeout for the CSRF security field of the login form - * in seconds. Default value is 300 seconds. - * - * Accepted values: positive int value - */ - //'login_form_timeout' => 300, - - /** - * Registration form timeout - * - * Specify the timeout for the CSRF security field of the registration form - * in seconds. Default value is 300 seconds. - * - * Accepted values: positive int value - */ - //'user_form_timeout' => 300, - - /** - * Login After Registration - * - * Automatically logs the user in after they successfully register. Default - * value is false. - * - * Accepted values: boolean true or false - */ - //'login_after_registration' => true, - - /** - * Registration Form Captcha - * - * Determines if a captcha should be utilized on the user registration form. - * Default value is false. - */ - //'use_registration_form_captcha' => false, - - /** - * Form Captcha Options - * - * Currently used for the registration form, but re-usable anywhere. Use - * this to configure which Zend\Captcha adapter to use, and the options to - * pass to it. The default uses the Figlet captcha. - */ - /*'form_captcha_options' => array( - 'class' => 'figlet', - 'options' => array( - 'wordLen' => 5, - 'expiration' => 300, - 'timeout' => 300, - ), - ),*/ - - /** - * Use Redirect Parameter If Present - * - * Upon successful authentication, check for a 'redirect' POST parameter - * - * Accepted values: boolean true or false - */ - //'use_redirect_parameter_if_present' => true, - - /** - * Sets the view template for the user login widget - * - * Default value: 'zfc-user/user/login.phtml' - * Accepted values: string path to a view script - */ - //'user_login_widget_view_template' => 'zfc-user/user/login.phtml', - - /** - * Login Redirect Route - * - * Upon successful login the user will be redirected to the entered route - * - * Default value: 'zfcuser' - * Accepted values: A valid route name within your application - * - */ - //'login_redirect_route' => 'zfcuser', - - /** - * Logout Redirect Route - * - * Upon logging out the user will be redirected to the enterd route - * - * Default value: 'zfcuser/login' - * Accepted values: A valid route name within your application - */ - 'logout_redirect_route' => 'home', - - /** - * Password Security - * - * DO NOT CHANGE THE PASSWORD HASH SETTINGS FROM THEIR DEFAULTS - * Unless A) you have done sufficient research and fully understand exactly - * what you are changing, AND B) you have a very specific reason to deviate - * from the default settings and know what you're doing. - * - * The password hash settings may be changed at any time without - * invalidating existing user accounts. Existing user passwords will be - * re-hashed automatically on their next successful login. - */ - - /** - * Password Cost - * - * The number represents the base-2 logarithm of the iteration count used for - * hashing. Default is 14 (about 10 hashes per second on an i5). - * - * Accepted values: integer between 4 and 31 - */ - //'password_cost' => 14, - - /** - * End of ZfcUser configuration - */ -]; - -/** - * You do not need to edit below this line - */ -return [ - 'zfcuser' => $settings, - 'service_manager' => [ - 'aliases' => [ - 'zfcuser_zend_db_adapter' => (isset($settings['zend_db_adapter'])) ? $settings['zend_db_adapter'] : 'Zend\Db\Adapter\Adapter', - ], - ], -]; From 06b0a1f1c63f57c7e1deed22321a27cf7fae0c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Mo=CC=88ller?= Date: Mon, 19 Oct 2015 22:58:29 +0200 Subject: [PATCH 2/3] Fix: Keep main keys sorted alphabetically --- config/autoload/global.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/config/autoload/global.php b/config/autoload/global.php index 45d24b0e..e20f8fe7 100644 --- a/config/autoload/global.php +++ b/config/autoload/global.php @@ -1,18 +1,5 @@ [ - 'aliases' => [ - 'ScnSocialAuth_ZendDbAdapter' => 'Zend\Db\Adapter\Adapter', - 'ScnSocialAuth_ZendSessionManager' => 'Zend\Session\SessionManager', - 'zfcuser_zend_db_adapter' => 'Zend\Db\Adapter\Adapter', - ], - 'factories' => [ - 'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory', - ], - 'invokables' => [ - 'Zend\Session\SessionManager' => 'Zend\Session\SessionManager', - ], - ], 'db' => [ 'driver' => 'pdo', 'dsn' => 'mysql:dbname=modules;host=localhost', @@ -47,6 +34,19 @@ 'github_enabled' => true, 'github_scope' => 'user:email,read:org', ], + 'service_manager' => [ + 'aliases' => [ + 'ScnSocialAuth_ZendDbAdapter' => 'Zend\Db\Adapter\Adapter', + 'ScnSocialAuth_ZendSessionManager' => 'Zend\Session\SessionManager', + 'zfcuser_zend_db_adapter' => 'Zend\Db\Adapter\Adapter', + ], + 'factories' => [ + 'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory', + ], + 'invokables' => [ + 'Zend\Session\SessionManager' => 'Zend\Session\SessionManager', + ], + ], 'zfcuser' => [ 'user_entity_class' => 'User\Entity\User', 'logout_redirect_route' => 'home', From 5f75f1f0ddffed09f5298395fcfa884352b8020a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Mo=CC=88ller?= Date: Mon, 19 Oct 2015 23:00:48 +0200 Subject: [PATCH 3/3] Fix: Make use of the class keyword --- config/autoload/global.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/config/autoload/global.php b/config/autoload/global.php index e20f8fe7..3a593c9b 100644 --- a/config/autoload/global.php +++ b/config/autoload/global.php @@ -1,4 +1,9 @@ [ 'driver' => 'pdo', @@ -36,19 +41,19 @@ ], 'service_manager' => [ 'aliases' => [ - 'ScnSocialAuth_ZendDbAdapter' => 'Zend\Db\Adapter\Adapter', - 'ScnSocialAuth_ZendSessionManager' => 'Zend\Session\SessionManager', - 'zfcuser_zend_db_adapter' => 'Zend\Db\Adapter\Adapter', + 'ScnSocialAuth_ZendDbAdapter' => Db\Adapter\Adapter::class, + 'ScnSocialAuth_ZendSessionManager' => Session\SessionManager::class, + 'zfcuser_zend_db_adapter' => Db\Adapter\Adapter::class, ], 'factories' => [ - 'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory', + Db\Adapter\Adapter::class => Db\Adapter\AdapterServiceFactory::class, ], 'invokables' => [ - 'Zend\Session\SessionManager' => 'Zend\Session\SessionManager', + Session\SessionManager::class => Session\SessionManager::class, ], ], 'zfcuser' => [ - 'user_entity_class' => 'User\Entity\User', + 'user_entity_class' => Entity\User::class, 'logout_redirect_route' => 'home', ], ];