Difference between revisions of "Beta Features"

From Dreamwidth Notes
Jump to: navigation, search
m
(correct path for enabling beta features; minor edits)
Line 2: Line 2:
  
  
== Putting a Feature into Beta ==
+
= Putting a Feature into Beta =
Features in active beta are listed on [http://dreamwidth.org/betafeatures Dreamwidth Beta]. To add a feature to that list, you will need to create a new module and configure the server to enable the feature beta.
+
  
=== Module ===
+
Features in active beta are listed on [http://dreamwidth.org/betafeatures Dreamwidth Beta]. To add a feature to that list, you will need to create a new module and configure the server to enable the feature beta.
  
 
Here is the bare minimum to get a module to work, to be placed in
 
Here is the bare minimum to get a module to work, to be placed in
Line 35: Line 34:
 
Refer to the base implementation at dw-free/cgi-bin/LJ/BetaFeatures/default.pm for methods that you can override.
 
Refer to the base implementation at dw-free/cgi-bin/LJ/BetaFeatures/default.pm for methods that you can override.
  
=== Configuring your Server to List the New Feature ===
+
= Configuring your Server to List the New Feature =
  
You'll also need to enable it in your configuration. Add this to dw-nonfree/etc/config-local.pl (or look for an existing %LJ::BETA_FEATURES line)
+
You'll also need to enable it in your configuration. Add this to ext/local/etc/config-local.pl (or look for an existing %LJ::BETA_FEATURES line)
  
 
     %LJ::BETA_FEATURES = (
 
     %LJ::BETA_FEATURES = (
Line 47: Line 46:
  
  
== Conditionally Enabling Features for Beta Testers ==
+
= Conditionally Enabling Features for Beta Testers =
 +
 
 
To determine whether a user has enabled a certain feature, use this in an if-statement:
 
To determine whether a user has enabled a certain feature, use this in an if-statement:
  

Revision as of 12:51, 19 June 2013

This page describes how to code and enable beta features on a server from the perspective of a developer. For instructions on doing beta work as a user, see Beta Testing


Putting a Feature into Beta

Features in active beta are listed on Dreamwidth Beta. To add a feature to that list, you will need to create a new module and configure the server to enable the feature beta.

Here is the bare minimum to get a module to work, to be placed in

   dw-free/cgi-bin/DW/BetaFeatures/featurename.pm
#!/usr/bin/perl
#
# DW::BetaFeatures::featurename - Allow users to beta test featurename
#
# Authors:
#      Afuna <coder.dw@afunamatata.com>
#
# Copyright (c) 2011 by Dreamwidth Studios, LLC.
#
# This program is free software; you may redistribute it and/or modify it under
# the same terms as Perl itself. For a copy of the license, please reference
# 'perldoc perlartistic' or 'perldoc perlgpl'.
 
package DW::BetaFeatures::featurename;
 
use strict;
use base "LJ::BetaFeatures::default";
 
1;


Refer to the base implementation at dw-free/cgi-bin/LJ/BetaFeatures/default.pm for methods that you can override.

Configuring your Server to List the New Feature

You'll also need to enable it in your configuration. Add this to ext/local/etc/config-local.pl (or look for an existing %LJ::BETA_FEATURES line)

   %LJ::BETA_FEATURES = (
       "featurename" => {
           start_time  => 0,
           end_time    => "Inf",
       },
   );


Conditionally Enabling Features for Beta Testers

To determine whether a user has enabled a certain feature, use this in an if-statement:

 LJ::BetaFeatures->user_in_beta( $u => "featurename" );