Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recipe for making it work-ish with php8 #569

Open
misterludvigsen opened this issue Jan 24, 2023 · 2 comments
Open

Recipe for making it work-ish with php8 #569

misterludvigsen opened this issue Jan 24, 2023 · 2 comments

Comments

@misterludvigsen
Copy link

I followed these steps to get rid of all the errors in php8. Hope I didn't leave anything out.

/application/config/stikked.php
#36 $config['db_driver'] = 'mysqli';

/system/core/Input.php
#568 $which = FILTER_DEFAULT;

/application/libraries/Carabiner.php
#466 private function _asset($type, $dev_file, $prod_file = '', $combine = TRUE, $minify = TRUE, $media = 'screen', $group = 'main')

/system/libraries/Pagination.php
#525 if ( ! ctype_digit(strval($this->cur_page)) OR ($this->use_page_numbers && (int) $this->cur_page === 0))

Also, use google reCaptcha v2 - I was unable to make the old builtin captcha method to work.

@ColdSphinX
Copy link
Contributor

I got it to php 8.1.23 with these additional changes:

--- ./system/libraries/Session/drivers/Session_database_driver.php      2023-10-05 20:05:42.414960797 +0200
+++ ./system/libraries/Session/drivers/Session_database_driver.php      2023-10-05 20:02:53.452306534 +0200
@@ -126,7 +126,7 @@
         * @param       string  $name           Session cookie name, unused
         * @return      bool
         */
-       public function open($save_path, $name)
+       public function open(string $path, string $name): bool
        {
                if (empty($this->_db->conn_id) && ! $this->_db->db_connect())
                {
@@ -148,7 +148,7 @@
         * @param       string  $session_id     Session ID
         * @return      string  Serialized session data
         */
-       public function read($session_id)
+       public function read($session_id): string|false
        {
                if ($this->_get_lock($session_id) !== FALSE)
                {
@@ -205,7 +205,7 @@
         * @param       string  $session_data   Serialized session data
         * @return      bool
         */
-       public function write($session_id, $session_data)
+       public function write($session_id, $session_data): bool
        {
                // Prevent previous QB calls from messing with our queries
                $this->_db->reset_query();
@@ -277,7 +277,7 @@
         *
         * @return      bool
         */
-       public function close()
+       public function close(): bool
        {
                return ($this->_lock && ! $this->_release_lock())
                        ? $this->_fail()
@@ -294,7 +294,7 @@
         * @param       string  $session_id     Session ID
         * @return      bool
         */
-       public function destroy($session_id)
+       public function destroy($session_id): bool
        {
                if ($this->_lock)
                {
@@ -332,7 +332,7 @@
         * @param       int     $maxlifetime    Maximum lifetime of sessions
         * @return      bool
         */
-       public function gc($maxlifetime)
+       public function gc(int $max_lifetime): int|false
        {
                // Prevent previous QB calls from messing with our queries
                $this->_db->reset_query();

@k4bek4be
Copy link

I have opened a pull request fixing all issues i've found. Changes from your comments are also included. Captcha works too.
#570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants