Example #1
0
     chdir(DIR_FS_CATALOG);
     require DIR_FS_CLASSES . 'database.php';
     tep_define_vars(DIR_FS_INCLUDES . 'database_tables.php');
     //require(DIR_FS_INCLUDES . 'database_tables.php');
     $g_db = new database();
     $g_db->connect();
     pre_configure_site();
     if (INSTALL_SEO_URLS == 1) {
         $contents = '#-MS- SEO-G Added' . "\n" . 'Options +FollowSymLinks' . "\n" . 'RewriteEngine On' . "\n" . 'RewriteBase ' . DIR_WS_HTTP_CATALOG . "\n\n" . '# Note whatever extension you use it should match the SEO-G configuration -> extension on the admin end even if its blank' . "\n" . '# Also the separators defined in the SEO-G for the various entities should be included in the rule here.' . "\n\n" . '# Rules for extensionless URLs' . "\n" . '# 1. Using a trailing slash' . "\n" . '#RewriteRule ^(.*)/$ root.php?$1&%{QUERY_STRING}' . "\n\n" . '# 2. Not using a trailing slash links with alphanumeric characters and hyphens' . "\n" . '#RewriteRule ^([a-z0-9_-]+)$ root.php?$1&%{QUERY_STRING}' . "\n\n" . '# Rules for URLs with extensions' . "\n" . '#RewriteRule ^(.*).asp$ root.php?$1.asp&%{QUERY_STRING}' . "\n" . '#RewriteRule ^(.*).(htm|html|asp|jsp|aspx)$ root.php?$1.*&%{QUERY_STRING}' . "\n\n" . '# Current Rules to support multiple extensions' . "\n" . '#RewriteRule ^([a-z0-9_-]+)$ root.php?$1&%{QUERY_STRING}' . "\n" . 'RewriteRule ^([/a-z0-9_-]+)$ root.php?$1&%{QUERY_STRING}' . "\n" . 'RewriteRule ^(.*)/$ root.php?$1&%{QUERY_STRING}' . "\n" . 'RewriteRule ^(.*).(htm|html|asp|jsp|aspx)$ root.php?$1.*&%{QUERY_STRING}' . "\n" . '#-MS- SEO-G Added EOM' . "\n";
         $result = write_contents('.htaccess', $contents);
         if (!$result) {
             $errors_array[] = ERROR_GLOBAL_WRITE_HTACCESS;
         }
         $contents = '#-MS- Disable SEO-G on admin folder' . "\n" . 'Options +FollowSymLinks' . "\n" . 'RewriteEngine On' . "\n" . 'RewriteBase ' . DIR_WS_HTTP_CATALOG . 'admin/' . "\n" . 'RewriteRule ^(.*)$ $1 [L]' . "\n" . '#-MS- SEO-G Added EOM' . "\n";
         chdir(DIR_FS_CATALOG . 'admin/');
         $result = write_contents('.htaccess', $contents);
         if (!$result) {
             $errors_array[] = ERROR_GLOBAL_WRITE_HTACCESS;
         }
     }
     chdir($current_dir);
     remove_directory($current_dir);
     chdir(DIR_FS_CATALOG);
     break;
 case 'license_agreement':
     $amend = '';
     if (!read_contents(FILE_LICENSE, $contents) || !read_contents(FILE_LICENSE_AMENDMENT, $amend)) {
         redirect($_SERVER['SCRIPT_NAME']);
     }
     if (!isset($_POST['license'])) {
         $error_string = ERROR_GLOBAL_LICENSE_AGREE;
Example #2
0
function copy_dir($src, $dst)
{
    $src = rtrim($src, '/');
    $dst = rtrim($dst, '/');
    if (empty($src) || empty($dst) || !is_dir($src)) {
        return;
    }
    if (!is_dir($dst)) {
        @mkdir($dst);
    }
    $sub_array = glob($src . '/*');
    if (empty($sub_array)) {
        return;
    }
    foreach ($sub_array as $sub) {
        $entry = basename($sub);
        if (is_file($sub)) {
            $contents = '';
            if (!read_contents($src . '/' . $entry, $contents)) {
                continue;
            }
            if (!write_contents($dst . '/' . $entry, $contents)) {
                continue;
            }
        } else {
            copy_dir($src . '/' . $entry, $dst . '/' . $entry);
        }
    }
    closedir(opendir($src));
    closedir(opendir($dst));
}