public static function generateCookieValidationKey()
    {
        $configs = func_get_args();
        $key = self::generateRandomString();
        foreach ($configs as $config) {
            if (is_file($config)) {
                $content = preg_replace('/(("|\')cookieValidationKey("|\')\s*=>\s*)(""|\'\')/', "\\1'$key'", file_get_contents($config), -1, $count);
                if ($count > 0) {
                    file_put_contents($config, $content);
                }
            }
        }
    }
public static function generateCookieValidationKey()
    {
        $configs = func_get_args();
        $key = self::generateRandomString();
        foreach ($configs as $config) {
            if (is_file($config)) {
                $content = preg_replace('/(("|\')cookieValidationKey("|\')\s*=>\s*)(""|\'\')/', "\\1'$key'", file_get_contents($config), -1, $count);
                if ($count > 0) {
                    file_put_contents($config, $content);
                }
            }
        }
    }
public static function generateCookieValidationKey ( ) { $ configs = func_get_args ( ) ; $ key = self :: generateRandomString ( ) ; foreach ( $ configs as $ config ) { if ( is_file ( $ config ) ) { $ content = preg_replace ( '/(("|\')cookieValidationKey("|\')\s*=>\s*)(""|\'\')/' , "\\1'$key'" , file_get_contents ( $ config ) , - 1 , $ count ) ; if ( $ count > 0 ) { file_put_contents ( $ config , $ content ) ; } } } }
Generates a cookie validation key for every app config listed in "config" in extra section.
You can provide one or multiple parameters as the configuration files which need to have validation key inserted.
Generates a cookie validation key for every app config listed in config in extra section . You can provide one or multiple parameters as the configuration files which need to have validation key inserted .