Apache2-Translation
view release on metacpan or search on metacpan
lib/Apache2/Translation/Admin/my.js view on Meta::CPAN
//Element.show( 'reload'+counter );
}
Element.update( 'a'+counter, opener[2] );
set_focus_to_first_input( counter );
} else {
Element.update( 'a'+counter, opener[1] );
Element.show( 'progress' );
new Ajax.Updater( { success: 'div'+counter },
'index.html',
{ method: 'post',
asynchronous: 1,
parameters: {
a: 'fetch',
key: data.key,
uri: data.uri,
counter: counter
},
onComplete: function(req) {
if( 200<=req.status && req.status<300 ) {
add_resizer( counter );
Element.show( 'div'+counter );
lib/Apache2/Translation/Admin/my.js view on Meta::CPAN
function xreload( counter, o, focus ) {
if(o) o.blur();
focus=focus2index(focus);
var data=get_data(counter);
Element.update( 'a'+counter, opener[1] );
Element.show( 'progress' );
new Ajax.Updater( { success: 'div'+counter },
'index.html',
{ method: 'post',
asynchronous: 1,
parameters: {
a: 'fetch',
key: data.key,
uri: data.uri,
counter: counter
},
onComplete: function(req) {
if( 200<=req.status && req.status<300 ) {
add_resizer( counter );
//Element.show( 'div'+counter );
lib/Apache2/Translation/Admin/my.js view on Meta::CPAN
params["a"]="update";
params["counter"]=counter;
var d=get_data(counter);
params["key"]=d.key;
params["uri"]=d.uri;
Element.update( 'a'+counter, opener[1] );
Element.show( 'progress' );
new Ajax.Updater( { success: 'div'+counter },
'index.html',
{ method: 'post',
asynchronous: 1,
parameters: params,
onComplete: function(req) {
if( 200<=req.status && req.status<300 ) {
add_resizer( counter );
$('save'+counter).style.visibility='hidden';
$('reload'+counter).style.visibility='';
var f=$('form'+counter);
set_data( counter, f.newkey.value, f.newuri.value );
update_header(counter, f.newkey.value, f.newuri.value);
add_inner_shortcuts( counter );
lib/Apache2/Translation/Admin/prototype.js view on Meta::CPAN
Ajax.Responders.register({
onCreate: function() { Ajax.activeRequestCount++ },
onComplete: function() { Ajax.activeRequestCount-- }
});
Ajax.Base = Class.create({
initialize: function(options) {
this.options = {
method: 'post',
asynchronous: true,
contentType: 'application/x-www-form-urlencoded',
encoding: 'UTF-8',
parameters: '',
evalJSON: true,
evalJS: true
};
Object.extend(this.options, options || { });
this.options.method = this.options.method.toLowerCase();
if (Object.isString(this.options.parameters))
lib/Apache2/Translation/Admin/prototype.js view on Meta::CPAN
else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
params += '&_=';
}
try {
var response = new Ajax.Response(this);
if (this.options.onCreate) this.options.onCreate(response);
Ajax.Responders.dispatch('onCreate', this, response);
this.transport.open(this.method.toUpperCase(), this.url,
this.options.asynchronous);
if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
this.transport.onreadystatechange = this.onStateChange.bind(this);
this.setRequestHeaders();
this.body = this.method == 'post' ? (this.options.postBody || params) : null;
this.transport.send(this.body);
/* Force Firefox to handle ready state 4 for synchronous requests */
if (!this.options.asynchronous && this.transport.overrideMimeType)
this.onStateChange();
}
catch (e) {
this.dispatchException(e);
}
},
onStateChange: function() {
var readyState = this.transport.readyState;
lib/Apache2/Translation/BDB.pod view on Meta::CPAN
The C<BDB> provider implements the C<Apache2::Translation> provider interface
as documented in L<Apache2::Translation::_base>. It provides for all optional
functions.
Other than the C<DB> providers C<BDB> doesn't implement a cache.
BerkeleyDB is fast enough on its own. Neither does it monitor the timestamp
of a file on disk. Hence it doesn't need a C<version> or C<timestamp> field.
Nevertheless it implements a C<timestamp> method that can be used by external
tools to synchronize the database state with external sources.
=head2 B<Parameters>
=over 2
=item B<bdbenv /path/to/directory>
Here you can pass a directory name or a C<BerkeleyDB::Env> object. In the
latter case, the environment must be initialized with DB_INIT_MPOOL,
DB_INIT_LOCK, DB_INIT_TXN and DB_INIT_LOG. Further, you need to specify a
t/001provider-DB.t view on Meta::CPAN
5 k1 u2 1 1 f
EOD
my $serverroot=Apache::Test::vars->{serverroot};
my ($db,$user,$pw)=@ENV{qw/DB USER PW/};
$user='' unless defined $user;
$pw='' unless defined $pw;
my $dbinit='';
unless( defined $db and length $db ) {
($db,$user,$pw)=("dbi:SQLite:dbname=$serverroot/test.sqlite", '', '');
$dbinit="PRAGMA synchronous = OFF";
}
t_debug "Using DB=$db USER=$user";
my $dbh;
my $cache_value;
sub prepare_db {
$dbh=DBI->connect( $db, $user, $pw,
{AutoCommit=>1, PrintError=>0, RaiseError=>1} )
or die "ERROR: Cannot connect to $db: $DBI::errstr\n";
$dbh->do($dbinit) if( length $dbinit );
t/010states.t view on Meta::CPAN
plan tests=>28;
#plan 'no_plan';
my $serverroot=Apache::Test::vars->{serverroot};
my ($db,$user,$pw)=@ENV{qw/DB USER PW/};
$user='' unless defined $user;
$pw='' unless defined $pw;
my $dbinit='';
unless( defined $db and length $db ) {
($db,$user,$pw)=("dbi:SQLite:dbname=$serverroot/test.sqlite", '', '');
$dbinit="PRAGMA synchronous = OFF";
}
t_debug "Using DB=$db USER=$user";
my $dbh;
my $data;
sub update_db {
$dbh->do('DELETE FROM trans');
my $stmt=$dbh->prepare( <<'SQL' );
t/011directives.t view on Meta::CPAN
}
my $serverroot=Apache::Test::vars->{serverroot};
my $documentroot=Apache::Test::vars->{documentroot};
my ($db,$user,$pw)=@ENV{qw/DB USER PW/};
$user='' unless defined $user;
$pw='' unless defined $pw;
my $dbinit='';
unless( defined $db and length $db ) {
($db,$user,$pw)=("dbi:SQLite:dbname=$serverroot/test.sqlite", '', '');
$dbinit="PRAGMA synchronous = OFF";
}
t_debug "Using DB=$db USER=$user";
my $dbh;
my $data;
sub update_db {
$dbh->do('DELETE FROM trans');
my $stmt=$dbh->prepare( <<'SQL' );
sub new_test_config {
my $self=shift;
$self->{conf_opts}->{maxclients}=2;
$self=$self->SUPER::new_test_config;
my $serverroot=Apache::Test::vars->{serverroot};
my $confdir=Apache::Test::vars->{t_conf};
unless( defined $db and length $db ) {
($db,$user,$pw)=("dbi:SQLite:dbname=$serverroot/test.sqlite", '', '');
$dbinit="PRAGMA synchronous = OFF";
}
warn "# Using Database $db, User '$user'\n";
my $dbh=DBI->connect( $db, $user, $pw,
{AutoCommit=>1, PrintError=>0, RaiseError=>1} )
or die "ERROR: Cannot connect to $db: $DBI::errstr\n";
eval {$dbh->do('PRAGMA synchronous = OFF')} if( defined $dbinit );
eval {$dbh->do('DROP TABLE cache')};
eval {$dbh->do('CREATE TABLE cache ( v int )')};
eval {$dbh->do('INSERT INTO cache( v ) VALUES( 1 )')};
eval {$dbh->do('DROP TABLE sequences')};
eval {$dbh->do('CREATE TABLE sequences ( xname text, xvalue int )')};
eval {$dbh->do('DROP TABLE trans')};
eval {
$dbh->do( <<'SQL' );
CREATE TABLE trans ( id int, xkey text, xuri text, xblock int, xorder int, xaction text, xnotes text )
SQL
( run in 0.346 second using v1.01-cache-2.11-cpan-0d8aa00de5b )