diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:54:15 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:54:15 +0100 |
| commit | eddcb429ad24572676fce289fcae645178a185ba (patch) | |
| tree | de370ace1f2ad37cde7bd14f5180f942fed16ccf /includes | |
| parent | 70d2c5630264b09b8c5df8324b1895365ed74628 (diff) | |
| download | install-eddcb429ad24572676fce289fcae645178a185ba.tar.gz install-eddcb429ad24572676fce289fcae645178a185ba.tar.bz2 install-eddcb429ad24572676fce289fcae645178a185ba.zip | |
php-cs-fixer tidies to php8.5 standards
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'includes')
| -rwxr-xr-x | includes/classes/BitInstaller.php | 16 | ||||
| -rwxr-xr-x | includes/get_databases_inc.php | 4 | ||||
| -rwxr-xr-x | includes/install_bit_settings.php | 2 | ||||
| -rwxr-xr-x | includes/install_checks.php | 1 | ||||
| -rwxr-xr-x | includes/install_cleanup.php | 10 | ||||
| -rwxr-xr-x | includes/install_database.php | 12 | ||||
| -rwxr-xr-x | includes/install_database_reset.php | 2 | ||||
| -rwxr-xr-x | includes/install_inc.php | 6 | ||||
| -rwxr-xr-x | includes/install_options.php | 4 | ||||
| -rwxr-xr-x | includes/install_packages.php | 5 | ||||
| -rwxr-xr-x | includes/install_version.php | 2 |
11 files changed, 24 insertions, 40 deletions
diff --git a/includes/classes/BitInstaller.php b/includes/classes/BitInstaller.php index d183aaa..9574956 100755 --- a/includes/classes/BitInstaller.php +++ b/includes/classes/BitInstaller.php @@ -66,7 +66,7 @@ class BitInstaller extends BitSystem { $loginCol = strpos( $pLogin, '@' ) ? 'email' : 'login'; if( $gBitUser->validate( $pLogin, $pPassword, $pChallenge, $pResponse ) ) { - $userInfo = $gBitUser->getUserInfo( array( $loginCol => $pLogin ) ); + $userInfo = $gBitUser->getUserInfo( [ $loginCol => $pLogin ] ); if( $userInfo['user_id'] != ANONYMOUS_USER_ID ) { // User is valid and not due to change pass.. @@ -119,7 +119,7 @@ class BitInstaller extends BitSystem { * @access public * @return void */ - public function registerPackageUpgrade( $pParams, $pUpgradeHash = array() ) { + public function registerPackageUpgrade( $pParams, $pUpgradeHash = [] ) { if( $this->verifyPackageUpgrade( $pParams )) { $this->registerPackageVersion( $pParams['package'], $pParams['version'] ); $this->mPackageUpgrades[$pParams['package']][$pParams['version']] = $pParams; @@ -319,11 +319,11 @@ class BitInstaller extends BitSystem { $errors[$version] = $this->applyUpgrade( $pPackage, $this->mPackageUpgrades[$pPackage][$version]['upgrade'] ); if( !empty( $errors[$version] )) { return $errors; - } else { + } // if the upgrade ended without incidence, we store the package version. // this way any successfully applied upgrade can only be applied once. $this->storeVersion( $pPackage, $version ); - } + } } @@ -385,8 +385,8 @@ class BitInstaller extends BitSystem { $completeTableName = $tablePrefix.$tableName; $this->mDb->convertQuery( $completeTableName ); foreach( $alter[$tableName] as $from => $flds ) { - $sql = ( is_string( $flds ) ) - ? $dict->ChangeTableSQL( $completeTableName, $flds ) + $sql = ( is_string( $flds ) ) + ? $dict->ChangeTableSQL( $completeTableName, $flds ) : $dict->ChangeTableSQL( $completeTableName, [ $flds ] ); if( $sql ) { @@ -702,7 +702,7 @@ function upgrade_query_sort( $a, $b ) { return 1; } elseif( $b == 'SQL92' ) { return -1; - } else { - return 0; } + return 0; + } diff --git a/includes/get_databases_inc.php b/includes/get_databases_inc.php index ffc8bc7..51eb6ed 100755 --- a/includes/get_databases_inc.php +++ b/includes/get_databases_inc.php @@ -44,7 +44,7 @@ if( function_exists( 'fbird_connect' ) ) { $gBitDbUser = 'SYSDBA'; $gBitDbPassword = 'masterkey'; } -} +} if( extension_loaded( 'pdo_firebird' ) ) { $dbtodsn['pdo'] = 'PDO Firebird'; if ( !empty($_REQUEST['fbpath']) ) $fbpath = $_REQUEST['fbpath']; @@ -58,7 +58,7 @@ if( extension_loaded( 'pdo_firebird' ) ) { $gBitDbUser = 'SYSDBA'; $gBitDbPassword = 'masterkey'; } -} +} if( function_exists( 'sqlite_open' ) ) { $dbtodsn['sqlite'] = 'SQLLite'; } diff --git a/includes/install_bit_settings.php b/includes/install_bit_settings.php index 67feb9d..8856c0d 100755 --- a/includes/install_bit_settings.php +++ b/includes/install_bit_settings.php @@ -11,7 +11,7 @@ /** * assign next step in installation process - */ + */ $gBitSmarty->assign( 'next_step',$step ); /** diff --git a/includes/install_checks.php b/includes/install_checks.php index 55e1348..6175f19 100755 --- a/includes/install_checks.php +++ b/includes/install_checks.php @@ -195,7 +195,6 @@ function check_settings() { } } - // PEAR checks $pears = [ 'PEAR' => [ diff --git a/includes/install_cleanup.php b/includes/install_cleanup.php index f45a9ef..660e752 100755 --- a/includes/install_cleanup.php +++ b/includes/install_cleanup.php @@ -12,18 +12,14 @@ $schema = $gBitInstaller->mPackages; ksort( $schema ); $gBitSmarty->assign( 'schema', $schema ); - - // ===================== Post install table check ===================== // $dbTables is the output of BitSystem::verifyInstalledPackages() in // install_inc.php and contains all tables that are not present in the database // - even tables of packages that are not installed $dbIntegrity = install_check_database_integrity( $dbTables ); - - // ===================== Permissions ===================== -// check all permissions, compare them to each other and see if there are old +// check all permissions, compare them to each other and see if there are old // permissions and ones that need to be inserted $query = "SELECT * FROM `".BIT_DB_PREFIX."users_permissions` ORDER BY `package` ASC"; $result = $gBitInstaller->mDb->query( $query ); @@ -106,7 +102,7 @@ if (!empty( $_REQUEST['create_tables'] ) && !empty( $dbIntegrity )) { } // If we use MySql check which storage engine to use - $build = isset( $_SESSION['use_innodb'] ) + $build = isset( $_SESSION['use_innodb'] ) ? ( ( $_SESSION['use_innodb'] == true ) ? [ 'NEW', 'MYSQL' => 'ENGINE=INNODB' ] : [ 'NEW', 'MYSQL' => 'ENGINE=MYISAM' ] ) : 'NEW'; $tablePrefix = $gBitInstaller->getTablePrefix(); @@ -189,8 +185,6 @@ $gBitSmarty->assign( 'dbIntegrity', $dbIntegrity ); // $gBitSmarty->assign( 'serviceList', $serviceList ); - - /** * function - install_check_database_integrity */ diff --git a/includes/install_database.php b/includes/install_database.php index 07d24e2..28478ca 100755 --- a/includes/install_database.php +++ b/includes/install_database.php @@ -18,17 +18,17 @@ if( isset( $_REQUEST['submit_db_info'] )) { // avoid database change messages ini_set( 'sybct.min_server_severity', '11' ); } - + // for Oracle force database name to use one from tnsnames // this way we avoid further StartTrans errors that was often reported, if( $gBitDbType == 'oci8po' && empty( $gBitDbName ) ) { $gBitSmarty->assign( 'error', TRUE ); $gBitSmarty->assign( 'errorMsg', "Please fill Database Name field. If you don't know it and you're using Express Edition it's probably 'XE'. Otherwise check your \"tnsnames.ora\" file to get appropriate one." ); - $error = TRUE; + $error = TRUE; } else { - + $gBitDb = ADONewConnection( $gBitDbType ); - + if( $gBitDb->Connect( $gBitDbHost, $gBitDbUser, $gBitDbPassword, $gBitDbType != 'pdo' ? $gBitDbName : NULL )) { // display success page when done $app = '_done'; @@ -44,7 +44,7 @@ if( isset( $_REQUEST['submit_db_info'] )) { } else { $_SESSION['first_install'] = FALSE; } - + if( $_SESSION['first_install'] == TRUE ) { // For MySql only, on first install check if server support // InnoDB and set a smarty var for template to offer using @@ -62,7 +62,7 @@ if( isset( $_REQUEST['submit_db_info'] )) { break 2; } } - + $rs->MoveNext(); } $rs->Close(); diff --git a/includes/install_database_reset.php b/includes/install_database_reset.php index 7a3f234..a219c3c 100755 --- a/includes/install_database_reset.php +++ b/includes/install_database_reset.php @@ -17,7 +17,7 @@ if( isset( $_REQUEST['continue_install'] ) ) { } elseif( isset( $_REQUEST['reset_config_inc'] ) ) { $fw = fopen($config_file, 'w' ); if( isset( $fw ) ) { - fwrite( $fw, ''); + fwrite( $fw, ''); fclose( $fw ); } header( 'Location: '.INSTALL_PKG_URL.'install.php' ); diff --git a/includes/install_inc.php b/includes/install_inc.php index 04e3dfa..a39e410 100755 --- a/includes/install_inc.php +++ b/includes/install_inc.php @@ -1,9 +1,5 @@ <?php -use Bitweaver\BitSystem; -use Bitweaver\Plugins\ResourceBitpackage; -use Bitweaver\Themes\BitSmarty; -use Bitweaver\Themes\BitweaverExtension; /** * @version $Header$ * @package install @@ -153,7 +149,7 @@ $bit_root_url = empty( $_REQUEST['baseurl'] ) global $gBitUser; if( !empty( $_POST['signin'] ) ) { - $gBitInstaller->login( $_REQUEST['user'], $_REQUEST['pass'] ); + $gBitInstaller->login( $_REQUEST['user'], $_REQUEST['pass'] ); } elseif( is_object( $gBitUser ) && !empty( $_COOKIE[$gBitUser->getSiteCookieName()] ) && ( $gBitUser->mUserId = $gBitUser->getUserIdFromCookie( $_COOKIE[$gBitUser->getSiteCookieName()] ))) { $userInfo = $gBitUser->getUserInfo( [ 'user_id' => $gBitUser->mUserId ] ); diff --git a/includes/install_options.php b/includes/install_options.php index f4a93d1..7306ea8 100755 --- a/includes/install_options.php +++ b/includes/install_options.php @@ -31,6 +31,6 @@ if( isset( $_REQUEST['upgrade'] ) ) { // Added check for IIS $_SERVER['HTTPS'] uses 'off' value - wolff_borg header( 'Location: http'.((!empty($_SERVER['HTTPS'])&&$_SERVER['HTTPS'] != 'off')?'s':'').'://'.$_SERVER['HTTP_HOST'].INSTALL_PKG_URL.'install.php?step='.( $step + 1 ) ); die; -} else { - $gBitSmarty->assign( 'next_step',$step ); } + $gBitSmarty->assign( 'next_step',$step ); + diff --git a/includes/install_packages.php b/includes/install_packages.php index 05bd353..6979b1d 100755 --- a/includes/install_packages.php +++ b/includes/install_packages.php @@ -425,7 +425,6 @@ if( !empty( $_REQUEST['cancel'] ) ) { $gBitInstaller->mPrefs = ''; $gBitInstaller->loadConfig(); - $gBitInstaller->mDb->query( "DELETE FROM `".BIT_DB_PREFIX."kernel_config` WHERE `package`=?", [ $package ] ); // ---------------------- 5. ---------------------- // run the defaults through afterwards so we can be sure all tables needed have been created @@ -459,7 +458,6 @@ if( !empty( $_REQUEST['cancel'] ) ) { } $gBitInstaller->mDb->CompleteTrans(); - // ---------------------- 6. ---------------------- // register all content types for installed packages foreach( $gBitInstaller->mContentClasses as $package => $classes ){ @@ -471,7 +469,6 @@ if( !empty( $_REQUEST['cancel'] ) ) { } } - // ---------------------- 7. ---------------------- // Do stuff that only applies during the first install $gBitInstaller->StartTrans(); @@ -610,8 +607,6 @@ if( !empty( $_REQUEST['cancel'] ) ) { } } - - // ---------------------- 8. ---------------------- // woo! we're done with the installation bit - below here is some generic installer stuff $gBitSmarty->assign( 'next_step', $step + 1 ); diff --git a/includes/install_version.php b/includes/install_version.php index 5a97442..6004133 100755 --- a/includes/install_version.php +++ b/includes/install_version.php @@ -21,7 +21,7 @@ if( version_compare( '2.1.0-beta', $gBitSystem->getVersion(), '>' )) { // get a list of all groups and their permissions $listHash = [ 'only_root_groups' => true, - 'sort_mode' => !empty( $_REQUEST['sort_mode'] ) ? $_REQUEST['sort_mode'] : 'group_name_asc' + 'sort_mode' => !empty( $_REQUEST['sort_mode'] ) ? $_REQUEST['sort_mode'] : 'group_name_asc', ]; $allGroups = $gBitUser->getAllGroups( $listHash ); $allPerms = $gBitUser->getGroupPermissions( $_REQUEST ); |
