Commit 87f33e54 authored by Patrick Schmalstig's avatar Patrick Schmalstig
Browse files

Try fixing XML directories

parent 556526f7
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -451,16 +451,17 @@ class Database_Static_xml extends DatabaseDriver
    public function get_connection(bool $persistent, string $db_name, string $db_host, string $db_user, string $db_password, bool $fail_ok = false)
    {
        if ((strpos($db_name, '\\') === false) && (strpos($db_name, '/') === false)) {
            $db_name = get_custom_file_base() . '/uploads/website_specific/xmldb/' . $db_name;
            $db_dir = get_custom_file_base() . '/uploads/website_specific/xmldb';
            $db_name = $db_dir . '/' . $db_name;
        }
        if (!file_exists($db_name)) { // Will create on first usage
            require_code('files');
            require_code('files2');

            mkdir($db_name, 0777, true);
            fix_permissions($db_name);
            sync_file($db_name);

            cms_file_put_contents_safe($db_name . '/index.html', '', FILE_WRITE_FIX_PERMISSIONS | FILE_WRITE_SYNC_FILE);
            if (!is_dir($db_dir)) {
                make_missing_directory($db_dir);
            }
            make_missing_directory($db_name);
        }

        return [$db_name];
+1 −3
Original line number Diff line number Diff line
@@ -888,9 +888,7 @@ function should_ignore_file(string $path, int $bitmask = 0) : bool
            '.user.ini' => '.*',
        ]);

        $ignore_filename_and_dir_name_patterns = array_merge($ignore_filename_and_dir_name_patterns, [
            ['(?!index\.html$)(?!\.htaccess$).*', '_compiled/.*'], // Access controllers for compiled PHP files
        ]);
        $ignore_extensions['xml'] .= '|uploads/website_specific/xmldb/.*'; // XML database files
    }

    if (($bitmask & IGNORE_UNSHIPPED_VOLATILE) != 0) {
+0 −1
Original line number Diff line number Diff line
@@ -151,7 +151,6 @@ class Hook_addon_registry_core_database_drivers
            'sources/database/xml.php',
            'sources/hooks/systems/addon_registry/core_database_drivers.php',
            'sources/hooks/systems/cron/oracle.php',
            'uploads/website_specific/xmldb/index.html',
        ];
    }
}