MojoMojo-1.12/ 0000755 0001750 0001750 00000000000 13105607167 012542 5 ustar marcus marcus MojoMojo-1.12/dotcloud.yml 0000644 0001750 0001750 00000000056 13021751557 015103 0 ustar marcus marcus www:
type: perl
db:
type: postgresql
MojoMojo-1.12/META.yml 0000644 0001750 0001750 00000005664 13105606255 014023 0 ustar marcus marcus ---
abstract: 'A Wiki with a tree'
author:
- 'Marcus Ramberg C'
build_requires:
Email::Sender::Simple: '0.102370'
ExtUtils::MakeMaker: 6.59
SQL::Translator: '0.09006'
Test::Differences: 0
Test::More: '0.88'
Test::WWW::Mechanize::Catalyst: '0.51'
WWW::Mechanize: '1.54'
WWW::Mechanize::TreeBuilder: '1.10000'
configure_requires:
ExtUtils::MakeMaker: 6.59
File::Copy::Recursive: 0
distribution_type: module
dynamic_config: 1
generated_by: 'Module::Install version 1.17'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: MojoMojo
no_index:
directory:
- inc
- t
requires:
Algorithm::Diff: '1.1901'
Algorithm::Merge: 0
Archive::Zip: '1.14'
Cache::FastMmap: 1.31
Catalyst: '5.90015'
Catalyst::Action::RenderView: '0.07'
Catalyst::Authentication::Store::DBIx::Class: '0.101'
Catalyst::Controller::HTML::FormFu: '0.03007'
Catalyst::Model::DBIC::Schema: '0.01'
Catalyst::Plugin::Authentication: '0.10005'
Catalyst::Plugin::Cache: 0.08
Catalyst::Plugin::ConfigLoader: '0.13'
Catalyst::Plugin::I18N: 0
Catalyst::Plugin::Session::State::Cookie: 0.11
Catalyst::Plugin::Session::Store::Cache: 0
Catalyst::Plugin::Setenv: 0
Catalyst::Plugin::Static::Simple: '0.07'
Catalyst::Plugin::SubRequest: '0.19'
Catalyst::View::Email: '0.14'
Catalyst::View::Email::Template: 0
Catalyst::View::JSON: '0.26'
Catalyst::View::TT: '0.23'
Config::General: 0
Config::JFDI: 0
Crypt::CBC: '2.12'
DBD::SQLite: '1.27'
DBIx::Class: '0.08'
DBIx::Class::DateTime::Epoch: '0.04'
DBIx::Class::EncodedColumn: 0
DBIx::Class::TimeStamp: '0.11'
Data::Page: '2.00'
DateTime: '0.28'
DateTime::Format::Mail: 0
Directory::Scratch: '0.14'
Encode: '2.31'
FCGI::ProcManager: 0
File::Copy::Recursive: 0
File::MMagic: '1.27'
File::Slurp: 0
HTML::Entities: '3.60'
HTML::FormFu: '0.02000'
HTML::FormFu::Element::reCAPTCHA: 0
HTML::FormFu::Model::DBIC: 0
HTML::Strip: '1.04'
HTML::TagCloud: 0
HTML::Toc: 0
IO::File: '1.14'
IO::Scalar: 0
Image::ExifTool: 0
Image::Math::Constrain: 0
Imager: 0
KinoSearch1: '1.00'
LWP::Simple: 0
MRO::Compat: '0.10'
Module::Pluggable::Ordered: '1.4'
Moose: 0
Net::Amazon: 0
Number::Format: 0
Plack: 0.9974
Pod::Simple::HTML: '3.01'
Syntax::Highlight::Engine::Kate: 0
Template: '2.20'
Template::Plugin::JavaScript: 0
Term::Prompt: 0
Text::Context: '3.5'
Text::Emoticon::MSN: 0
Text::MultiMarkdown: '1.000032'
Text::Password::Pronounceable: 0
Text::Textile: 0
URI: '1.37'
URI::Fetch: 0
URI::Find: 0
XML::Feed: 0
XML::LibXML: '1.66'
XML::LibXSLT: '1.66'
YAML: '0.36'
parent: 0
perl: 5.8.4
resources:
MailingList: http://n2.nabble.com/mojomojo-f2358427.html
bugtracker: http://github.com/mojomojo/mojomojo/issues
homepage: http://mojomojo.org
license: http://dev.perl.org/licenses/
repository: http://github.com/mojomojo/mojomojo/
version: '1.12'
MojoMojo-1.12/INSTALL 0000644 0001750 0001750 00000000131 13021751557 013566 0 ustar marcus marcus Please refer to lib/MojoMojo/Installation.pod
perldoc lib/MojoMojo/Installation.pod
MojoMojo-1.12/mojomojo.conf 0000644 0001750 0001750 00000004110 13021751557 015236 0 ustar marcus marcus # NOTE: As a best practice, instead of editing this file, create a
# mojomojo_local.conf file, and modify there settings from this file.
# Settings in mojomojo_local.conf will take precedence, and they
# won't be overwritten when upgrading MojojMojo.
name MojoMojo
theme default
# If you change default_lang on a running site, please delete the index_dir
# from your file system so it will be generated using the new language the
# next time you start this MojoMojo
default_lang en
system_mail Default Installation
mailer SMTP
host localhost
# Un-comment force_ssl line below if you want to enforce HTTPS
#force_ssl 1
# DB User
#user db_user
#password db_password
# SQLite dsn (default data store)
dsn dbi:SQLite:mojomojo.db
# Enable unicode for supported databases
sqlite_unicode 1
#mysql_enable_utf8 1
#pg_enable_utf8 1
#root __path_to(root)__
#static_path /.static/
attachment_dir ./uploads
#index_dir __path_to(index)__
expires 604800
cache_size 15m
verify_address 0
check_permission_on_view 1
cache_permission_data 1
enforce_login 0
create_allowed 1
delete_allowed 1
edit_allowed 1
view_allowed 1
attachment_allowed 1
RECAPTCHA_PUBLIC_KEY 6LcsbAAAAAAAAPDSlBaVGXjMo1kJHwUiHzO2TDze
RECAPTCHA_PRIVATE_KEY 6LcsbAAAAAAAANQQGqwsnkrTd7QTGRBKQQZwBH-L
# Put the domain names or URLs you'd like to allow src= from.
src delicious.com
src flickr.com
src getsatisfaction.com
src google.com
src iusethis.com
src iwatchthis.com
src last.fm
src twitter.com
prefix_url /myfiles
whitelisting t/var/files
MojoMojo-1.12/script/ 0000755 0001750 0001750 00000000000 13105607167 014046 5 ustar marcus marcus MojoMojo-1.12/script/mojomojo_fastcgi.pl 0000755 0001750 0001750 00000002314 13021751557 017737 0 ustar marcus marcus #!/usr/bin/env perl
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('MojoMojo', 'FastCGI');
1;
=head1 NAME
mojomojo_fastcgi.pl - Catalyst FastCGI
=head1 SYNOPSIS
mojomojo_fastcgi.pl [options]
Options:
-? -help display this help and exits
-l --listen Socket path to listen on
(defaults to standard input)
can be HOST:PORT, :PORT or a
filesystem path
-n --nproc specify number of processes to keep
to serve requests (defaults to 1,
requires -listen)
-p --pidfile specify filename for pid file
(requires -listen)
-d --daemon daemonize (requires -listen)
-M --manager specify alternate process manager
(FCGI::ProcManager sub-class)
or empty string to disable
-e --keeperr send error messages to STDOUT, not
to the webserver
--proc_title Set the process title (is possible)
=head1 DESCRIPTION
Run a Catalyst application as fastcgi.
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
MojoMojo-1.12/script/mojomojo_update_db.pl 0000644 0001750 0001750 00000002067 13021751557 020250 0 ustar marcus marcus #!/usr/bin/env perl
=head1 NAME
mojomojo_update_db.pl - DBIC versioning
=head1 AUTHOR
dab
=head1 DESCRIPTION
DBIx Versionning see on catapulse.org http://www.catapulse.org/articles/view/75
=cut
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use MojoMojo::Schema;
use Config::JFDI;
use Term::Prompt;
my $jfdi = Config::JFDI->new(name => "MojoMojo");
my $config = $jfdi->get;
my ($dsn, $user, $pass) = @ARGV;
eval {
if (!$dsn) {
($dsn, $user, $pass) =
@{$config->{'Model::DBIC'}->{'connect_info'}};
};
};
if($@){
die "Your DSN line in mojomojo.conf doesn't look like a valid DSN.".
" Add one, or pass it on the command line.";
}
die "No valid Data Source Name (DSN).\n" if !$dsn;
$dsn =~ s/__HOME__/$FindBin::Bin\/\.\./g;
my $version = MojoMojo::Schema->VERSION;
my $schema = MojoMojo::Schema->connect($dsn, $user, $pass) or
die "Failed to connect to database";
$schema->create_ddl_dir(
['SQLite'],
$version > 1 ? $version : undef,
'db/upgrades',
$version ? $version-1 : $version
);
MojoMojo-1.12/script/mojomojo_fastcgi_manage.yml 0000644 0001750 0001750 00000000740 13021751557 021433 0 ustar marcus marcus ---
- name: "mojomojo.server"
server_class: "FCGI::Engine::Manager::Server"
scriptname: "script/mojomojo_fastcgi.pl"
nproc: 3
pidfile: "/tmp/mojomojo.pid"
socket: "/tmp/mojomojo.socket"
additional_args: [ "-I", "lib/" ]
- name: "mojomojo-dev.server"
scriptname: "script/mojomojo_fastcgi.pl"
nproc: 1
pidfile: "/tmp/mojomojo-dev.pid"
socket: "/tmp/mojomojo-dev.socket"
MojoMojo-1.12/script/mojomojo_test.pl 0000755 0001750 0001750 00000001243 13021751557 017276 0 ustar marcus marcus #!/usr/bin/env perl
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('MojoMojo', 'Test');
1;
=head1 NAME
mojomojo_test.pl - Catalyst Test
=head1 SYNOPSIS
mojomojo_test.pl [options] uri
Options:
--help display this help and exits
Examples:
mojomojo_test.pl http://localhost/some_action
mojomojo_test.pl /some_action
See also:
perldoc Catalyst::Manual
perldoc Catalyst::Manual::Intro
=head1 DESCRIPTION
Run a Catalyst action from the command line.
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
MojoMojo-1.12/script/util/ 0000755 0001750 0001750 00000000000 13105607167 015023 5 ustar marcus marcus MojoMojo-1.12/script/util/dir2mojomojo.pl 0000755 0001750 0001750 00000006167 13021751557 020007 0 ustar marcus marcus #!/usr/bin/env perl
BEGIN { $ENV{CATALYST_DEBUG} = 0 }
use strict;
use warnings;
use FindBin '$Bin';
use lib "$Bin/../../lib";
use MojoMojo::Schema;
use Config::JFDI;
use MojoMojo::Formatter::File;
use Path::Class ();
use Getopt::Long;
use MojoMojo::Formatter::File::Image;
#use MojoMojo;
#use MojoMojo::Model::Search;
my($DIR, $URL_DIR, $EXCLUDE, $debug, $help);
GetOptions ( 'dir=s' => \$DIR,
'urlbase=s' => \$URL_DIR,
'exclude=s' => \$EXCLUDE,
'debug' => \$debug,
'help' => \$help ) or die &Usage;
$debug=0 if ( ! $debug);
# parametres fourni ?
if ( $help || ! $DIR || ! $URL_DIR ){
&Usage;
exit 1;
}
$DIR =~ s/\/$//;
$DIR =~ s/~/$ENV{HOME}/;
#-----------------------------------------------------------------------------#
# Connect to database
#-----------------------------------------------------------------------------#
my $jfdi = Config::JFDI->new(name => "MojoMojo");
my $config = $jfdi->get;
my ($dsn, $user, $pass) = @ARGV;
eval {
if (!$dsn) {
($dsn, $user, $pass) =
@{$config->{'Model::DBIC'}->{'connect_info'}};
};
};
if($@){
die "Your DSN line in mojomojo.conf doesn't look like a valid DSN.".
" Add one, or pass it on the command line.";
}
die "No valid Data Source Name (DSN).\n" if !$dsn;
$dsn =~ s/__HOME__/$FindBin::Bin\/\.\./g;
my $schema = MojoMojo::Schema->connect($dsn, $user, $pass) or
die "Failed to connect to database";
my $person = $schema->resultset('Person')->find( 1 );
# Walk in $DIR
my $rootdir = Path::Class::dir($DIR);
my @files;
my $body;
my $urlpage;
$rootdir->recurse(callback => sub {
my ($entry) = @_;
return if ( defined $EXCLUDE && grep(/$EXCLUDE/, $entry ));
push @files, $entry unless ( $entry eq $DIR );
});
my $exclude;
$exclude="exclude=$EXCLUDE" if $EXCLUDE;
createpage($URL_DIR, "{{dir $DIR $exclude}}", $person);
foreach my $f (@files){
next if ( ! -r $f );
$urlpage = $f;
$urlpage =~ s/$DIR//;
$f =~ /.*\.(.*)$/;
$urlpage =~ s/\./_/
if ( ! MojoMojo::Formatter::File::Image->can_format($1) );
$urlpage = "${URL_DIR}${urlpage}";
if ( ref $f eq 'Path::Class::Dir'){
$body = "{{dir $f $exclude}}";
}
else{
my $plugin = MojoMojo::Formatter::File->plugin($f);
if ( $plugin ){
$body = "{{file $plugin $f}}";
}
else {
print STDERR "Can't find plugin for $f !!!\n";
$body = "{{ file UNKOWN_PLUGIN $f}}";
}
}
$schema->resultset('Page')->create_page($urlpage,$body, $person);
}
#-----------------------------------------------------------------------------#
# Usage
#-----------------------------------------------------------------------------#
sub Usage{
my $usage;
$usage .= "$0 --dir=DIRECTORY --url=URLBASE [--exclude=\"dir1 dir2\"] [--debug] [--help]\n";
$usage .= "Ex: $0 --dir=t/var/files --url=/myfiles --exclude='\.svn|\.git'\n";
$usage .= "Add these lines to your mojomojo.conf:\n";
$usage .= "\n";
$usage .= " prefix_url /myfiles\n";
$usage .= " whitelisting t/var/files\n";
$usage .= "\n";
print $usage;
}
MojoMojo-1.12/script/util/bust_cache.pl 0000644 0001750 0001750 00000004364 13021751557 017467 0 ustar marcus marcus #!/usr/bin/env perl
=head1 NAME
bust_cache.pl - Delete the precompiled content of a page. MojoMojo
will recompile the page next time it is requested.
=head1 SYNOPSIS
script/util/bust_cache.pl /path/to/page
=head1 AUTHORS
Dan Dascalescu (dandv), http://dandascalescu.com
=head1 LICENSE
You may distribute this code under the same terms as Perl itself.
=head1 COPYRIGHT
Copyright (C) 2010, Dan Dascalescu.
=cut
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../lib";
use MojoMojo::Schema;
my ($page_path, $filename_content, $dsn, $user, $pass) = @ARGV;
if (!$page_path) {
die "USAGE: $0 /path/to/page [dsn user pass]
Delete the precompiled content of a page. MojoMojo
will recompile the page next time it is requested.
\n";
}
if (!$dsn) {
# no DSN passed via the command line; attempting to read one from the config file
require Config::JFDI;
my $config = Config::JFDI->new(name => "MojoMojo")->get;
die "Couldn't read config file" if not keys %{$config};
eval {
if (ref $config->{'Model::DBIC'}->{'connect_info'} eq 'HASH') {
$dsn = $config->{'Model::DBIC'}->{'connect_info'}->{dsn};
$user = $config->{'Model::DBIC'}->{'connect_info'}->{user};
$pass = $config->{'Model::DBIC'}->{'connect_info'}->{password};
} else {
($dsn, $user, $pass) = @{$config->{'Model::DBIC'}->{connect_info}};
}
};
die "Your DSN settings in mojomojo.conf seem invalid: $@\n" if $@;
}
die "Couldn't find a valid Data Source Name (DSN).\n" if !$dsn;
$dsn =~ s/__HOME__/$FindBin::Bin\/\.\./g;
my $schema = MojoMojo::Schema->connect($dsn, $user, $pass) or
die "Failed to connect to database";
my ( $path_pages, $proto_pages ) = $schema->resultset('Page')->path_pages( $page_path )
or die "Can't find page $page_path\n";
if (scalar @$proto_pages) {
die "One or more pages at the end do(es) not exist: ",
(join ", ", map { $_->{name_orig} } @$proto_pages),
"\n";
}
# Get the lastest content version of the page
my $page = $path_pages->[-1];
my $page_content = $schema->resultset('Content')->single(
{
page => $page->id,
version => $page->content_version,
}
);
$page_content->update({
precompiled => ''
});
MojoMojo-1.12/script/util/import_content.pl 0000755 0001750 0001750 00000010147 13021751557 020432 0 ustar marcus marcus #!/usr/bin/env perl
=head1 NAME
import_content.pl - import content from a file into a MojoMojo page
=head1 SYNOPSIS
script/util/import_content.pl /path/to/page page.markdown
Since this operation is undoable, the script will prompt you to confirm that
you really want to replace the contents of the last version of /path/to/page
with what's in F.
=head1 DESCRIPTION
Replace the contents of the last version of a page with the content from a
file. Useful if you want to fix a typo in a page without bumping the version
and creating yet another revision in the database. Of course, can be used for
evil, but then so could be a series of SQL commands.
=head1 AUTHORS
Dan Dascalescu (dandv), http://dandascalescu.com
=head1 LICENSE
You may distribute this code under the same terms as Perl itself.
=head1 COPYRIGHT
Copyright (C) 2010, Dan Dascalescu.
=cut
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../lib";
use MojoMojo::Schema;
=head2 preview
Return the middle of a string. Examples:
preview('abcdefghijk', 10)
'ab [...] k'
preview('abcdefghijkl', 10), "\n";
'ab [...] l'
preview('abcdefghijkl', 11), "\n";
'ab [...] kl'
preview('abcdefghijklm', 10), "\n";
'ab [...] m'
preview('abcdef0000000000ghijklm', 10), "\n";
'ab [...] m'
=cut
sub preview {
my ($string, $limit) = @_;
my $length = length $string;
return $string if $length <= $limit;
my $middle = ' [...] ';
return
substr( $string, 0, ($limit+1 - length $middle)/2 )
. $middle
. substr( $string, $length - ($limit-1 - length $middle)/2 )
;
}
my ($page_path, $filename_content, $dsn, $user, $pass) = @ARGV;
if (!$page_path) {
die "USAGE: $0 /path/to/page filename [dsn user pass]
Replace the contents of the last version of a page with the content from a file.
\n";
}
if (!$dsn) {
# no DSN passed via the command line; attempting to read one from the config file
require Config::JFDI;
my $config = Config::JFDI->new(name => "MojoMojo")->get;
die "Couldn't read config file" if not keys %{$config};
eval {
if (ref $config->{'Model::DBIC'}->{'connect_info'} eq 'HASH') {
$dsn = $config->{'Model::DBIC'}->{'connect_info'}->{dsn};
$user = $config->{'Model::DBIC'}->{'connect_info'}->{user};
$pass = $config->{'Model::DBIC'}->{'connect_info'}->{password};
} else {
($dsn, $user, $pass) = @{$config->{'Model::DBIC'}->{connect_info}};
}
};
die "Your DSN settings in mojomojo.conf seem invalid: $@\n" if $@;
}
die "Couldn't find a valid Data Source Name (DSN).\n" if !$dsn;
$dsn =~ s/__HOME__/$FindBin::Bin\/\.\./g;
my $schema = MojoMojo::Schema->connect($dsn, $user, $pass) or
die "Failed to connect to database";
my ( $path_pages, $proto_pages ) = $schema->resultset('Page')->path_pages( $page_path )
or die "Can't find page $page_path\n";
if (scalar @$proto_pages) {
die "One or more pages at the end do(es) not exist: ",
(join ", ", map { $_->{name_orig} } @$proto_pages),
"\n";
}
# Get the lastest content version of the page
my $page = $path_pages->[-1];
my $page_content_rs = $schema->resultset('Content')->search(
{
page => $page->id,
version => $page->content_version,
}
);
die "More than one 'last version' for page <$page_path>. The database may be corrupt.\n"
if $page_content_rs->count > 1;
my $page_content = $page_content_rs->first;
open my $file_content, '<:utf8', $filename_content or die $!;
my $content; {local $/; $content = <$file_content>};
print "Are you sure you want to replace\n",
preview($page_content->body, 300),
"\nwith\n",
preview($content, 300),
"\n? ('yes'/anything else): ";
my $answer = ; chomp $answer;
if ($answer eq 'yes') {
$page_content->update(
{
body => $content,
precompiled => '', # this needs to be blanked so that MojoMojo will re-compile it
}
);
print "Done.\n";
} else {
print "Aborted.\n";
exit 1;
}
MojoMojo-1.12/script/util/wikispaces2markdown.pl 0000644 0001750 0001750 00000001435 13021751557 021352 0 ustar marcus marcus #!/usr/bin/perl -w
use strict;
use FindBin '$Bin';
use lib "$Bin/../lib";
use Text::Wikispaces2Markdown;
if (not @ARGV) {
die "USAGE: $0
For each Wikispaces input file, will output a Markdown file with the same name and a .markdown extension
";
}
for my $filename (@ARGV) {
open my $file_in, '<', $filename or die $!;
my $text = do {local $/; <$file_in>};
my ($filename_out) = $filename =~ /^(.*?) ((?<=.)\.[^.\/:\\]+)?$/x; # basename (path+file) and extension
open my $file_out, '>', "$filename_out.markdown" or die $!;
print $file_out Text::Wikispaces2Markdown::convert($text) or die $!;
}
=head1 NAME
wikispaces2markdown.pl - rough draft of converting wikispaces to markdown
=head1 AUTHOR
Dan Dascalescu (dandv), http://dandascalescu.com
=cut
MojoMojo-1.12/script/util/init_db_re.pl 0000644 0001750 0001750 00000001552 13021751557 017461 0 ustar marcus marcus use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../lib";
use MojoMojo::Schema;
use base 'Exporter';
our @EXPORT =
qw( $schema $preference_rs $page_rs @root_lower_family $root_page $number_of_family_members );
# Make the dbi connection info MATCH YOUR ENVIRONMENT.
our $schema =
MojoMojo::Schema->connect( 'dbi:mysql:database=mojomojo;host=localhost',
'mojomojo', 'pass' );
our $preference_rs = $schema->resultset('Preference');
our $page_rs = $schema->resultset('Page');
our $root_page = $page_rs->find( { id => 1 } );
our @root_lower_family = $root_page->descendants;
our $number_of_family_members = scalar @root_lower_family;
__PACKAGE__->export_to_level(1);
__END__
=head1 Usage
This code can be run within re.pl as:
do '$name_of_this_script'
This will load the schema set the exported variables.
=cut
MojoMojo-1.12/script/util/delete_inactive_users.pl 0000644 0001750 0001750 00000006313 13021751557 021730 0 ustar marcus marcus #!/usr/bin/perl
=head1 NAME
delete_inactive_users.pl - Delete inactive users and their revisions. Use as a mass antispam tool,
if you haven't deactivated users via /admini/.users for other reasons. Read the usage.
=head1 AUTHOR
Dan Dascalescu (dandv), http://dandascalescu.com
=cut
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../lib";
use MojoMojo;
die "Delete inactive users and their page revisions.
These users are of two sorts: users that an admin has disabled from
/.admin/user (most probably spammers) and unconfirmed users (they haven't
confirmed their e-mail yet). The latter are again most probably spammers,
but theoretically, a user who's changed their valid e-mail address and
didn't confirm the new one would fall in that category too.
This script will delete all unconfirmed and disabled users who've never
edited pages, and will prompt you to delete disabled users who have edited
pages. All their edits (page revisions) will also be deleted.
To run this script, call it with an argument (meaning you've read this).
" if not @ARGV;
my $users;
my $users_deleted = 0;
$users = MojoMojo->model('DBIC::Person')->search(
{ active => {'!=' => 1},
'page_versions.creator' => undef # IS NULL
},
{join => 'page_versions'}
);
my $users_count = $users->count;
if ($users_count > 0) {
print "Unconfirmed and disabled users without pages: $users_count. Delete? ('yes'/anything else): ";
my $answer = ; chomp $answer;
if ($answer eq 'yes') {
$users_deleted += $users_count;
$users->delete;
}
};
# disabled users (active = 0, set so from the admin interface) who've edited pages are probably spammers
$users = MojoMojo->model('DBIC::Person')->search(
{
active => 0,
'page_versions.creator' => \'IS NOT NULL' # necessary because this is a LEFT JOIN
},
{join => 'page_versions'}
);
$users_count = $users->count;
if ($users_count > 0) {
print "$users_count users disabled by an admin (probably spammers) have edited at least one page each. Delete (A)ll / (I)ndividually / (N)one? ";
my $answer = ; chomp $answer;
if (uc $answer eq 'A') {
$users_deleted += $users_count;
$users->delete;
} elsif (uc $answer eq 'I') {
# delete the fuckers individually
while (my $user = $users->next) {
my @user_pages = $user->pages;
print "User ", $user->name, "has been disabled, and they edited ", scalar @user_pages, " pages:\n";
print map {' ' . $_->path . "\n" } @user_pages;
print "Delete this user? ('yes'/anything else) ";
my $answer = ; chomp $answer;
if ($answer eq 'yes') {
# this nicely cascades to delete the revisions authored by the user in Content,
# and the Page and PageVersion if they are left without any Content revision
$user->delete;
$users_deleted++;
}
}
}
}
# Unconfirmed users (active = -1) who have edited pages are left alone. This can only mean that the user was
# once active, but then changed their e-mail address and hasn't confirmed the new one.
print "Deleted $users_deleted inactive users.\n";
MojoMojo-1.12/script/util/dump_content.pl 0000755 0001750 0001750 00000004214 13021751557 020063 0 ustar marcus marcus #!/usr/bin/env perl
=head1 NAME
dump_content.pl - Dump the raw (markup) content of a page.
=head1 SYNOPSIS
script/util/dump_content.pl /path/to/page > page.markdown
=head1 AUTHORS
Dan Dascalescu (dandv), http://dandascalescu.com
=head1 LICENSE
You may distribute this code under the same terms as Perl itself.
=head1 COPYRIGHT
Copyright (C) 2010, Dan Dascalescu.
=cut
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../lib";
use MojoMojo::Schema;
my ($page_path, $filename_content, $dsn, $user, $pass) = @ARGV;
if (!$page_path) {
die "USAGE: $0 /path/to/page [dsn user pass]
Dump the raw (markup) contents of the last version of a page.
\n";
}
if (!$dsn) {
# no DSN passed via the command line; attempting to read one from the config file
require Config::JFDI;
my $config = Config::JFDI->new(name => "MojoMojo")->get;
die "Couldn't read config file" if not keys %{$config};
eval {
if (ref $config->{'Model::DBIC'}->{'connect_info'} eq 'HASH') {
$dsn = $config->{'Model::DBIC'}->{'connect_info'}->{dsn};
$user = $config->{'Model::DBIC'}->{'connect_info'}->{user};
$pass = $config->{'Model::DBIC'}->{'connect_info'}->{password};
} else {
($dsn, $user, $pass) = @{$config->{'Model::DBIC'}->{connect_info}};
}
};
die "Your DSN settings in mojomojo.conf seem invalid: $@\n" if $@;
}
die "Couldn't find a valid Data Source Name (DSN).\n" if !$dsn;
$dsn =~ s/__HOME__/$FindBin::Bin\/\.\./g;
my $schema = MojoMojo::Schema->connect($dsn, $user, $pass) or
die "Failed to connect to database";
my ( $path_pages, $proto_pages ) = $schema->resultset('Page')->path_pages( $page_path )
or die "Can't find page $page_path\n";
if (scalar @$proto_pages) {
die "One or more pages at the end do(es) not exist: ",
(join ", ", map { $_->{name_orig} } @$proto_pages),
"\n";
}
# Get the lastest content version of the page
my $page = $path_pages->[-1];
my $page_content = $schema->resultset('Content')->single(
{
page => $page->id,
version => $page->content_version,
}
);
print $page_content->body;
MojoMojo-1.12/script/util/search_and_replace.pl 0000644 0001750 0001750 00000005477 13021751557 021157 0 ustar marcus marcus use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../lib";
use Getopt::Long;
=head1 Description
EXPERIMENTAL Global Search and Replace for MojoMojo pages.
This script will search and replace on the most recent version of all pages.
It has NOT been thorougly tested yet. Use at your own risk.
=head1 Usage
General Form:
perl script/util/search_and_replace.pl --search 'something' --replace 'something else'
Concrete Example:
perl script/util/search_and_replace.pl --search 'Cata\sliscious' --replace 'Dog man was here.'
The concrete example will replace 'Cata liscious' with 'Dog man was here.'
Note the use of \s to match a space in the search term.
=cut
my $search_string;
my $replacement_string;
my $result = GetOptions(
"search|s=s" => \$search_string,
"replace|r=s" => \$replacement_string,
) or die &usage();
# parametres fourni ?
if ( !$search_string || !$replacement_string ) {
&usage;
exit 1;
}
use MojoMojo;
use MojoMojo::Schema;
use Data::Dumper;
my $schema = schema_connect();
my $page_rs = $schema->resultset('Page');
my $found_search_string = 0;
while ( my $page = $page_rs->next ) {
# This is for the lastest content version of a page.
my $page_content = $schema->resultset('Content')->search(
{
page => $page->id,
version => $page->content_version,
}
);
if ( $page_content->count == 1 ) {
my $content = $page_content->first->body;
# Search on something
if ( $content =~ m{$search_string} ) {
my $number_of_replacements =
$content =~ s{$search_string}{$replacement_string}mxg;
$number_of_replacements ||= 0;
print "Made $number_of_replacements replacments in page: ",
$page->name_orig, " \n";
if ( $number_of_replacements ) { $found_search_string = 1; }
# Give the adulterated content back to db.
$page_content->first->update( { body => $content } );
}
}
elsif ( $page_content->count > 1 ) {
print "ERROR: Seems there is more than one 'latest content version' of
the page: ", $page->name, "\n";
}
else {
# This case happens when a page is only in prototype form. In other
# words, it is a node with children that has never received content
# of it's own.
print "NOTICE: Page ", $page->name,
" is only a prototype and therefore has no content.\n";
}
}
if ( not $found_search_string ) { print "Did not find search string: $search_string\n"; }
sub schema_connect {
my @db_cfg = @{ MojoMojo->config()->{'Model::DBIC'}->{'connect_info'} };
return MojoMojo::Schema->connect( @db_cfg[qw/0 1 2/] );
}
sub usage {
print "Usage:
perl script/util/search_and_replace.pl --search=SEARCH_STRING --replace=REPLACEMENT_STRING\n";
}
MojoMojo-1.12/script/util/hash_passwords.pl 0000644 0001750 0001750 00000002070 13021751557 020407 0 ustar marcus marcus #!/usr/bin/perl
#===============================================================================
#
# FILE: hash_passwords.pl
#
# USAGE: ./hash_passwords.pl
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Marcus Ramberg (MRAMBERG),
# COMPANY: Nordaaker Ltd
# VERSION: 1.0
# CREATED: 06/27/2008 22:59:39 CEST
# REVISION: ---
#===============================================================================
=head1 NAME
hash_passwords.pl - hash plain text passwords
=head1 AUTHOR
Marcus Ramberg (MRAMBERG),
=cut
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use MojoMojo;
my $users=MojoMojo->model('DBIC::Person')->search;
my $first=$users->first;
die "First password is 40 chars. Probably already converted" if length($first->pass) == 40;
$users->reset;
while (my $user=$users->next) {
$user->pass($user->get_column('pass'));
$user->update;
}
print $users->count() ." users updated.\n"; MojoMojo-1.12/script/util/dbk2xhtml.pl 0000755 0001750 0001750 00000000764 13021751557 017271 0 ustar marcus marcus #!/usr/bin/perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../lib";
use MojoMojo::Formatter::DocBook;
my $filename = shift;
open my $file, '<', $filename or die "Can't open $filename: $!\n";
my $content = do {local $/; <$file> };
print MojoMojo::Formatter::DocBook->to_xhtml( $content );
__END__
=head1 Usage
dbk2xhtml.pl docbookfile
=head1 AUTHORS
Daniel Brosseau
=head1 LICENSE
This script is licensed under the same terms as Perl itself.
=cut
MojoMojo-1.12/script/util/textile2markdown.pl 0000644 0001750 0001750 00000002420 13021751557 020661 0 ustar marcus marcus #!/usr/bin/env perl
use strict;
use HTML::WikiConverter;
use HTML::WikiConverter::Markdown 0.05; # Version 0.05 fixed four bugs I reported. See http://rt.cpan.org/Public/Dist/Display.html?Status=Resolved&Name=HTML-WikiConverter-Markdown
use Text::Textile;
my $textile_engine = new Text::Textile;
my $wc_engine = new HTML::WikiConverter( dialect => 'Markdown' );
if (not @ARGV) {
die "USAGE: $0
For each Textile input file, will output a Markdown file with the same name and a .markdown extension
";
}
for my $filename (@ARGV) {
open my $file_in, '<', $filename or die $!;
my $textile_text = do {local $/; <$file_in>};
my $html = $textile_engine->process($textile_text);
my $markdown_text = $wc_engine->html2wiki(
html => $html,
link_style => 'inline',
);
my ($filename_out) = $filename =~ /^(.*?) ((?<=.)\.[^.\/:\\]+)?$/x; # basename (path+file) and extension
# open my $file_out, '>', "$filename_out.html" or die $!;
# print $file_out $html or die $!;
open my $file_out, '>', "$filename_out.markdown" or die $!;
print $file_out $markdown_text or die $!;
}
=head1 NAME
textile2markdown.pl - rough draft of converting textile to markdown
=head1 AUTHOR
Dan Dascalescu (dandv), http://dandascalescu.com
=cut
MojoMojo-1.12/script/util/delete_page.pl 0000755 0001750 0001750 00000005372 13021751557 017630 0 ustar marcus marcus #!/usr/bin/env perl
# TODO: this should call MojoMojo::Controller::Admin::delete() after
# that method gets moved to the Model. There's no reason to reinvent
# a poor-man's version of page deletion here (issue #87).
use strict;
use warnings;
# WARNING: This script will delete all the children of the page you are deleting.
use FindBin;
use lib "$FindBin::Bin/../../lib";
use MojoMojo::Schema;
use Config::JFDI;
use Term::Prompt;
my $jfdi = Config::JFDI->new(name => "MojoMojo");
my $config = $jfdi->get;
my ($dsn, $user, $pass) = @ARGV;
eval {
if (!$dsn) {
($dsn, $user, $pass) =
@{$config->{'Model::DBIC'}->{'connect_info'}};
};
};
if($@){
die "Your DSN line in mojomojo.conf doesn't look like a valid DSN.".
" Add one, or pass it on the command line. $dsn, $user, $pass";
}
die "No valid Data Source Name (DSN).\n" if !$dsn;
$dsn =~ s/__HOME__/$FindBin::Bin\/\.\./g;
my $schema = MojoMojo::Schema->connect($dsn, $user, $pass) or
die "Failed to connect to database";
my $page_id = prompt('n', 'Input ID of Page to Delete:', '', '' );
if ( $page_id == 0 ) {
die "You must select a positive integer.\n";
}
delete_page($page_id);
=head2
Delete a page and all its children. Use with caution.
=cut
sub delete_page {
my $id = shift;
print "Erasing page: ";
my $page = $schema->resultset('Page')->find( { id => $id } );
print $page->name_orig, "\n";
my $page_version_rs =
$schema->resultset('PageVersion')->search( { page => $id } )->delete_all;
my $content_rs =
$schema->resultset('Content')->search( { page => $id } )->delete_all;
my $attachment_rs =
$schema->resultset('Attachment')->search( { page => $id } )->delete_all;
my $comment_rs =
$schema->resultset('Comment')->search( { page => $id } )->delete_all;
my $link_rs =
$schema->resultset('Link')
->search( [ { from_page => $id }, { to_page => $id } ] )->delete_all;
my $role_privilege_rs =
$schema->resultset('RolePrivilege')->search( { page => $id } )->delete_all;
my $tag_rs = $schema->resultset('Tag')->search( { page => $id } )->delete_all;
my $wanted_page =
$schema->resultset('WantedPage')->search( { from_page => $id } )->delete_all;
my $journal_rs =
$schema->resultset('Journal')->search( { pageid => $id } )->delete_all;
my $entry_rs =
$schema->resultset('Entry')->search( { journal => $id } )->delete_all;
my $page_rs = $schema->resultset('Page')->search( { id => $id } );
$page_rs->delete_all;
}
__END__
=head1 Usage
perl script/util/delete_page.pl
Then input the id (positive integer) of the page you want to delete.
This number comes from the id column of the page table.
This will delete the page and all its children (if there are any).
Use with caution.
=cut
MojoMojo-1.12/script/mojomojo_fastcgi_manage.pl 0000755 0001750 0001750 00000002064 13021751557 021251 0 ustar marcus marcus #!/usr/bin/perl
=head1 NAME
mojomojo_fastcgi_manage.pl - script to start/stop/restart mojomojo fastcgi instance
=cut
eval { use FCGI::Engine::Manager };
if ($@) { die "You need to install FCGI::Engine to run this script\n"; }
my $m =
FCGI::Engine::Manager->new( conf => 'script/mojomojo_fastcgi_manage.yml' );
my ( $command, $server_name ) = @ARGV;
$m->start($server_name) if $command eq 'start';
$m->stop($server_name) if $command eq 'stop';
$m->restart($server_name) if $command eq 'restart';
$m->graceful($server_name) if $command eq 'graceful';
print $m->status($server_name) if $command eq 'status';
=head1 USAGE
NOTE: Run this script from the parent directory so path to configuration is correct.
perl script/mojomojo_fastcgi_manage.pl start
perl script/mojomojo_fastcgi_manage.pl stop
perl script/mojomojo_fastcgi_manage.pl restart mojomojo.server
=head1 Web Server Configuration
=head2 Apache
In an apache conf file:
FastCgiExternalServer /tmp/mojomojo.fcgi -socket /tmp/mojomojo.socket
Alias /wiki /tmp/mojomojo.fcgi/
MojoMojo-1.12/script/mojomojo_spawn_db.pl 0000755 0001750 0001750 00000007554 13021751557 020127 0 ustar marcus marcus #!/usr/bin/env perl
=head1 NAME
mojomojo_spawn_db.pl - hash plain text passwords
=head1 AUTHOR
Jonathan Rockway
=head1 COPYRIGHT
2007 Jonathan Rockway
=cut
BEGIN { $ENV{CATALYST_DEBUG} = 0 }
use strict;
use warnings;
use FindBin '$Bin';
use lib "$Bin/../lib";
use MojoMojo::Schema;
use Config::JFDI;
use Getopt::Long;
my $jfdi = Config::JFDI->new(name => "MojoMojo");
my $config = $jfdi->get;
my ($dsn, $user, $password, $unicode_option);
my $default_user = $ENV{USER} || 'unknown';
my %opts = (
wiki_name => $config->{name},
admin_username => 'admin',
admin_password => 'admin',
admin_fullname => $default_user,
admin_email => "$default_user\@localhost",
anonymous_email => 'anonymous.coward@localhost',
);
my $help;
GetOptions(
'help' => \$help,
'dsn:s' => \$dsn,
'db-user:s' => \$user,
'db-password:s' => \$password,
'wiki:s' => \$opts{wiki_name},
'admin-username:s' => \$opts{admin_username},
'admin-password:s' => \$opts{admin_password},
'admin-fullname:s' => \$opts{admin_fullname},
'admin-email:s' => \$opts{admin_email},
'anon-email:s' => \$opts{anonymous_email},
);
if ($help) {
print <<"EOF";
mojomojo_spawn_db.pl ...
This script looks in the mojomojo.conf file for database connection
info if none is passed on the command line. Set the MOJOMOJO_CONFIG
environment variable to tell it where the file is.
Accepts the following options:
--dsn Default taken from mojomojo.conf
--db-user Default taken from mojomojo.conf
--db-password Default taken from mojomojo.conf
--wiki Wiki name, default taken from mojomojo.conf
--admin-username Admin username, default is admin
--admin-password Admin password, default is admin
--admin-fullname Admin name, default is $default_user
--admin-email Admin email address, default is $default_user\@localhost
--anon-email Anon user email address, default is anonymous.coward\@localhost
EOF
exit;
}
eval {
if (!$dsn)
{
if (ref $config->{'Model::DBIC'}->{'connect_info'}) {
$dsn = $config->{'Model::DBIC'}->{'connect_info'}->{dsn};
$user = $config->{'Model::DBIC'}->{'connect_info'}->{user};
$password = $config->{'Model::DBIC'}->{'connect_info'}->{password};
# Determine database type amongst: SQLite, Pg or MySQL
my $db_type = lc($dsn =~ m/^dbi:(\w+)/);
my %unicode_connection_for_db = (
'sqlite' => { sqlite_unicode => 1 },
'pg' => { pg_enable_utf8 => 1 },
'mysql' => { mysql_enable_utf8 => 1 },
);
$unicode_option = $unicode_connection_for_db{$db_type};
}
else {
$dsn = $config->{'Model::DBIC'}->{'connect_info'};
}
}
};
if ($@) {
die "Your DSN line in mojomojo.conf doesn't look like a valid DSN."
. " Add one, or pass it on the command line.";
}
die "No valid Data Source Name (DSN).\n" if !$dsn;
$dsn =~ s/__HOME__/$FindBin::Bin\/\.\./g;
my $schema = MojoMojo::Schema->connect($dsn, $user, $password, $unicode_option)
or die "Failed to connect to database";
# Check if database is already deployed by
# examining if the table Person exists and has a record.
eval { $schema->resultset('MojoMojo::Schema::Result::Person')->count };
if (!$@) {
die "You have already deployed your database\n";
}
print <<"EOF";
Creating a new wiki ...
dsn: $dsn
wiki name: $opts{wiki_name}
admin username: $opts{admin_username}
admin password: $opts{admin_password}
admin name: $opts{admin_fullname}
admin email: $opts{admin_email}
anon email: $opts{anonymous_email}
EOF
print "Deploying schema to $dsn\n";
$schema->deploy;
$schema->create_initial_data($config, \%opts);
MojoMojo-1.12/script/mojomojo_create.pl 0000755 0001750 0001750 00000003220 13021751557 017557 0 ustar marcus marcus #!/usr/bin/env perl
use strict;
use warnings;
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('MojoMojo', 'Create');
1;
=head1 NAME
mojomojo_create.pl - Create a new Catalyst Component
=head1 SYNOPSIS
mojomojo_create.pl [options] model|view|controller name [helper] [options]
Options:
--force don't create a .new file where a file to be created exists
--mechanize use Test::WWW::Mechanize::Catalyst for tests if available
--help display this help and exits
Examples:
mojomojo_create.pl controller My::Controller
mojomojo_create.pl -mechanize controller My::Controller
mojomojo_create.pl view My::View
mojomojo_create.pl view HTML TT
mojomojo_create.pl model My::Model
mojomojo_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
dbi:SQLite:/tmp/my.db
mojomojo_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
[Loader opts like db_schema, naming] dbi:Pg:dbname=foo root 4321
[connect_info opts like quote_char, name_sep]
See also:
perldoc Catalyst::Manual
perldoc Catalyst::Manual::Intro
perldoc Catalyst::Helper::Model::DBIC::Schema
perldoc Catalyst::Model::DBIC::Schema
perldoc Catalyst::View::TT
=head1 DESCRIPTION
Create a new Catalyst Component.
Existing component files are not overwritten. If any of the component files
to be created already exist the file will be written with a '.new' suffix.
This behavior can be suppressed with the C<-force> option.
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
MojoMojo-1.12/script/mojomojo_cgi.pl 0000755 0001750 0001750 00000000674 13021751557 017070 0 ustar marcus marcus #!/usr/bin/env perl
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('MojoMojo', 'CGI');
1;
=head1 NAME
mojomojo_cgi.pl - Catalyst CGI
=head1 SYNOPSIS
See L
=head1 DESCRIPTION
Run a Catalyst application as a cgi script.
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
MojoMojo-1.12/script/update_po.sh 0000755 0001750 0001750 00000005461 13021751557 016373 0 ustar marcus marcus #!/bin/sh
# Default setting
PERL_DEFAULT=`which perl`
MOJOMOJO_DIR="."
# Process command line options
while getopts ":hl:m:jp:" Option
do
case $Option in
# MojoMojo directory
m )
MOJOMOJO_DIR=$OPTARG
;;
# Help option
h )
perldoc $0
exit
;;
# JOSN only
j )
JSON_ONLY=1
;;
# Language
l )
langs=$OPTARG
;;
# perl path
p )
PERL=$OPTARG
;;
# Unknow option
* )
echo Unknow option.
echo See:
echo " ./$0 -h"
echo for usage
exit 1
;;
esac
done
# Check perl executable
if [ -z "$PERL" ] || [ ! -x "$PERL" ]; then
PERL=$PERL_DEFAULT
fi
# Check MojoMojo dir
if [ ! -d "$MOJOMOJO_DIR/lib/MojoMojo/I18N" ]; then
echo "$MOJOMOJO_DIR directory: lib/MojoMojo/I18N not found."
exit 1
else
cd $MOJOMOJO_DIR
MOJOMOJO_DIR="."
fi
# Check language(s)
if [ -z "$langs" ]
then
langs=$(ls $MOJOMOJO_DIR/lib/MojoMojo/I18N|grep ^..\.po$)
else
langs=$langs.po
fi
# Process .po files
for lang in $langs ; do
lang_=`echo $lang|sed 's/.po//'`
echo "lang: $lang_"
if [ -z "$JSON_ONLY" ]; then
$PERL -Ilib `which xgettext.pl` -now -D $MOJOMOJO_DIR/lib/MojoMojo $MOJOMOJO_DIR/lib/MojoMojo.pm -D $MOJOMOJO_DIR/root/forms -D $MOJOMOJO_DIR/root/base -P perl=* -P tt2=* -P yaml=yml -P formfu=* -P text=* -o $MOJOMOJO_DIR/lib/MojoMojo/I18N/$lang_.po
$PERL -Ilib `which xgettext.pl` -now -D $MOJOMOJO_DIR/root/static/js -P perl=* -P tt2=* -P yaml=yml -P formfu=* -P text=* -o $MOJOMOJO_DIR/lib/MojoMojo/I18N/$lang_.js.po
fi
$PERL -Ilib $MOJOMOJO_DIR/script/po2json.pl $MOJOMOJO_DIR/lib/MojoMojo/I18N/$lang_.js.po $MOJOMOJO_DIR/root/static/json/$lang_.po.json
done
# All is OK
exit 0
< update_po.sh [command] [options]
=head1 DESCRIPTION
F is a shell script that lets you to create or update .po file.
=head1 ARGUMENTS
=over 4
=item * C<-l> I
.po langunage file. Default to all existing .po files.
=item * C<-m> I
MojoMojo directory.
=back
=head1 OPTIONS
=over 4
=item * C<-p> I
perl binary executable path. You can also set C environment variable.
For example:
%> PERL=/path/to/my/perl ./update_po.sh ...
=item * C<-j>
Create json file only.
=item * C<-h>
Print out this help page and exit.
=back
=head1 EXAMPLES
%> sh update_po.sh
%> sh update_po.sh -l it -p /path/to/perl-5.11/bin/perl
%> sh update_po.sh -m /my/lib/MoyoMoyo -l de
=head1 AUTHOR
Robert Litwiniec (basic script)
Enrico Sorcinelli (script improvements and POD)
=head1 BUGS
Send bug reports and comments to: <...>.
In each report please include the version module, the Perl version, the Apache,
the mod_perl version and your SO. If the problem is browser dependent please
include also browser name and version.
=head1 SEE ALSO
MojoMojo
PODUSAGE
MojoMojo-1.12/script/mojomojo_server.pl 0000755 0001750 0001750 00000003324 13021751557 017627 0 ustar marcus marcus #!/usr/bin/env perl
BEGIN {
$ENV{CATALYST_SCRIPT_GEN} = 40;
}
use Catalyst::ScriptRunner;
Catalyst::ScriptRunner->run('MojoMojo', 'Server');
1;
=head1 NAME
mojomojo_server.pl - Catalyst Test Server
=head1 SYNOPSIS
mojomojo_server.pl [options]
-d --debug force debug mode
-f --fork handle each request in a new process
(defaults to false)
-? --help display this help and exits
-h --host host (defaults to all)
-p --port port (defaults to 3000)
-k --keepalive enable keep-alive connections
-r --restart restart when files get modified
(defaults to false)
-rd --restart_delay delay between file checks
(ignored if you have Linux::Inotify2 installed)
-rr --restart_regex regex match files that trigger
a restart when modified
(defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
--restart_directory the directory to search for
modified files, can be set multiple times
(defaults to '[SCRIPT_DIR]/..')
--follow_symlinks follow symlinks in search directories
(defaults to false. this is a no-op on Win32)
--background run the process in the background
--pidfile specify filename for pid file
See also:
perldoc Catalyst::Manual
perldoc Catalyst::Manual::Intro
=head1 DESCRIPTION
Run a Catalyst Testserver for this application.
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
MojoMojo-1.12/script/mojomojo.psgi 0000755 0001750 0001750 00000000140 13021751557 016561 0 ustar marcus marcus #!/usr/bin/env perl
use strict;
use warnings;
use MojoMojo;
my $app = MojoMojo->psgi_app(@_);
MojoMojo-1.12/README.md 0000644 0001750 0001750 00000001225 13021751557 014021 0 ustar marcus marcus # MojoMojo -- A Catalyst & DBIx::Class powered Wiki
[](https://gitter.im/mojomojo/mojomojo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://travis-ci.org/mojomojo/mojomojo)
Website located at http://mojomojo.org/
Installation: See lib/MojoMojo/Installation.pod
After Installation: Run script/mojomojo_server.pl to test the application.
License: This is free software. You can redistribute it and/or modify
it under the same terms as perl itself.
MojoMojo-1.12/Changes 0000644 0001750 0001750 00000054450 13105607075 014043 0 ustar marcus marcus 1.12 2017-05-13 15:46:50
- Switch syntax highlighting from Kate to prism.js (simonaw)
- Add missing dependencies, fix for tag deletion (simonaw)
- Remove obsolete unicode plugin
1.11 2014-10-25 20:24:00
- Apply patch from debian downstream to use current PSGI engine
- Add valid answer to registration captcha
- Fix rss bug from prev release (#68)
- Enable admin created users by default. (#90)
- Fix unicode issues in recent versions (Simon Wilper)
- Fix test suite (Simon Wilper):
1.10 2013-05-13 00:52:00
- Sort Google Search formatter params to fix issues with ordering. (#113)
- Applied POD test fixes from andk. ()#112)
- Fix redirect issue with set_lang. (#95)
- Fix inline not found to be a bit prettier. (#81)
- Add ^ to SyntaxHighlighter escaping. (#71)
- Also support rss content body. (#68)
1.09 2013-01-25 11:39
- Explicit false return in auto to avoid running actions for disabled users.
1.08 2013-01-06 11:39
- Fix links to github
1.07 2012-11-13 00:25
Bug fixes:
- Fix unicode test failure. (Iain Arnell)
1.06 2012-08-07 12:13
New features
- Simple yet effective anti-bot registration measure: signup question (dandv)
Bug fixes:
- Change include formatter to work with latest SubRequest
1.05 2011-09-14 04:20
New features:
- Script to delete inactive users and their page revisions, useful to clear spam (dandv)
- Navigation bar for /.users both at top and bottom of the page now (dandv)
- Logged in users can set local time zone (keedi).
Bug fixes:
- Check input for gallery pages (be numeric) and jsrpc/diff (page must exist). Fixes issue #83. (dandv)
- Ensure all 'jsrpc/diff' links have rel=nofollow. Avoid bogus search engine indexing. (dandv)
- Allow only logged-in users to export. Alleviates issue #39. (dandv)
- Prevent actions from being run on non-existent pages (e.g. '/bogus.export').
'.edit' is allowed, to create the page. Fixes issues #36 and #80. (dandv)
- Make redirect login content sensitive (f00lish)
1.04 2011-02-12 10:24
Improvements:
- Don't save a page when there is no change even if we push the save button.
This prevents the revision number from being incremented.
- Added gist formatter (bayashi)
Bug fixes:
- Amazon requires a secret key now to access its API.
Make the Amazon formatter aware of that.
- Google calendar formatter was always setting precompile_off = 1
(even when it wasn't a calendar page).
1.03 2011-01-12 11:36
New features:
- Google Calendar formatter (jcockhren)
Bug fixes:
- Really fix tagged descendants by date for postgres
Improvements:
- Korean Translation
- popular account link formatter via {{id:$service $account_name}}
e.g. {{id::cpan bayashi}} gets rendered as bayashi
- Show tags only once for 'Popular' and 'My' categories
1.02 2010-08-30 04:20
Bug fixes:
- Fix tagged descendants by date for postgresql
- Fix root setting to actually be used.
Improvements:
- Use precompiled content when building search results
when precompiled is non-empty. This speeds up search results
a butt-load and then some. Thanks to and .
Migration:
- Moved to using KinoSearch1 instead of KinoSearch. The former has
replaced the latter.
1.01 2010-05-26 10:04:20
New features:
- Google search formatter (bayashi)
- Utility scripts to import/export raw page markup from file/to STDOUT (dandv)
- Add wikipedia link generator. (bayashi)
Bug fixes:
- Minor CSS fix (tcaine)
- default uri_for_static to use uri_for to make it work correctly for non-root-mounted wikis.
- Restrict page deletion to admin users only
Improvements:
- All Methods/subs now documented
- POD Coverage test on by default
1.00 2010-05-09 00:04:20
New Features:
- Create a default page for new users.
- Replaced shrunken-head image with a "Stop" sign (dandv)
Bug fixes:
- Fix WantedLink to use normalize_page to match links
- Removed File::Slurp dependency after removing it from Text::(Multi)Markdown
because it fails installation under Strawberry Perl (dandv)
- IRC Formatter auto-color nicknames (issue #27) (linio) [his last commit, RIP now]
- Attachments size in Page info is now correctly displayed (issue #53) (linio)
- Remove 'Alerts' from Syntax Highlight list - it's Kate's hidden module (issue #52) (linio)
- Fixed formatter_all_textile tests to work without Syntax plugin
Improvements:
- Refine POD so lintian is happy (debian build tool)
- Add unicode code option to DB connect string. This allows us to remove
the use of UTF8Columns which is deprecated. Hook in CHARTSET=utf8 for MySQL deploy
Misc:
- Test::Notabs is now optional
- HTML::Toc is now required
0.999042 2009-12-01 21:42:00
Syntax change - please update affected wiki pages:
- {{include }} and {{feed }} instead of the implicit syntax
{{}} and {{feed://}}
New Features:
- Added (versioned) page renaming in Page Info (dandv)
- Add delete page function
- Replaced String::Diff with word diff (Ryan52)
- e-mail addresses in user .profile-s are now protected against spambots (dandv)
Bug fixes:
- fixed inserting images via the toolbar after markdown="1" support (dandv)
0.999041 2009-10-26 11:55:00
New features:
- add markdown="1" to block-level HTML elements to interpret Markdown (dandv)
Translation:
- Italian. MojoMojo ora parla italiano (enrico)
Bug fixes:
- Exports now export the entire subtree (dandv)
- Sub pages do not show pages without view permission (linio)
- Fixes for Pg Compability (depesz)
- Users 'Active' field now shows users not validated yet as inactive (linio)
- Login is now page-sensitive (marcus)
- Changed RSS Formatter to use entry summary instead of body (marcus)
- Fixed issue with incorrectly calculated cloud size (linio)
Documentation:
- improved and centralized installation docs into lib/MojoMojo/Installation.pod
0.999040 2009-09-04 19:53:00
- Format content body and store in content.precompile
Use this precompiled body when available for page delivery (see page/view.tt).
/.precompile_pages action for precompiling all page versions.
This action can take a few minutes for the Catalyst wiki (~2000 page versions).
- Fixed [[child]] and [[../sibling]] display bug when first creating a page.
Adjust tests to reflect that [[../sibling]] formats to parent/sibling
instead of ../sibling. (mateu)
- Simplified and improved sub-pages. Speed and layout enhanced. (mateu)
- Made subtree KinoSearch work (mateu)
- Added paging for .list (dandv)
- Catapulse theme (dab)
- Madrid.pm theme (diegok)
- More español (diegok)
- Updated jQuery inplace editor and related code; fixed '&'-encoding bug
which caused any text after the '&' to be lost when editing in-place (dandv)
- Simplified 404 page handling in suggest.tt (mateu)
- No cookie for anonymous user requests, and cookie test (mateu)
- Removed PageCache (mateu)
- .rollback now only works via POST (dandv)
- Fixed bug in MojoMojo::get_permissions_data (uninitialized hashref) (mateu)
- Main formatter now guaranteed to end the content with *one* newline (dandv)
- Remove some obsolete crud (dandv/marcus)
0.999033 2009-08-14 12:40:00 UTC
- Fixed security issue allowing anonymous users to delete attachments (dandv)
- Cleared the RT bug queue (5 bugs) (dandv)
- Added 'resource' metadata to META.yml to indicate bug tracking, source code
repo and mailing list URLs at http://search.cpan.org/dist/MojoMojo (dandv)
- Added 40+ tests to t/c/{attachment, page_edit, user}.t, fixed email.t to
restore admin's password, better handling of missing test prereqs. (dandv)
- Refactored C::Attachment, MojoMojoTestSchema, attachments/list.tt (dandv)
- Bump up test_requires Test::More version to 0.88 so we can use done_testing()
0.999032 2009-08-02 22:39:00
- The page cache plugin was caching the empty body before a redirect, and
then using that for further requests of the same page. Arguably, this is a
bug in PageCache, but for now it is fixed here. (Dave Rolsky)
- Logging out of a wiki which did not allow anonymous viewing left the user
able to view the last page they were on. Now they are immediately taken to
the login screen. (Dave Rolsky)
- Reorganized the navigation menus to try to group site-wide and
page-specific options together. Top-level menu links (like Recent and
Tags) are now always site-wide. For path-specific versions, go to the "Sub
pages" view of a path. (Dave Rolsky)
- The gallery link was broken (Dave Rolsky)
- Redesigned the attachments list as a nicely formatted table. Images now
include a thumbnail preview, and the actions available for each attachment
are context-sensitive based on the type of attachment and user
permissions. (Dave Rolsky)
- Attachments are now viewable without going to the edit form first (Dave
Rolsky)
- The "insert link" option for an attachment went to a slightly broken
version of the edit form (Dave Rolsky)
- The revisions list is now a nicely formatted table (Dave Rolsky)
- mojomojo_spawn_db.pl now has a --help option and takes CLI arguments for
all settings (Dave Rolsky)
- mojomojo_spawn_db won't attempt deploy if DB already exists (mateu)
- MojoMojo warns on startup if mojomojo_spawn_db.pl was not run, and all
requests return a 404 (mateu)
- A newly created database now has an anonymous user preference set. Without
this, anonymous users are not supported properly (Dave Rolsky)
- Recent changes now shows users' names, not their logins (Dave Rolsky)
- The users list in the admin section only showed the first 20 users. Added
paging links so you can browse all of them. (Dave Rolsky)
- The users list now shows active users first (Dave Rolsky)
- A user's active flag is now shown as "yes" or "no" in the UI (Dave Rolsky)
- Fixed markup inserted by edit toolbar buttons for images and links (dandv)
- The edit page incorrectly labeled a button "Create and View" for a page
that only had one revision, when it should have been labeled "Save and
View" (Dave Rolsky)
- In edit mode, the preview & form should now always fit in the browser
viewport together without scrolling, in both horizontal & vertical split
modes. (Dave Rolsky)
- Revised MultiMarkdown syntax help tips (Dave Rolsky)
- Removed the page delete action, which was broken with PostgreSQL, and not
checking permissions. This will come back in a better form in the future
(Dave Rolsky)
- HTML entities are now escaped in code blocks and "# comments" are rendered
correctly in Perl syntax blocks (GitHub issues #41, #11) (dandv)
- Textile no longer converts non-ASCII characters into HTML entities (dandv)
- Fixed Catalyst theme so that Save buttons are visible (dandv)
- All methods are documented in POD with =head2 instead of =item, so that
they appear in the module's TOC. Uniform LICENSE for all modules. (dandv)
- Major documentation updates to Prefs.pod, Schema::Result*::Page*,
Formatter/WRITING YOUR OWN FORMATTER, (dandv)
- Reformatted Changes, but you probably noticed that by now (dandv)
- Move some settings into MojoMojo.pm to make mojomojo.conf more
friendly. (marcus)
- Experimental basic search and replace script. (mateu)
0.999031 2009-07-26 15:00:00
- Sane default for FastMmap sharefile.
- Change to use the current cache as Session store.
- Fix comments (NacMac)
- Add license for debian packaging
- Fix incorred URL displayed by the error page (pre_hacked_url)
- POD Fixes
0.999030 2009-07-18 20:25:00
- Fixed vertical split mode to stay side-by-side (mateu, dandv @ YAPC10)
- Updated Catalyst theme
- Defang remote img src - whitelist if you want to allow them
- Fixed profile user name when in view mode
- Linked from was moved from page/bottomnav.tt to page/info.tt
- Forked Defang to Declaw included in our distribution for now
- Fix Args("") issue
0.999029 2009-05-09 23:59:35
- Actual content added to [[Help]]
- Tests: XSS, Defang, and more Textile
- Defang runs after main formatter instead of before
- HTML::Scrub replaced with HTML::Defang for XSS and cleaning HTML
- Markdown now default formatter instead of Textile. Reasons at
http://mojomojo.org/documentation/cheatsheet#Choosing_between_Textile2_and_MultiMarkdown
- Update page creation to be compatible with latest DBIC (Bernhard Graf)
- Additional theme colors: grey, purple, pink
- Add Amazon, RSS, Emote (optional) formatters to main distribution
- Many new tests, including live tests of chained formatters (dandv)
- Main formatters (Textile, MultiMarkdown) are independent and clearly dispatched now (dandv)
- Switch email to use Catalyst::View::Email and tests for such (rafl)
0.999028 2009-04-23 11:58:00
- Use oneshot timer instead of only_every to trigger preview update
- Make .profile smarter and link to it from .recent
- Clean up extra // in .recent URLs
- New formatter: {{cpan Some::Module}} auto-hyperlinks (dandv)
- Use package scope for $kate syntax highlight object to reduce memory leak (mateu)
- Use jquery cookie to make split edit state sticky
- Added maximization of the edit page (linio)
- Instant edit window split mode toggle (horiz./vert.) preserves content (linio)
- Drop-downs for syntax highlighters, plugins and formatters (linio)
- Set default theme directory when theme preference is NULL
- Add inline view
- reCAPTCHA support (linio)
- localize: help message, admin home page, anonymous name and login ('anonymous coward')
- Fixed displaying multiple user roles
- Now FormFu label_loc can be localized by MojoMojo I18N
- MojoMojo habla español (guikubivan)
- Add polish translation (linio)
- Improved wikilinks (UTF-8, parentheses, anchors) and added tests
- Fixes for paragraphs in toolbar (linio)
- Add Catalan language support (mateu)
- expand_wikiword() only replaces underscores with spaces now.
- match display name of page title, breadcrumb final node, and search results
- Make search results byline for last edit author
- Limit preview width so that long lines don't squash edit area
- Fix security check for attachments
- Add Catalyst theme
- Add tabs to "Syntax help" popup (batman)
- Improved "Syntax help": does not cover textarea and features tabbed navigation (batman)
- Improved templates: removed js, inline css and most templates use wrapper (batman)
- Changed font-size: Removed ever px-based font-size, and set default to 0.9em (batman)
- Improved w3c validation (batman)
- improved navigation, removed unused and out of place links (dandv)
0.999027 2009-01-30 23:17:00
- Fixed broken authors (users) pager links
- Added "Split Edit" for side-by-side view/edit
- Switched from Cache::Store::Memory to Cache::FastMmap
- Change search results by link to link to ROOT/$author instead of author at page level
- Show bread crumb path on search results, linking the terminal node
- List one link for each page by an author via .users (instead of all revisions)
- Support merge for overlapping edits
- Add Japanese translation
0.999026 2009-01-08 00:21:00
- Fix a JavaScript issue with insert attachment
- Fix comments formatter
- Make wantedpage list only apply to current subtree
- Make tagged_descendant work for PostgreSQL
- Changed default search to AND using default_boolop of QueryParser
- Edit search_inline.tt to display like search.tt
- Improved search result layout and added content creation date
- Search results sorted by Kinosearch hit object score
- Fix create photo for pics with EXIF
- Fixed chars count in page info
- Resolve some fastcgi encoding issues
- Link to revision in info page
0.999025 2009-01-04 23:39:00
- Updated language selector, added FR to choices
- Improved search setup error handling on startup
- New formatter: SyntaxHighlight
- Fixed /.users to show logout-link correctly if user is logged in
0.999024 2008-12-31 18:04:00
- Get preference key/value from cache if possible
- Fix wanted pages
- Fix password dialog
- Autocomplete for tags (Sachin Sebastian)
- Update SWFUpload to support flash 10. Add plain fallback
- Resolve a unicode issue in some installations when editing text
- Add support for i18n (no, fr, de translations so far)
*Warning* Forms will not be localized correctly with Locale::Maketext
1.10 and above.
0.999023 2008-11-23 10:35:00
- Added GUI Permissions editor (nilsonsfj)
- Finished porting MojoMojo to HTML::FormFu
- Added TOC plugin using HTML::GenToc + anchor names that are
XHTML compliant and human/SEO-friendly (dandv)
- Fixed formatting of profile
- Fix recent list to not display implicit links
- Fix bind issue in .list
- Set noindex for most pages
0.999022 2008-11-14 17:28:00
- Fix validation check (sachinjsk)
- Fix javascript toolbar
- Fix various Pg specific issues
- Change to use flash uploader.
- Update search not to cache objects
- Fix unicode issue with preview
- rewrite javascript to use jquery, remove inline JS
- Fix indexer to use correct content version
0.999021 2008-11-01 01:47:00
- Move search to KinoSearch
- Make startup checks for permissions
- Remove BindLex
- Fix lingering 'query' search name which should be 'q'
- add Edit Pages link to navbar
- Some spawn DB fixes
- Fix session config, removed colonos (plu)
- liquid layout for less than 1024px wide view
0.999020 2008-07-28 15:45:00
- Replaced favicon (soulchild)
- Make attachment_dir configurable
- Major CSS/XHTML overhaul (soulchild)
- Update default expires for session to 1 week
- default to searchtype=all (mateu)
- Fix highlight causing layout being broken (plu)
- Replace Crypt::PassGen with Text::Password::Pronounceable
- Make mech tests optional
0.999019 2008-07-19 19:45:00
- Eval plucene to let mojomojo work if it fails
- Support for re-requesting validation mails
- Fix for TT syntax error
- Fix recover password (plu)
- Fix prefs button label
- Fix: /foo.photo/1 was broken (plu)
- Add new config option to enforce login:
enforce_login 1 (plu)
0.999018 2008-07-16 19:45:00
- Fix selenium tests
- Add redirect formatter
- Update dependencies
- Fix change password after switching to hashed passwords (plu)
- Fix warning in navbar.tt
- Fix: If you're logged in, page doesn't exist yet and you don't
have the permission to create it there was an exception thrown (plu)
- Add table CSS (plu)
- Restrict search results depending on permissions (plu)
0.999017 2008-07-09 11:59:00
- Unbreak search
- Add a default from address for mail
0.999016 2008-06-29 15:01:00
- Limit recent feed to 20 entries
- Add option to disable search
- Make implicit wikiword linking disabled by default
- Hash passwords.
WARNING! if you have an old installtion, you will need to run
./script/hash_passwords.pl to hash the passwords for an existing
install. Don't run this more than once! (Script should complain tho)
0.999015 2008-05-03 18:01:00
- patches from linio with user-related bugfixes
- fix missing dependencies
0.999014 2008-04-19 00:08:00
- Fixed preview for Unicode
- Fixed styling issues with lists/strong/em
- Redirect to edit for missing pages higher up in the path
- Respect formatter pref in edithelp/toolbar
- Markdown formatter toolbar
- Recover password function
0.999013 2008-02-06 00:08:00
- renovated skin (arne)
- syntax fixes, registration/login (jshirley)
- fix email validation template (jshirley)
0.999012 2008-02-06 00:08:00
- Fix multiline pre render error
- Further updates for layout
- Flexible auth framework added (No UI yet) (jayk)
- More validation fixes
- Updated dependencies
- Updated auth to use new plugins
- Updated user profile
0.999011 2008-01-20 20:16:00
- uri_for_static for static assets
- Fix header layout
- Fix tags in gallery view when not logged in
- Fix render bug in preview
- Various markup fixes (gphat)
- Escape wiki formatting inside pre
- Markdown formatter now using MultiMarkdown
- Fix JS for highlight + focus in register
- Fixed profile, added Last Changed.
0.999010 2008-01-20 20:16:00
- Fix registration form
- Update several base _ ... to uri_for
- Put admin link on every page if admin
- Fix incorrect URL for change password
- Update minimum version for Controller::HTML::Widget
0.999008 2007-11-12 22:43:00
- Fix AJAX for tagging
- Fix tag galleries
- Fix AJAX for user activation
0.999007 2007-09-24 00:01:00
- Really fix deploy script for MySQL
- Fix deploy script for PostgreSQL
- Refactor test data so it only exists once
- Updated main class POD (removed developer docs and added to description)
0.999006 2007-09-23 12:12:00
- Fix deploy script to work with mysql constraints
- Fix comment formatter in preview
- Updated photo exif formatting
- Renamed photo action from p to photo
0.999005 2007-09-19 21:31:00
- Better error reporting for upload dir
- More dependency fixes
0.999005 2007-09-18 09:56:04
- Really fix tests if Markdown isn't installed
0.999004 2007-09-18 09:29:04
- Create t/var/upload if needed
- Prefs form redone in FormFu
- Use Mech to test page editing
- Fixed test suite again
- Restore search
- Bad scope for attachment dir
0.999003 2007-09-13 14:32:00
- Fixed Comment formatter
- Fixed Gallery tags (Invalid constraint)
- Actually remove all the c.prototype stuff (Unbreaking all the JS)
- Fix preferences link
- Fix links in navbar and header
- Made the insert attachment system template based and easily extensible
- Set up default page for admin
0.999002 2007-09-12 23:08:00
- Fixed relative linking ([[../Sibling]])/
- Cleaned up attachments
- Wrote database tests for attachments
- Add Formatter Base Class
- Add support for different Primary Formatters
- Update default to be Path, rather than Private
- Fix tests is t/c/
- More documentation
- Updated Installation instructions. lib/MojoMojo/Installation.pod is
now the master.
0.999001 2007-08-29 16:29:00
- Initial Release. There are bugs, but the basic functionality works,
and the test suite passes all tests here. Please contribute
tests for bugs you want fixed.
Once we fix it all, we'll consider it 1.0
MojoMojo-1.12/MANIFEST 0000644 0001750 0001750 00000037410 13105607166 013677 0 ustar marcus marcus app.psgi
Changes
dotcloud.yml
inc/File/Copy/Recursive.pm
inc/Module/AutoInstall.pm
inc/Module/Install.pm
inc/Module/Install/AutoInstall.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Catalyst.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Include.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Scripts.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
INSTALL
lib/MojoMojo.pm
lib/MojoMojo/Controller/Admin.pm
lib/MojoMojo/Controller/Attachment.pm
lib/MojoMojo/Controller/Comment.pm
lib/MojoMojo/Controller/Export.pm
lib/MojoMojo/Controller/Gallery.pm
lib/MojoMojo/Controller/Image.pm
lib/MojoMojo/Controller/Journal.pm
lib/MojoMojo/Controller/JSON.pm
lib/MojoMojo/Controller/Jsrpc.pm
lib/MojoMojo/Controller/Page.pm
lib/MojoMojo/Controller/PageAdmin.pm
lib/MojoMojo/Controller/Root.pm
lib/MojoMojo/Controller/Tag.pm
lib/MojoMojo/Controller/User.pm
lib/MojoMojo/Declaw.pm
lib/MojoMojo/Extension.pm
lib/MojoMojo/Extensions/Counter.pm
lib/MojoMojo/Formatter.pm
lib/MojoMojo/Formatter/Amazon.pm
lib/MojoMojo/Formatter/Comment.pm
lib/MojoMojo/Formatter/CPANHyperlink.pm
lib/MojoMojo/Formatter/Defang.pm
lib/MojoMojo/Formatter/Dir.pm
lib/MojoMojo/Formatter/DocBook.pm
lib/MojoMojo/Formatter/DocBook/Colorize.pm
lib/MojoMojo/Formatter/Emote.pm
lib/MojoMojo/Formatter/File.pm
lib/MojoMojo/Formatter/File/DocBook.pm
lib/MojoMojo/Formatter/File/Image.pm
lib/MojoMojo/Formatter/File/Pod.pm
lib/MojoMojo/Formatter/File/Text.pm
lib/MojoMojo/Formatter/Gist.pm
lib/MojoMojo/Formatter/GoogleCalendar.pm
lib/MojoMojo/Formatter/GoogleSearch.pm
lib/MojoMojo/Formatter/IDLink.pm
lib/MojoMojo/Formatter/Include.pm
lib/MojoMojo/Formatter/IRCLog.pm
lib/MojoMojo/Formatter/Main.pm
lib/MojoMojo/Formatter/Markdown.pm
lib/MojoMojo/Formatter/Pod.pm
lib/MojoMojo/Formatter/Redirect.pm
lib/MojoMojo/Formatter/RSS.pm
lib/MojoMojo/Formatter/SyntaxHighlight.pm
lib/MojoMojo/Formatter/Text.pm
lib/MojoMojo/Formatter/Textile.pm
lib/MojoMojo/Formatter/TOC.pm
lib/MojoMojo/Formatter/Wiki.pm
lib/MojoMojo/Formatter/WikipediaLink.pm
lib/MojoMojo/Formatter/YouTube.pm
lib/MojoMojo/I18N.pm
lib/MojoMojo/I18N/ca.js.po
lib/MojoMojo/I18N/ca.po
lib/MojoMojo/I18N/de.js.po
lib/MojoMojo/I18N/de.po
lib/MojoMojo/I18N/en.js.po
lib/MojoMojo/I18N/en.po
lib/MojoMojo/I18N/es.js.po
lib/MojoMojo/I18N/es.po
lib/MojoMojo/I18N/fr.js.po
lib/MojoMojo/I18N/fr.po
lib/MojoMojo/I18N/it.js.po
lib/MojoMojo/I18N/it.po
lib/MojoMojo/I18N/ja.js.po
lib/MojoMojo/I18N/ja.po
lib/MojoMojo/I18N/ko.po
lib/MojoMojo/I18N/no.js.po
lib/MojoMojo/I18N/no.po
lib/MojoMojo/I18N/pl.js.po
lib/MojoMojo/I18N/pl.po
lib/MojoMojo/I18N/ru.js.po
lib/MojoMojo/I18N/ru.po
lib/MojoMojo/Installation.pod
lib/MojoMojo/Model/DBIC.pm
lib/MojoMojo/Model/Search.pm
lib/MojoMojo/Model/Themes.pm
lib/MojoMojo/Prefs.pod
lib/MojoMojo/Schema.pm
lib/MojoMojo/Schema/Base/Result.pm
lib/MojoMojo/Schema/Base/ResultSet.pm
lib/MojoMojo/Schema/Result/Attachment.pm
lib/MojoMojo/Schema/Result/Comment.pm
lib/MojoMojo/Schema/Result/Content.pm
lib/MojoMojo/Schema/Result/Entry.pm
lib/MojoMojo/Schema/Result/Journal.pm
lib/MojoMojo/Schema/Result/Link.pm
lib/MojoMojo/Schema/Result/Page.pm
lib/MojoMojo/Schema/Result/PageVersion.pm
lib/MojoMojo/Schema/Result/PathPermissions.pm
lib/MojoMojo/Schema/Result/Person.pm
lib/MojoMojo/Schema/Result/Photo.pm
lib/MojoMojo/Schema/Result/Preference.pm
lib/MojoMojo/Schema/Result/Role.pm
lib/MojoMojo/Schema/Result/RoleMember.pm
lib/MojoMojo/Schema/Result/RolePrivilege.pm
lib/MojoMojo/Schema/Result/Tag.pm
lib/MojoMojo/Schema/Result/WantedPage.pm
lib/MojoMojo/Schema/ResultSet/Attachment.pm
lib/MojoMojo/Schema/ResultSet/Content.pm
lib/MojoMojo/Schema/ResultSet/Page.pm
lib/MojoMojo/Schema/ResultSet/Person.pm
lib/MojoMojo/Schema/ResultSet/Role.pm
lib/MojoMojo/Schema/ResultSet/Tag.pm
lib/MojoMojo/View/Email.pm
lib/MojoMojo/View/JSON.pm
lib/MojoMojo/View/TT.pm
lib/MojoMojo/WordDiff.pm
lib/Text/SmartyPants.pm
lib/Text/Wikispaces2Markdown.pm
Makefile.PL
MANIFEST This list of files
META.yml
mojomojo.conf
MYMETA.json
MYMETA.yml
README.md
resources/logo/LinkedIn_logo.png
resources/logo/logo64x64.png
resources/logo/mmlogovector.psd
root/base/admin/create_role.tt
root/base/admin/edit_role.tt
root/base/admin/role.tt
root/base/admin/role_form.tt
root/base/admin/settings.tt
root/base/admin/toplinks.tt
root/base/admin/update_user.tt
root/base/admin/user.tt
root/base/attachments/list.tt
root/base/breadcrumbs.tt
root/base/child_menu.tt
root/base/comment.tt
root/base/comment/login.tt
root/base/comment/post.tt
root/base/edithelp.tt
root/base/edithelp/main.tt
root/base/edithelp/markdown.tt
root/base/edithelp/textile.tt
root/base/export.tt
root/base/extensions/counter.tt
root/base/feeds.tt
root/base/footer.tt
root/base/gallery.tt
root/base/gallery/cloud.tt
root/base/gallery/footer.tt
root/base/gallery/imginfo.tt
root/base/gallery/pager.tt
root/base/gallery/photo.tt
root/base/gallery/photo_info.tt
root/base/gallery/tags.tt
root/base/global.tt
root/base/header.tt
root/base/mail/reset_password.tt
root/base/mail/validate.tt
root/base/message.tt
root/base/mimetypes/default.tt
root/base/mimetypes/image.tt
root/base/navbar.tt
root/base/page/addtags.tt
root/base/page/atom.tt
root/base/page/attachments.tt
root/base/page/bottomnav.tt
root/base/page/delete.tt
root/base/page/deleted.tt
root/base/page/edit.tt
root/base/page/editbar.tt
root/base/page/info.tt
root/base/page/inline.tt
root/base/page/inline_image.tt
root/base/page/insert.tt
root/base/page/list.tt
root/base/page/permissions.tt
root/base/page/print.tt
root/base/page/recent.tt
root/base/page/rollback.tt
root/base/page/rss.tt
root/base/page/rss_full.tt
root/base/page/search.tt
root/base/page/search_inline.tt
root/base/page/subtree.tt
root/base/page/suggest.tt
root/base/page/tags.tt
root/base/page/view.tt
root/base/page/wrapper.tt
root/base/pager.tt
root/base/rest/page/recent.tt
root/base/rest/page/view.tt
root/base/sidebar.tt
root/base/tag/cloud.tt
root/base/tag/list.tt
root/base/tag/recent.tt
root/base/this_page_link.tt
root/base/top.tt
root/base/user/editprofile.tt
root/base/user/list.tt
root/base/user/login.tt
root/base/user/prefs.tt
root/base/user/profile.tt
root/base/user/recover_pass.tt
root/base/user/register.tt
root/base/user/user_search.tt
root/base/user/validate.tt
root/forms/admin/delete.yml
root/forms/admin/role_form.yml
root/forms/admin/settings.yml
root/forms/comment/comment.yml
root/forms/defaults.yml
root/forms/pageadmin/edit.yml
root/forms/user/editprofile.yml
root/forms/user/login.yml
root/forms/user/password.yml
root/forms/user/prefs.yml
root/forms/user/register.yml
root/static/catalyst.png
root/static/Crystal_Clear_action_stop.png
root/static/css/jquery.autocomplete.css
root/static/css/prism.css
root/static/css/progress.css
root/static/emote/47_47.gif
root/static/emote/48_48.gif
root/static/emote/49_49.gif
root/static/emote/50_50.gif
root/static/emote/51_51.gif
root/static/emote/52_52.gif
root/static/emote/53_53.gif
root/static/emote/55_55.gif
root/static/emote/56_56.gif
root/static/emote/57_57.gif
root/static/emote/58_58.gif
root/static/emote/59_59.gif
root/static/emote/60_60.gif
root/static/emote/61_61.gif
root/static/emote/62_62.gif
root/static/emote/63_63.gif
root/static/emote/64_64.gif
root/static/emote/66_66.gif
root/static/emote/69_69.gif
root/static/emote/70_70.gif
root/static/emote/71_71.gif
root/static/emote/72_72.gif
root/static/emote/73_73.gif
root/static/emote/74_74.gif
root/static/emote/75_75.gif
root/static/emote/77_77.gif
root/static/emote/angel_smile.gif
root/static/emote/angry_smile.gif
root/static/emote/bat.gif
root/static/emote/beer_mug.gif
root/static/emote/broken_heart.gif
root/static/emote/cake.gif
root/static/emote/camera.gif
root/static/emote/cat.gif
root/static/emote/clock.gif
root/static/emote/coffee.gif
root/static/emote/confused_smile.gif
root/static/emote/cry_smile.gif
root/static/emote/devil_smile.gif
root/static/emote/dog.gif
root/static/emote/envelope.gif
root/static/emote/film.gif
root/static/emote/get.pl
root/static/emote/girl.gif
root/static/emote/girl_hug.gif
root/static/emote/guy.gif
root/static/emote/guy_hug.gif
root/static/emote/heart.gif
root/static/emote/kiss.gif
root/static/emote/lightbulb.gif
root/static/emote/martini.gif
root/static/emote/messenger.gif
root/static/emote/moon.gif
root/static/emote/note.gif
root/static/emote/omg_smile.gif
root/static/emote/phone.gif
root/static/emote/present.gif
root/static/emote/red_smile.gif
root/static/emote/regular_smile.gif
root/static/emote/rose.gif
root/static/emote/sad_smile.gif
root/static/emote/shades_smile.gif
root/static/emote/star.gif
root/static/emote/teeth_smile.gif
root/static/emote/thumbs_down.gif
root/static/emote/thumbs_up.gif
root/static/emote/tongue_smile.gif
root/static/emote/what_smile.gif
root/static/emote/wilted_rose.gif
root/static/emote/wink_smile.gif
root/static/favicon.ico
root/static/flash/swfupload.swf
root/static/flash/swfupload_f8.swf
root/static/flash/swfupload_f9.swf
root/static/gfx/background.jpg
root/static/gfx/dropshadow.png
root/static/gfx/header-long.png
root/static/gfx/header.png
root/static/gfx/maximize_width_1.png
root/static/gfx/maximize_width_2.png
root/static/gfx/poweredby.png
root/static/gfx/uploadbutton.png
root/static/js/edit.js
root/static/js/jquery.autocomplete.js
root/static/js/jquery.cookies.2.0.1.min.js
root/static/js/jquery.editinplace.js
root/static/js/jquery.form.js
root/static/js/jquery.js
root/static/js/jquery.livequery.js
root/static/js/prism.js
root/static/js/swfupload.js
root/static/js/swfupload.queue.js
root/static/js/wiki.js
root/static/json/ca.po.json
root/static/json/de.po.json
root/static/json/en.po.json
root/static/json/es.po.json
root/static/json/fr.po.json
root/static/json/it.po.json
root/static/json/ja.po.json
root/static/json/no.po.json
root/static/json/pl.po.json
root/static/json/ru.po.json
root/static/mm-logo.png
root/static/mojomojo.css
root/static/overrides.css
root/static/pod.css
root/static/reset.css
root/static/robots.txt
root/static/spinner.gif
root/static/themes/catalyst/generic.css
root/static/themes/catalyst/images/global/box_bg_gray.png
root/static/themes/catalyst/images/global/box_bg_gray_bottom.png
root/static/themes/catalyst/images/global/box_bg_gray_top_635.png
root/static/themes/catalyst/images/global/box_bg_left.png
root/static/themes/catalyst/images/global/box_icon_deployment.png
root/static/themes/catalyst/images/global/box_icon_development.png
root/static/themes/catalyst/images/global/box_icon_scalability.png
root/static/themes/catalyst/images/global/icon_control.png
root/static/themes/catalyst/images/global/icon_model.png
root/static/themes/catalyst/images/global/icon_view.png
root/static/themes/catalyst/images/global/list_bullet.png
root/static/themes/catalyst/images/layout/body_bg.png
root/static/themes/catalyst/images/layout/catalyst_130pix.html
root/static/themes/catalyst/images/layout/catalyst_170pix.png
root/static/themes/catalyst/images/layout/header_bg_catalyst.png
root/static/themes/catalyst/images/layout/header_bg_control.png
root/static/themes/catalyst/images/layout/header_bg_documentation.png
root/static/themes/catalyst/images/layout/header_bg_model.png
root/static/themes/catalyst/images/layout/header_bg_view.png
root/static/themes/catalyst/images/layout/menu_global_bg_left.png
root/static/themes/catalyst/images/layout/menu_global_bg_right.png
root/static/themes/catalyst/images/planet/ico-external.gif
root/static/themes/catalyst/images/planet/ico-feed.gif
root/static/themes/catalyst/layout.css
root/static/themes/catalyst/menu_global_bg_left.png
root/static/themes/catalyst/planet.css
root/static/themes/catalyst/theme.css
root/static/themes/catapulse/config.rb
root/static/themes/catapulse/ie.css
root/static/themes/catapulse/images/bg.gif
root/static/themes/catapulse/images/catalyst_logo.png
root/static/themes/catapulse/images/grid.png
root/static/themes/catapulse/print.css
root/static/themes/catapulse/src/ie.sass
root/static/themes/catapulse/src/print.sass
root/static/themes/catapulse/src/theme.sass
root/static/themes/catapulse/theme.css
root/static/themes/default/images/background.jpg
root/static/themes/default/images/header.png
root/static/themes/default/images/mmlogo.png
root/static/themes/default/theme.css
root/static/themes/epo/images/background.png
root/static/themes/epo/images/epologo.png
root/static/themes/epo/images/nordaaker.png
root/static/themes/epo/images/nordadiffus.png
root/static/themes/epo/theme.css
root/static/themes/grey-scale/images/mmlogo.png
root/static/themes/grey-scale/theme.css
root/static/themes/madrid-pm/favicon.ico
root/static/themes/madrid-pm/images/onion-madrid.png
root/static/themes/madrid-pm/theme.css
root/static/themes/nordaaker/images/background.png
root/static/themes/nordaaker/images/nordaaker.png
root/static/themes/nordaaker/images/nordadiffus.png
root/static/themes/nordaaker/theme.css
root/static/themes/pink-lady/images/mmlogo.png
root/static/themes/pink-lady/theme.css
root/static/themes/purple-pleasure/images/mmlogo.png
root/static/themes/purple-pleasure/js/theme.js
root/static/themes/purple-pleasure/theme.css
root/static/toolbar/big.png
root/static/toolbar/bold.png
root/static/toolbar/center.png
root/static/toolbar/code.png
root/static/toolbar/drawing.png
root/static/toolbar/drawing_left.png
root/static/toolbar/drawing_right.png
root/static/toolbar/heading.png
root/static/toolbar/hyperlink.png
root/static/toolbar/insert_table.png
root/static/toolbar/italic.png
root/static/toolbar/justify.png
root/static/toolbar/left.png
root/static/toolbar/list_bullet.png
root/static/toolbar/list_enum.png
root/static/toolbar/preformatted.png
root/static/toolbar/quote.png
root/static/toolbar/right.png
root/static/toolbar/small.png
root/static/toolbar/strikethrough.png
root/static/toolbar/sub.png
root/static/toolbar/super.png
root/static/toolbar/wikilink.png
root/themes/catalyst/footer.tt
root/themes/catalyst/top.tt
root/themes/madrid-pm/header.tt
root/themes/madrid-pm/navbar.tt
root/themes/madrid-pm/top.tt
root/themes/pink-lady/footer.tt
root/themes/pink-lady/page/tags.tt
root/themes/purple-pleasure/footer.tt
root/themes/purple-pleasure/header.tt
root/themes/purple-pleasure/navbar.tt
root/themes/purple-pleasure/page/tags.tt
root/themes/purple-pleasure/page/wrapper.tt
script/mojomojo.psgi
script/mojomojo_cgi.pl
script/mojomojo_create.pl
script/mojomojo_fastcgi.pl
script/mojomojo_fastcgi_manage.pl
script/mojomojo_fastcgi_manage.yml
script/mojomojo_server.pl
script/mojomojo_spawn_db.pl
script/mojomojo_test.pl
script/mojomojo_update_db.pl
script/update_po.sh
script/util/bust_cache.pl
script/util/dbk2xhtml.pl
script/util/delete_inactive_users.pl
script/util/delete_page.pl
script/util/dir2mojomojo.pl
script/util/dump_content.pl
script/util/hash_passwords.pl
script/util/import_content.pl
script/util/init_db_re.pl
script/util/search_and_replace.pl
script/util/textile2markdown.pl
script/util/wikispaces2markdown.pl
t/01app.t
t/02pod.t
t/03podcoverage.t
t/04context.t
t/05cookie.t
t/app/mojomojo.db
t/app/mojomojo.yml
t/app_leak.t
t/c/attachment.t
t/c/bottomnav.t
t/c/comment.t
t/c/email.t
t/c/image.t
t/c/jsrpc.t
t/c/page.t
t/c/page_delete.t
t/c/page_edit.t
t/c/tag.t
t/c/toplinks.t
t/c/user.t
t/defang_xss.t
t/error_page.t
t/formatter_all_markdown.t
t/formatter_all_textile.t
t/formatter_amazon.t
t/formatter_comment.t
t/formatter_cpanhyperlink.t
t/formatter_defang.t
t/formatter_dir.t
t/formatter_docbook.t
t/formatter_file.t
t/formatter_gist.t
t/formatter_googlesearch.t
t/formatter_idlink.t
t/formatter_include.t
t/formatter_irclog.t
t/formatter_markdown.t
t/formatter_pod.t
t/formatter_redirect.t
t/formatter_rss.t
t/formatter_syntax_highlight.t
t/formatter_textile.t
t/formatter_toc.t
t/formatter_wiki.t
t/formatter_wikipedialink.t
t/formatter_youtube.t
t/lib/FakeCatalystObject.pm
t/lib/MojoMojoTestSchema.pm
t/notabs.t
t/permissions.t
t/revisions.t
t/schema_DBIC.t
t/schema_DBIC_Attachment.t
t/schema_DBIC_Content.t
t/schema_DBIC_Page.t
t/schema_DBIC_Person.t
t/schema_DBIC_Tag.t
t/selenium.t
t/special-page.t
t/unicode.t
t/var/bugs.jpg
t/var/files/catalyst.png
t/var/files/test.pod
t/var/files/test.txt
t/var/files/test.xml
t/wikispaces2markdown.t
t/worddiff.t
MojoMojo-1.12/app.psgi 0000755 0001750 0001750 00000000157 13021751557 014214 0 ustar marcus marcus #!/usr/bin/env perl
use strict;
use warnings;
use lib 'lib';
use MojoMojo;
my $app = MojoMojo->psgi_app(@_);
MojoMojo-1.12/Makefile.PL 0000644 0001750 0001750 00000013454 13105605252 014514 0 ustar marcus marcus use inc::Module::Install;
name 'MojoMojo';
resources bugtracker => 'http://github.com/mojomojo/mojomojo/issues';
resources homepage => 'http://mojomojo.org';
resources repository => 'http://github.com/mojomojo/mojomojo/';
resources MailingList => 'http://n2.nabble.com/mojomojo-f2358427.html';
all_from 'lib/MojoMojo.pm';
requires(
'Plack' => 0.9974,
'Algorithm::Diff' => '1.1901',
'Algorithm::Merge' => 0,
'Archive::Zip' => '1.14',
'Cache::FastMmap' => 1.31, # deleted /tmp/sharefile-* when MM is killed
'Catalyst' => '5.90015',
'Catalyst::Action::RenderView' => '0.07',
'Catalyst::Authentication::Store::DBIx::Class' => '0.101',
'Catalyst::Controller::HTML::FormFu' => '0.03007',
'Catalyst::Model::DBIC::Schema' => '0.01',
'Catalyst::Plugin::Authentication' => '0.10005',
'Catalyst::Plugin::Cache' => 0.08,
'Catalyst::Plugin::ConfigLoader' => '0.13',
'Catalyst::Plugin::I18N' => 0,
'Catalyst::Plugin::SubRequest' => '0.19',
'Catalyst::Plugin::Session::State::Cookie' => 0.11,
'Catalyst::Plugin::Session::Store::Cache' => '0',
'Catalyst::Plugin::Setenv' => 0,
'Catalyst::Plugin::Static::Simple' => '0.07',
'Catalyst::View::TT' => '0.23',
'Catalyst::View::JSON' => '0.26',
'Catalyst::View::Email' => '0.14',
'Catalyst::View::Email::Template' => 0,
'Config::General' => 0,
'Config::JFDI' => 0,
'Crypt::CBC' => '2.12', # FormFu
'Data::Page' => '2.00',
'DateTime' => '0.28',
'DateTime::Format::Mail' => 0,
'DBD::SQLite' => '1.27',
'DBIx::Class' => '0.08',
'DBIx::Class::DateTime::Epoch' => '0.04',
'DBIx::Class::EncodedColumn' => 0,
'DBIx::Class::TimeStamp' => '0.11',
'Directory::Scratch' => '0.14',
'Encode' => '2.31',
'File::Copy::Recursive' => 0,
'File::MMagic' => '1.27',
'HTML::Entities' => '3.60', # Pod::Simple
'HTML::FormFu' => '0.02000', # min version with string renderer
'HTML::FormFu::Model::DBIC' => 0,
'HTML::Strip' => '1.04',
'HTML::TagCloud' => 0,
'HTML::Toc' => 0,
'Image::ExifTool' => 0,
'Imager' => 0,
'Image::Math::Constrain' => 0,
'IO::Scalar' => 0,
'IO::File' => '1.14',
'KinoSearch1' => '1.00',
'Module::Pluggable::Ordered' => '1.4',
'Moose' => 0,
'MRO::Compat' => '0.10',
'Number::Format' => 0,
'parent' => 0,
'Template' => '2.20',
'Template::Plugin::JavaScript' => 0,
'Text::Context' => '3.5',
'Text::MultiMarkdown' => '1.000032',
'Text::Password::Pronounceable' => 0,
'Text::Textile' => 0,
'URI' => '1.37',
'URI::Find' => 0,
'YAML' => '0.36',
'Term::Prompt' => 0,
'Text::Emoticon::MSN' => 0,
'File::Slurp' => 0,
);
feature 'Create new database', 'SQL::Translator' => '0.09006';
feature 'FastCGI support', 'FCGI::ProcManager' => 0;
feature 'reCAPTCHA for anonymous edits', 'HTML::FormFu::Element::reCAPTCHA' => 0;
feature 'Syntax highlighter', 'Syntax::Highlight::Engine::Kate' => 0;
feature 'RSS formatter', 'XML::Feed' => 0;
# XML::LibXSLT depends on the following libraries: libxslt-dev, libgcrypt11-dev (for `lgcrypt`), libgdbm3-dev (for `lgdbm`) and possibly libxml2-dev
feature 'DocBook formatter',
'XML::LibXSLT' => '1.66',
'XML::LibXML' => '1.66';
feature 'POD formatter', 'Pod::Simple::HTML' => '3.01';
feature 'Transclusion support',
'LWP::Simple' => 0,
'URI::Fetch' => 0;
feature 'Amazon boxes', 'Net::Amazon' => 0;
feature('Emoticons' => [ 'Text::Emoticon::MSN' => 0, -default => 0 ]);
configure_requires 'File::Copy::Recursive';
test_requires 'Test::More' => '0.88';
test_requires 'Test::Differences';
# all tests require a database to be deployed, even though SQLT is not necessary for producton if a DB exists
test_requires 'SQL::Translator' => '0.09006';
test_requires 'Email::Sender::Simple' => '0.102370';
test_requires 'WWW::Mechanize' => '1.54';
test_requires 'Test::WWW::Mechanize::Catalyst' => '0.51';
test_requires 'WWW::Mechanize::TreeBuilder' => '1.10000';
tests(join ' ', (glob('t/*.t'), glob('t/*/*.t')));
catalyst;
#catalyst_par_script('script/mojomojo_server.pl');
install_script glob('script/*.pl');
auto_install;
WriteAll;
MojoMojo-1.12/MYMETA.json 0000644 0001750 0001750 00000012073 13105606255 014431 0 ustar marcus marcus {
"abstract" : "A Wiki with a tree",
"author" : [
"Marcus Ramberg C"
],
"dynamic_config" : 0,
"generated_by" : "Module::Install version 1.17, CPAN::Meta::Converter version 2.150005",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
},
"name" : "MojoMojo",
"no_index" : {
"directory" : [
"inc",
"t"
]
},
"prereqs" : {
"build" : {
"requires" : {
"Email::Sender::Simple" : "0.102370",
"ExtUtils::MakeMaker" : "6.59",
"File::Copy::Recursive" : "0",
"SQL::Translator" : "0.09006",
"Test::Differences" : "0",
"Test::More" : "0.88",
"Test::WWW::Mechanize::Catalyst" : "0.51",
"WWW::Mechanize" : "1.54",
"WWW::Mechanize::TreeBuilder" : "1.10000"
}
},
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
"requires" : {
"Algorithm::Diff" : "1.1901",
"Algorithm::Merge" : "0",
"Archive::Zip" : "1.14",
"Cache::FastMmap" : "1.31",
"Catalyst" : "5.90015",
"Catalyst::Action::RenderView" : "0.07",
"Catalyst::Authentication::Store::DBIx::Class" : "0.101",
"Catalyst::Controller::HTML::FormFu" : "0.03007",
"Catalyst::Model::DBIC::Schema" : "0.01",
"Catalyst::Plugin::Authentication" : "0.10005",
"Catalyst::Plugin::Cache" : "0.08",
"Catalyst::Plugin::ConfigLoader" : "0.13",
"Catalyst::Plugin::I18N" : "0",
"Catalyst::Plugin::Session::State::Cookie" : "0.11",
"Catalyst::Plugin::Session::Store::Cache" : "0",
"Catalyst::Plugin::Setenv" : "0",
"Catalyst::Plugin::Static::Simple" : "0.07",
"Catalyst::Plugin::SubRequest" : "0.19",
"Catalyst::View::Email" : "0.14",
"Catalyst::View::Email::Template" : "0",
"Catalyst::View::JSON" : "0.26",
"Catalyst::View::TT" : "0.23",
"Config::General" : "0",
"Config::JFDI" : "0",
"Crypt::CBC" : "2.12",
"DBD::SQLite" : "1.27",
"DBIx::Class" : "0.08",
"DBIx::Class::DateTime::Epoch" : "0.04",
"DBIx::Class::EncodedColumn" : "0",
"DBIx::Class::TimeStamp" : "0.11",
"Data::Page" : "2.00",
"DateTime" : "0.28",
"DateTime::Format::Mail" : "0",
"Directory::Scratch" : "0.14",
"Email::Sender::Simple" : "0.102370",
"Encode" : "2.31",
"FCGI::ProcManager" : "0",
"File::Copy::Recursive" : "0",
"File::MMagic" : "1.27",
"File::Slurp" : "0",
"HTML::Entities" : "3.60",
"HTML::FormFu" : "0.02000",
"HTML::FormFu::Element::reCAPTCHA" : "0",
"HTML::FormFu::Model::DBIC" : "0",
"HTML::Strip" : "1.04",
"HTML::TagCloud" : "0",
"HTML::Toc" : "0",
"IO::File" : "1.14",
"IO::Scalar" : "0",
"Image::ExifTool" : "0",
"Image::Math::Constrain" : "0",
"Imager" : "0",
"KinoSearch1" : "1.00",
"LWP::Simple" : "0",
"MRO::Compat" : "0.10",
"Module::Pluggable::Ordered" : "1.4",
"Moose" : "0",
"Net::Amazon" : "0",
"Number::Format" : "0",
"Plack" : "0.9974",
"Pod::Simple::HTML" : "3.01",
"SQL::Translator" : "0.09006",
"Syntax::Highlight::Engine::Kate" : "0",
"Template" : "2.20",
"Template::Plugin::JavaScript" : "0",
"Term::Prompt" : "0",
"Test::Differences" : "0",
"Test::More" : "0.88",
"Test::WWW::Mechanize::Catalyst" : "0.51",
"Text::Context" : "3.5",
"Text::Emoticon::MSN" : "0",
"Text::MultiMarkdown" : "1.000032",
"Text::Password::Pronounceable" : "0",
"Text::Textile" : "0",
"URI" : "1.37",
"URI::Fetch" : "0",
"URI::Find" : "0",
"WWW::Mechanize" : "1.54",
"WWW::Mechanize::TreeBuilder" : "1.10000",
"XML::Feed" : "0",
"XML::LibXML" : "1.66",
"XML::LibXSLT" : "1.66",
"YAML" : "0.36",
"parent" : "0",
"perl" : "5.008004"
}
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "http://github.com/mojomojo/mojomojo/issues"
},
"homepage" : "http://mojomojo.org",
"license" : [
"http://dev.perl.org/licenses/"
],
"repository" : {
"url" : "http://github.com/mojomojo/mojomojo/"
},
"x_MailingList" : "http://n2.nabble.com/mojomojo-f2358427.html"
},
"version" : "1.12",
"x_serialization_backend" : "JSON::PP version 2.27300"
}
MojoMojo-1.12/inc/ 0000755 0001750 0001750 00000000000 13105607167 013313 5 ustar marcus marcus MojoMojo-1.12/inc/Module/ 0000755 0001750 0001750 00000000000 13105607167 014540 5 ustar marcus marcus MojoMojo-1.12/inc/Module/Install.pm 0000644 0001750 0001750 00000027145 13105606255 016512 0 ustar marcus marcus #line 1
package Module::Install;
# For any maintainers:
# The load order for Module::Install is a bit magic.
# It goes something like this...
#
# IF ( host has Module::Install installed, creating author mode ) {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
# 3. The installed version of inc::Module::Install loads
# 4. inc::Module::Install calls "require Module::Install"
# 5. The ./inc/ version of Module::Install loads
# } ELSE {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
# 3. The ./inc/ version of Module::Install loads
# }
use 5.006;
use strict 'vars';
use Cwd ();
use File::Find ();
use File::Path ();
use vars qw{$VERSION $MAIN};
BEGIN {
# All Module::Install core packages now require synchronised versions.
# This will be used to ensure we don't accidentally load old or
# different versions of modules.
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
$VERSION = '1.17';
# Storage for the pseudo-singleton
$MAIN = undef;
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
}
sub import {
my $class = shift;
my $self = $class->new(@_);
my $who = $self->_caller;
#-------------------------------------------------------------
# all of the following checks should be included in import(),
# to allow "eval 'require Module::Install; 1' to test
# installation of Module::Install. (RT #51267)
#-------------------------------------------------------------
# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) { die <<"END_DIE" }
Please invoke ${\__PACKAGE__} with:
use inc::${\__PACKAGE__};
not:
use ${\__PACKAGE__};
END_DIE
# This reportedly fixes a rare Win32 UTC file time issue, but
# as this is a non-cross-platform XS module not in the core,
# we shouldn't really depend on it. See RT #24194 for detail.
# (Also, this module only supports Perl 5.6 and above).
eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006;
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 ) {
my $s = (stat($0))[9];
# If the modification time is only slightly in the future,
# sleep briefly to remove the problem.
my $a = $s - time;
if ( $a > 0 and $a < 5 ) { sleep 5 }
# Too far in the future, throw an error.
my $t = time;
if ( $s > $t ) { die <<"END_DIE" }
Your installer $0 has a modification time in the future ($s > $t).
This is known to create infinite loops in make.
Please correct this, then run $0 again.
END_DIE
}
# Build.PL was formerly supported, but no longer is due to excessive
# difficulty in implementing every single feature twice.
if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" }
Module::Install no longer supports Build.PL.
It was impossible to maintain duel backends, and has been deprecated.
Please remove all Build.PL files and only use the Makefile.PL installer.
END_DIE
#-------------------------------------------------------------
# To save some more typing in Module::Install installers, every...
# use inc::Module::Install
# ...also acts as an implicit use strict.
$^H |= strict::bits(qw(refs subs vars));
#-------------------------------------------------------------
unless ( -f $self->{file} ) {
foreach my $key (keys %INC) {
delete $INC{$key} if $key =~ /Module\/Install/;
}
local $^W;
require "$self->{path}/$self->{dispatch}.pm";
File::Path::mkpath("$self->{prefix}/$self->{author}");
$self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
$self->{admin}->init;
@_ = ($class, _self => $self);
goto &{"$self->{name}::import"};
}
local $^W;
*{"${who}::AUTOLOAD"} = $self->autoload;
$self->preload;
# Unregister loader and worker packages so subdirs can use them again
delete $INC{'inc/Module/Install.pm'};
delete $INC{'Module/Install.pm'};
# Save to the singleton
$MAIN = $self;
return 1;
}
sub autoload {
my $self = shift;
my $who = $self->_caller;
my $cwd = Cwd::getcwd();
my $sym = "${who}::AUTOLOAD";
$sym->{$cwd} = sub {
my $pwd = Cwd::getcwd();
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
unless ($$sym =~ s/([^:]+)$//) {
# XXX: it looks like we can't retrieve the missing function
# via $$sym (usually $main::AUTOLOAD) in this case.
# I'm still wondering if we should slurp Makefile.PL to
# get some context or not ...
my ($package, $file, $line) = caller;
die <<"EOT";
Unknown function is found at $file line $line.
Execution of $file aborted due to runtime errors.
If you're a contributor to a project, you may need to install
some Module::Install extensions from CPAN (or other repository).
If you're a user of a module, please contact the author.
EOT
}
my $method = $1;
if ( uc($method) eq $method ) {
# Do nothing
return;
} elsif ( $method =~ /^_/ and $self->can($method) ) {
# Dispatch to the root M:I class
return $self->$method(@_);
}
# Dispatch to the appropriate plugin
unshift @_, ( $self, $1 );
goto &{$self->can('call')};
};
}
sub preload {
my $self = shift;
unless ( $self->{extensions} ) {
$self->load_extensions(
"$self->{prefix}/$self->{path}", $self
);
}
my @exts = @{$self->{extensions}};
unless ( @exts ) {
@exts = $self->{admin}->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
}
my $who = $self->_caller;
foreach my $name ( sort keys %seen ) {
local $^W;
*{"${who}::$name"} = sub {
${"${who}::AUTOLOAD"} = "${who}::$name";
goto &{"${who}::AUTOLOAD"};
};
}
}
sub new {
my ($class, %args) = @_;
delete $INC{'FindBin.pm'};
{
# to suppress the redefine warning
local $SIG{__WARN__} = sub {};
require FindBin;
}
# ignore the prefix on extension modules built from top level.
my $base_path = Cwd::abs_path($FindBin::Bin);
unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) {
delete $args{prefix};
}
return $args{_self} if $args{_self};
$base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS';
$args{dispatch} ||= 'Admin';
$args{prefix} ||= 'inc';
$args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
$args{bundle} ||= 'inc/BUNDLES';
$args{base} ||= $base_path;
$class =~ s/^\Q$args{prefix}\E:://;
$args{name} ||= $class;
$args{version} ||= $class->VERSION;
unless ( $args{path} ) {
$args{path} = $args{name};
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
$args{wrote} = 0;
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
splice(@_, 0, 2, $obj);
goto &{$obj->can($method)};
}
sub load {
my ($self, $method) = @_;
$self->load_extensions(
"$self->{prefix}/$self->{path}", $self
) unless $self->{extensions};
foreach my $obj (@{$self->{extensions}}) {
return $obj if $obj->can($method);
}
my $admin = $self->{admin} or die <<"END_DIE";
The '$method' method does not exist in the '$self->{prefix}' path!
Please remove the '$self->{prefix}' directory and run $0 again to load it.
END_DIE
my $obj = $admin->load($method, 1);
push @{$self->{extensions}}, $obj;
$obj;
}
sub load_extensions {
my ($self, $path, $top) = @_;
my $should_reload = 0;
unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix};
$should_reload = 1;
}
foreach my $rv ( $self->find_extensions($path) ) {
my ($file, $pkg) = @{$rv};
next if $self->{pathnames}{$pkg};
local $@;
my $new = eval { local $^W; require $file; $pkg->can('new') };
unless ( $new ) {
warn $@ if $@;
next;
}
$self->{pathnames}{$pkg} =
$should_reload ? delete $INC{$file} : $INC{$file};
push @{$self->{extensions}}, &{$new}($pkg, _top => $top );
}
$self->{extensions} ||= [];
}
sub find_extensions {
my ($self, $path) = @_;
my @found;
File::Find::find( {no_chdir => 1, wanted => sub {
my $file = $File::Find::name;
return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
my $subpath = $1;
return if lc($subpath) eq lc($self->{dispatch});
$file = "$self->{path}/$subpath.pm";
my $pkg = "$self->{name}::$subpath";
$pkg =~ s!/!::!g;
# If we have a mixed-case package name, assume case has been preserved
# correctly. Otherwise, root through the file to locate the case-preserved
# version of the package name.
if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
my $content = Module::Install::_read($File::Find::name);
my $in_pod = 0;
foreach ( split /\n/, $content ) {
$in_pod = 1 if /^=\w/;
$in_pod = 0 if /^=cut/;
next if ($in_pod || /^=cut/); # skip pod text
next if /^\s*#/; # and comments
if ( m/^\s*package\s+($pkg)\s*;/i ) {
$pkg = $1;
last;
}
}
}
push @found, [ $file, $pkg ];
}}, $path ) if -d $path;
@found;
}
#####################################################################
# Common Utility Functions
sub _caller {
my $depth = 0;
my $call = caller($depth);
while ( $call eq __PACKAGE__ ) {
$depth++;
$call = caller($depth);
}
return $call;
}
sub _read {
local *FH;
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
binmode FH;
my $string = do { local $/; };
close FH or die "close($_[0]): $!";
return $string;
}
sub _readperl {
my $string = Module::Install::_read($_[0]);
$string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
$string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s;
$string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg;
return $string;
}
sub _readpod {
my $string = Module::Install::_read($_[0]);
$string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg;
return $string if $_[0] =~ /\.pod\z/;
$string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg;
$string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg;
$string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg;
$string =~ s/^\n+//s;
return $string;
}
sub _write {
local *FH;
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
binmode FH;
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
sub _version {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
# Normalise multipart versions
$s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg;
}
$s =~ s/^(\d+)\.?//;
my $l = $1 || 0;
my @v = map {
$_ . '0' x (3 - length $_)
} $s =~ /(\d{1,3})\D?/g;
$l = $l . '.' . join '', @v if @v;
return $l + 0;
}
sub _cmp {
_version($_[1]) <=> _version($_[2]);
}
# Cloned from Params::Util::_CLASS
sub _CLASS {
(
defined $_[0]
and
! ref $_[0]
and
$_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s
) ? $_[0] : undef;
}
1;
# Copyright 2008 - 2012 Adam Kennedy.
MojoMojo-1.12/inc/Module/AutoInstall.pm 0000644 0001750 0001750 00000062311 13105606255 017335 0 ustar marcus marcus #line 1
package Module::AutoInstall;
use strict;
use Cwd ();
use File::Spec ();
use ExtUtils::MakeMaker ();
use vars qw{$VERSION};
BEGIN {
$VERSION = '1.17';
}
# special map on pre-defined feature sets
my %FeatureMap = (
'' => 'Core Features', # XXX: deprecated
'-core' => 'Core Features',
);
# various lexical flags
my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $InstallDepsTarget, $HasCPANPLUS );
my (
$Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps,
$UpgradeDeps
);
my ( $PostambleActions, $PostambleActionsNoTest, $PostambleActionsUpgradeDeps,
$PostambleActionsUpgradeDepsNoTest, $PostambleActionsListDeps,
$PostambleActionsListAllDeps, $PostambleUsed, $NoTest);
# See if it's a testing or non-interactive session
_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN );
_init();
sub _accept_default {
$AcceptDefault = shift;
}
sub _installdeps_target {
$InstallDepsTarget = shift;
}
sub missing_modules {
return @Missing;
}
sub do_install {
__PACKAGE__->install(
[
$Config
? ( UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
: ()
],
@Missing,
);
}
# initialize various flags, and/or perform install
sub _init {
foreach my $arg (
@ARGV,
split(
/[\s\t]+/,
$ENV{PERL_AUTOINSTALL} || $ENV{PERL_EXTUTILS_AUTOINSTALL} || ''
)
)
{
if ( $arg =~ /^--config=(.*)$/ ) {
$Config = [ split( ',', $1 ) ];
}
elsif ( $arg =~ /^--installdeps=(.*)$/ ) {
__PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
exit 0;
}
elsif ( $arg =~ /^--upgradedeps=(.*)$/ ) {
$UpgradeDeps = 1;
__PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
exit 0;
}
elsif ( $arg =~ /^--default(?:deps)?$/ ) {
$AcceptDefault = 1;
}
elsif ( $arg =~ /^--check(?:deps)?$/ ) {
$CheckOnly = 1;
}
elsif ( $arg =~ /^--skip(?:deps)?$/ ) {
$SkipInstall = 1;
}
elsif ( $arg =~ /^--test(?:only)?$/ ) {
$TestOnly = 1;
}
elsif ( $arg =~ /^--all(?:deps)?$/ ) {
$AllDeps = 1;
}
}
}
# overrides MakeMaker's prompt() to automatically accept the default choice
sub _prompt {
goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault;
my ( $prompt, $default ) = @_;
my $y = ( $default =~ /^[Yy]/ );
print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] ';
print "$default\n";
return $default;
}
# the workhorse
sub import {
my $class = shift;
my @args = @_ or return;
my $core_all;
print "*** $class version " . $class->VERSION . "\n";
print "*** Checking for Perl dependencies...\n";
my $cwd = Cwd::getcwd();
$Config = [];
my $maxlen = length(
(
sort { length($b) <=> length($a) }
grep { /^[^\-]/ }
map {
ref($_)
? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} )
: ''
}
map { +{@args}->{$_} }
grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} }
)[0]
);
# We want to know if we're under CPAN early to avoid prompting, but
# if we aren't going to try and install anything anyway then skip the
# check entirely since we don't want to have to load (and configure)
# an old CPAN just for a cosmetic message
$UnderCPAN = _check_lock(1) unless $SkipInstall || $InstallDepsTarget;
while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) {
my ( @required, @tests, @skiptests );
my $default = 1;
my $conflict = 0;
if ( $feature =~ m/^-(\w+)$/ ) {
my $option = lc($1);
# check for a newer version of myself
_update_to( $modules, @_ ) and return if $option eq 'version';
# sets CPAN configuration options
$Config = $modules if $option eq 'config';
# promote every features to core status
$core_all = ( $modules =~ /^all$/i ) and next
if $option eq 'core';
next unless $option eq 'core';
}
print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n";
$modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' );
unshift @$modules, -default => &{ shift(@$modules) }
if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward compatibility
while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) {
if ( $mod =~ m/^-(\w+)$/ ) {
my $option = lc($1);
$default = $arg if ( $option eq 'default' );
$conflict = $arg if ( $option eq 'conflict' );
@tests = @{$arg} if ( $option eq 'tests' );
@skiptests = @{$arg} if ( $option eq 'skiptests' );
next;
}
printf( "- %-${maxlen}s ...", $mod );
if ( $arg and $arg =~ /^\D/ ) {
unshift @$modules, $arg;
$arg = 0;
}
# XXX: check for conflicts and uninstalls(!) them.
my $cur = _version_of($mod);
if (_version_cmp ($cur, $arg) >= 0)
{
print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
push @Existing, $mod => $arg;
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
if (not defined $cur) # indeed missing
{
print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
}
else
{
# no need to check $arg as _version_cmp ($cur, undef) would satisfy >= above
print "too old. ($cur < $arg)\n";
}
push @required, $mod => $arg;
}
}
next unless @required;
my $mandatory = ( $feature eq '-core' or $core_all );
if (
!$SkipInstall
and (
$CheckOnly
or ($mandatory and $UnderCPAN)
or $AllDeps
or $InstallDepsTarget
or _prompt(
qq{==> Auto-install the }
. ( @required / 2 )
. ( $mandatory ? ' mandatory' : ' optional' )
. qq{ module(s) from CPAN?},
$default ? 'y' : 'n',
) =~ /^[Yy]/
)
)
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
elsif ( !$SkipInstall
and $default
and $mandatory
and
_prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
=~ /^[Nn]/ )
{
push( @Missing, @required );
$DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
}
else {
$DisabledTests{$_} = 1 for map { glob($_) } @tests;
}
}
if ( @Missing and not( $CheckOnly or $UnderCPAN) ) {
require Config;
my $make = $Config::Config{make};
if ($InstallDepsTarget) {
print
"*** To install dependencies type '$make installdeps' or '$make installdeps_notest'.\n";
}
else {
print
"*** Dependencies will be installed the next time you type '$make'.\n";
}
# make an educated guess of whether we'll need root permission.
print " (You may need to do that as the 'root' user.)\n"
if eval '$>';
}
print "*** $class configuration finished.\n";
chdir $cwd;
# import to main::
no strict 'refs';
*{'main::WriteMakefile'} = \&Write if caller(0) eq 'main';
return (@Existing, @Missing);
}
sub _running_under {
my $thing = shift;
print <<"END_MESSAGE";
*** Since we're running under ${thing}, I'll just let it take care
of the dependency's installation later.
END_MESSAGE
return 1;
}
# Check to see if we are currently running under CPAN.pm and/or CPANPLUS;
# if we are, then we simply let it taking care of our dependencies
sub _check_lock {
return unless @Missing or @_;
if ($ENV{PERL5_CPANM_IS_RUNNING}) {
return _running_under('cpanminus');
}
my $cpan_env = $ENV{PERL5_CPAN_IS_RUNNING};
if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) {
return _running_under($cpan_env ? 'CPAN' : 'CPANPLUS');
}
require CPAN;
if ($CPAN::VERSION > '1.89') {
if ($cpan_env) {
return _running_under('CPAN');
}
return; # CPAN.pm new enough, don't need to check further
}
# last ditch attempt, this -will- configure CPAN, very sorry
_load_cpan(1); # force initialize even though it's already loaded
# Find the CPAN lock-file
my $lock = MM->catfile( $CPAN::Config->{cpan_home}, ".lock" );
return unless -f $lock;
# Check the lock
local *LOCK;
return unless open(LOCK, $lock);
if (
( $^O eq 'MSWin32' ? _under_cpan() : == getppid() )
and ( $CPAN::Config->{prerequisites_policy} || '' ) ne 'ignore'
) {
print <<'END_MESSAGE';
*** Since we're running under CPAN, I'll just let it take care
of the dependency's installation later.
END_MESSAGE
return 1;
}
close LOCK;
return;
}
sub install {
my $class = shift;
my $i; # used below to strip leading '-' from config keys
my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } );
my ( @modules, @installed, @modules_to_upgrade );
while (my ($pkg, $ver) = splice(@_, 0, 2)) {
# grep out those already installed
if (_version_cmp(_version_of($pkg), $ver) >= 0) {
push @installed, $pkg;
if ($UpgradeDeps) {
push @modules_to_upgrade, $pkg, $ver;
}
}
else {
push @modules, $pkg, $ver;
}
}
if ($UpgradeDeps) {
push @modules, @modules_to_upgrade;
@installed = ();
@modules_to_upgrade = ();
}
return @installed unless @modules; # nothing to do
return @installed if _check_lock(); # defer to the CPAN shell
print "*** Installing dependencies...\n";
return unless _connected_to('cpan.org');
my %args = @config;
my %failed;
local *FAILED;
if ( $args{do_once} and open( FAILED, '.#autoinstall.failed' ) ) {
while () { chomp; $failed{$_}++ }
close FAILED;
my @newmod;
while ( my ( $k, $v ) = splice( @modules, 0, 2 ) ) {
push @newmod, ( $k => $v ) unless $failed{$k};
}
@modules = @newmod;
}
if ( _has_cpanplus() and not $ENV{PERL_AUTOINSTALL_PREFER_CPAN} ) {
_install_cpanplus( \@modules, \@config );
} else {
_install_cpan( \@modules, \@config );
}
print "*** $class installation finished.\n";
# see if we have successfully installed them
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) {
push @installed, $pkg;
}
elsif ( $args{do_once} and open( FAILED, '>> .#autoinstall.failed' ) ) {
print FAILED "$pkg\n";
}
}
close FAILED if $args{do_once};
return @installed;
}
sub _install_cpanplus {
my @modules = @{ +shift };
my @config = _cpanplus_config( @{ +shift } );
my $installed = 0;
require CPANPLUS::Backend;
my $cp = CPANPLUS::Backend->new;
my $conf = $cp->configure_object;
return unless $conf->can('conf') # 0.05x+ with "sudo" support
or _can_write($conf->_get_build('base')); # 0.04x
# if we're root, set UNINST=1 to avoid trouble unless user asked for it.
my $makeflags = $conf->get_conf('makeflags') || '';
if ( UNIVERSAL::isa( $makeflags, 'HASH' ) ) {
# 0.03+ uses a hashref here
$makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST};
} else {
# 0.02 and below uses a scalar
$makeflags = join( ' ', split( ' ', $makeflags ), 'UNINST=1' )
if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } );
}
$conf->set_conf( makeflags => $makeflags );
$conf->set_conf( prereqs => 1 );
while ( my ( $key, $val ) = splice( @config, 0, 2 ) ) {
$conf->set_conf( $key, $val );
}
my $modtree = $cp->module_tree;
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
print "*** Installing $pkg...\n";
MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
my $success;
my $obj = $modtree->{$pkg};
if ( $obj and _version_cmp( $obj->{version}, $ver ) >= 0 ) {
my $pathname = $pkg;
$pathname =~ s/::/\\W/;
foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) {
delete $INC{$inc};
}
my $rv = $cp->install( modules => [ $obj->{module} ] );
if ( $rv and ( $rv->{ $obj->{module} } or $rv->{ok} ) ) {
print "*** $pkg successfully installed.\n";
$success = 1;
} else {
print "*** $pkg installation cancelled.\n";
$success = 0;
}
$installed += $success;
} else {
print << ".";
*** Could not find a version $ver or above for $pkg; skipping.
.
}
MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall;
}
return $installed;
}
sub _cpanplus_config {
my @config = ();
while ( @_ ) {
my ($key, $value) = (shift(), shift());
if ( $key eq 'prerequisites_policy' ) {
if ( $value eq 'follow' ) {
$value = CPANPLUS::Internals::Constants::PREREQ_INSTALL();
} elsif ( $value eq 'ask' ) {
$value = CPANPLUS::Internals::Constants::PREREQ_ASK();
} elsif ( $value eq 'ignore' ) {
$value = CPANPLUS::Internals::Constants::PREREQ_IGNORE();
} else {
die "*** Cannot convert option $key = '$value' to CPANPLUS version.\n";
}
push @config, 'prereqs', $value;
} elsif ( $key eq 'force' ) {
push @config, $key, $value;
} elsif ( $key eq 'notest' ) {
push @config, 'skiptest', $value;
} else {
die "*** Cannot convert option $key to CPANPLUS version.\n";
}
}
return @config;
}
sub _install_cpan {
my @modules = @{ +shift };
my @config = @{ +shift };
my $installed = 0;
my %args;
_load_cpan();
require Config;
if (CPAN->VERSION < 1.80) {
# no "sudo" support, probe for writableness
return unless _can_write( MM->catfile( $CPAN::Config->{cpan_home}, 'sources' ) )
and _can_write( $Config::Config{sitelib} );
}
# if we're root, set UNINST=1 to avoid trouble unless user asked for it.
my $makeflags = $CPAN::Config->{make_install_arg} || '';
$CPAN::Config->{make_install_arg} =
join( ' ', split( ' ', $makeflags ), 'UNINST=1' )
if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } );
# don't show start-up info
$CPAN::Config->{inhibit_startup_message} = 1;
# set additional options
while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) {
( $args{$opt} = $arg, next )
if $opt =~ /^(?:force|notest)$/; # pseudo-option
$CPAN::Config->{$opt} = $opt eq 'urllist' ? [$arg] : $arg;
}
if ($args{notest} && (not CPAN::Shell->can('notest'))) {
die "Your version of CPAN is too old to support the 'notest' pragma";
}
local $CPAN::Config->{prerequisites_policy} = 'follow';
while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
print "*** Installing $pkg...\n";
my $obj = CPAN::Shell->expand( Module => $pkg );
my $success = 0;
if ( $obj and _version_cmp( $obj->cpan_version, $ver ) >= 0 ) {
my $pathname = $pkg;
$pathname =~ s/::/\\W/;
foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) {
delete $INC{$inc};
}
my $rv = do {
if ($args{force}) {
CPAN::Shell->force( install => $pkg )
} elsif ($args{notest}) {
CPAN::Shell->notest( install => $pkg )
} else {
CPAN::Shell->install($pkg)
}
};
$rv ||= eval {
$CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, )
->{install}
if $CPAN::META;
};
if ( $rv eq 'YES' ) {
print "*** $pkg successfully installed.\n";
$success = 1;
}
else {
print "*** $pkg installation failed.\n";
$success = 0;
}
$installed += $success;
}
else {
print << ".";
*** Could not find a version $ver or above for $pkg; skipping.
.
}
MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall;
}
return $installed;
}
sub _has_cpanplus {
return (
$HasCPANPLUS = (
$INC{'CPANPLUS/Config.pm'}
or _load('CPANPLUS::Shell::Default')
)
);
}
# make guesses on whether we're under the CPAN installation directory
sub _under_cpan {
require Cwd;
require File::Spec;
my $cwd = File::Spec->canonpath( Cwd::getcwd() );
my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} );
return ( index( $cwd, $cpan ) > -1 );
}
sub _update_to {
my $class = __PACKAGE__;
my $ver = shift;
return
if _version_cmp( _version_of($class), $ver ) >= 0; # no need to upgrade
if (
_prompt( "==> A newer version of $class ($ver) is required. Install?",
'y' ) =~ /^[Nn]/
)
{
die "*** Please install $class $ver manually.\n";
}
print << ".";
*** Trying to fetch it from CPAN...
.
# install ourselves
_load($class) and return $class->import(@_)
if $class->install( [], $class, $ver );
print << '.'; exit 1;
*** Cannot bootstrap myself. :-( Installation terminated.
.
}
# check if we're connected to some host, using inet_aton
sub _connected_to {
my $site = shift;
return (
( _load('Socket') and Socket::inet_aton($site) ) or _prompt(
qq(
*** Your host cannot resolve the domain name '$site', which
probably means the Internet connections are unavailable.
==> Should we try to install the required module(s) anyway?), 'n'
) =~ /^[Yy]/
);
}
# check if a directory is writable; may create it on demand
sub _can_write {
my $path = shift;
mkdir( $path, 0755 ) unless -e $path;
return 1 if -w $path;
print << ".";
*** You are not allowed to write to the directory '$path';
the installation may fail due to insufficient permissions.
.
if (
eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
qq(
==> Should we try to re-execute the autoinstall process with 'sudo'?),
((-t STDIN) ? 'y' : 'n')
) =~ /^[Yy]/
)
{
# try to bootstrap ourselves from sudo
print << ".";
*** Trying to re-execute the autoinstall process with 'sudo'...
.
my $missing = join( ',', @Missing );
my $config = join( ',',
UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
return
unless system( 'sudo', $^X, $0, "--config=$config",
"--installdeps=$missing" );
print << ".";
*** The 'sudo' command exited with error! Resuming...
.
}
return _prompt(
qq(
==> Should we try to install the required module(s) anyway?), 'n'
) =~ /^[Yy]/;
}
# load a module and return the version it reports
sub _load {
my $mod = pop; # method/function doesn't matter
my $file = $mod;
$file =~ s|::|/|g;
$file .= '.pm';
local $@;
return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 );
}
# report version without loading a module
sub _version_of {
my $mod = pop; # method/function doesn't matter
my $file = $mod;
$file =~ s|::|/|g;
$file .= '.pm';
foreach my $dir ( @INC ) {
next if ref $dir;
my $path = File::Spec->catfile($dir, $file);
next unless -e $path;
require ExtUtils::MM_Unix;
return ExtUtils::MM_Unix->parse_version($path);
}
return undef;
}
# Load CPAN.pm and it's configuration
sub _load_cpan {
return if $CPAN::VERSION and $CPAN::Config and not @_;
require CPAN;
# CPAN-1.82+ adds CPAN::Config::AUTOLOAD to redirect to
# CPAN::HandleConfig->load. CPAN reports that the redirection
# is deprecated in a warning printed at the user.
# CPAN-1.81 expects CPAN::HandleConfig->load, does not have
# $CPAN::HandleConfig::VERSION but cannot handle
# CPAN::Config->load
# Which "versions expect CPAN::Config->load?
if ( $CPAN::HandleConfig::VERSION
|| CPAN::HandleConfig->can('load')
) {
# Newer versions of CPAN have a HandleConfig module
CPAN::HandleConfig->load;
} else {
# Older versions had the load method in Config directly
CPAN::Config->load;
}
}
# compare two versions, either use Sort::Versions or plain comparison
# return values same as <=>
sub _version_cmp {
my ( $cur, $min ) = @_;
return -1 unless defined $cur; # if 0 keep comparing
return 1 unless $min;
$cur =~ s/\s+$//;
# check for version numbers that are not in decimal format
if ( ref($cur) or ref($min) or $cur =~ /v|\..*\./ or $min =~ /v|\..*\./ ) {
if ( ( $version::VERSION or defined( _load('version') )) and
version->can('new')
) {
# use version.pm if it is installed.
return version->new($cur) <=> version->new($min);
}
elsif ( $Sort::Versions::VERSION or defined( _load('Sort::Versions') ) )
{
# use Sort::Versions as the sorting algorithm for a.b.c versions
return Sort::Versions::versioncmp( $cur, $min );
}
warn "Cannot reliably compare non-decimal formatted versions.\n"
. "Please install version.pm or Sort::Versions.\n";
}
# plain comparison
local $^W = 0; # shuts off 'not numeric' bugs
return $cur <=> $min;
}
# nothing; this usage is deprecated.
sub main::PREREQ_PM { return {}; }
sub _make_args {
my %args = @_;
$args{PREREQ_PM} = { %{ $args{PREREQ_PM} || {} }, @Existing, @Missing }
if $UnderCPAN or $TestOnly;
if ( $args{EXE_FILES} and -e 'MANIFEST' ) {
require ExtUtils::Manifest;
my $manifest = ExtUtils::Manifest::maniread('MANIFEST');
$args{EXE_FILES} =
[ grep { exists $manifest->{$_} } @{ $args{EXE_FILES} } ];
}
$args{test}{TESTS} ||= 't/*.t';
$args{test}{TESTS} = join( ' ',
grep { !exists( $DisabledTests{$_} ) }
map { glob($_) } split( /\s+/, $args{test}{TESTS} ) );
my $missing = join( ',', @Missing );
my $config =
join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
if $Config;
$PostambleActions = (
($missing and not $UnderCPAN)
? "\$(PERL) $0 --config=$config --installdeps=$missing"
: "\$(NOECHO) \$(NOOP)"
);
my $deps_list = join( ',', @Missing, @Existing );
$PostambleActionsUpgradeDeps =
"\$(PERL) $0 --config=$config --upgradedeps=$deps_list";
my $config_notest =
join( ',', (UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config}),
'notest', 1 )
if $Config;
$PostambleActionsNoTest = (
($missing and not $UnderCPAN)
? "\$(PERL) $0 --config=$config_notest --installdeps=$missing"
: "\$(NOECHO) \$(NOOP)"
);
$PostambleActionsUpgradeDepsNoTest =
"\$(PERL) $0 --config=$config_notest --upgradedeps=$deps_list";
$PostambleActionsListDeps =
'@$(PERL) -le "print for @ARGV" '
. join(' ', map $Missing[$_], grep $_ % 2 == 0, 0..$#Missing);
my @all = (@Missing, @Existing);
$PostambleActionsListAllDeps =
'@$(PERL) -le "print for @ARGV" '
. join(' ', map $all[$_], grep $_ % 2 == 0, 0..$#all);
return %args;
}
# a wrapper to ExtUtils::MakeMaker::WriteMakefile
sub Write {
require Carp;
Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
if ($CheckOnly) {
print << ".";
*** Makefile not written in check-only mode.
.
return;
}
my %args = _make_args(@_);
no strict 'refs';
$PostambleUsed = 0;
local *MY::postamble = \&postamble unless defined &MY::postamble;
ExtUtils::MakeMaker::WriteMakefile(%args);
print << "." unless $PostambleUsed;
*** WARNING: Makefile written with customized MY::postamble() without
including contents from Module::AutoInstall::postamble() --
auto installation features disabled. Please contact the author.
.
return 1;
}
sub postamble {
$PostambleUsed = 1;
my $fragment;
$fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
config :: installdeps
\t\$(NOECHO) \$(NOOP)
AUTO_INSTALL
$fragment .= <<"END_MAKE";
checkdeps ::
\t\$(PERL) $0 --checkdeps
installdeps ::
\t$PostambleActions
installdeps_notest ::
\t$PostambleActionsNoTest
upgradedeps ::
\t$PostambleActionsUpgradeDeps
upgradedeps_notest ::
\t$PostambleActionsUpgradeDepsNoTest
listdeps ::
\t$PostambleActionsListDeps
listalldeps ::
\t$PostambleActionsListAllDeps
END_MAKE
return $fragment;
}
1;
__END__
#line 1197
MojoMojo-1.12/inc/Module/Install/ 0000755 0001750 0001750 00000000000 13105607167 016146 5 ustar marcus marcus MojoMojo-1.12/inc/Module/Install/WriteAll.pm 0000644 0001750 0001750 00000002376 13105606255 020234 0 ustar marcus marcus #line 1
package Module::Install::WriteAll;
use strict;
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
sub WriteAll {
my $self = shift;
my %args = (
meta => 1,
sign => 0,
inline => 0,
check_nmake => 1,
@_,
);
$self->sign(1) if $args{sign};
$self->admin->WriteAll(%args) if $self->is_admin;
$self->check_nmake if $args{check_nmake};
unless ( $self->makemaker_args->{PL_FILES} ) {
# XXX: This still may be a bit over-defensive...
unless ($self->makemaker(6.25)) {
$self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL';
}
}
# Until ExtUtils::MakeMaker support MYMETA.yml, make sure
# we clean it up properly ourself.
$self->realclean_files('MYMETA.yml');
if ( $args{inline} ) {
$self->Inline->write;
} else {
$self->Makefile->write;
}
# The Makefile write process adds a couple of dependencies,
# so write the META.yml files after the Makefile.
if ( $args{meta} ) {
$self->Meta->write;
}
# Experimental support for MYMETA
if ( $ENV{X_MYMETA} ) {
if ( $ENV{X_MYMETA} eq 'JSON' ) {
$self->Meta->write_mymeta_json;
} else {
$self->Meta->write_mymeta_yaml;
}
}
return 1;
}
1;
MojoMojo-1.12/inc/Module/Install/Makefile.pm 0000644 0001750 0001750 00000027437 13105606255 020233 0 ustar marcus marcus #line 1
package Module::Install::Makefile;
use strict 'vars';
use ExtUtils::MakeMaker ();
use Module::Install::Base ();
use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
sub Makefile { $_[0] }
my %seen = ();
sub prompt {
shift;
# Infinite loop protection
my @c = caller();
if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) {
die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])";
}
# In automated testing or non-interactive session, always use defaults
if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) {
local $ENV{PERL_MM_USE_DEFAULT} = 1;
goto &ExtUtils::MakeMaker::prompt;
} else {
goto &ExtUtils::MakeMaker::prompt;
}
}
# Store a cleaned up version of the MakeMaker version,
# since we need to behave differently in a variety of
# ways based on the MM version.
my $makemaker = eval $ExtUtils::MakeMaker::VERSION;
# If we are passed a param, do a "newer than" comparison.
# Otherwise, just return the MakeMaker version.
sub makemaker {
( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0
}
# Ripped from ExtUtils::MakeMaker 6.56, and slightly modified
# as we only need to know here whether the attribute is an array
# or a hash or something else (which may or may not be appendable).
my %makemaker_argtype = (
C => 'ARRAY',
CONFIG => 'ARRAY',
# CONFIGURE => 'CODE', # ignore
DIR => 'ARRAY',
DL_FUNCS => 'HASH',
DL_VARS => 'ARRAY',
EXCLUDE_EXT => 'ARRAY',
EXE_FILES => 'ARRAY',
FUNCLIST => 'ARRAY',
H => 'ARRAY',
IMPORTS => 'HASH',
INCLUDE_EXT => 'ARRAY',
LIBS => 'ARRAY', # ignore ''
MAN1PODS => 'HASH',
MAN3PODS => 'HASH',
META_ADD => 'HASH',
META_MERGE => 'HASH',
PL_FILES => 'HASH',
PM => 'HASH',
PMLIBDIRS => 'ARRAY',
PMLIBPARENTDIRS => 'ARRAY',
PREREQ_PM => 'HASH',
CONFIGURE_REQUIRES => 'HASH',
SKIP => 'ARRAY',
TYPEMAPS => 'ARRAY',
XS => 'HASH',
# VERSION => ['version',''], # ignore
# _KEEP_AFTER_FLUSH => '',
clean => 'HASH',
depend => 'HASH',
dist => 'HASH',
dynamic_lib=> 'HASH',
linkext => 'HASH',
macro => 'HASH',
postamble => 'HASH',
realclean => 'HASH',
test => 'HASH',
tool_autosplit => 'HASH',
# special cases where you can use makemaker_append
CCFLAGS => 'APPENDABLE',
DEFINE => 'APPENDABLE',
INC => 'APPENDABLE',
LDDLFLAGS => 'APPENDABLE',
LDFROM => 'APPENDABLE',
);
sub makemaker_args {
my ($self, %new_args) = @_;
my $args = ( $self->{makemaker_args} ||= {} );
foreach my $key (keys %new_args) {
if ($makemaker_argtype{$key}) {
if ($makemaker_argtype{$key} eq 'ARRAY') {
$args->{$key} = [] unless defined $args->{$key};
unless (ref $args->{$key} eq 'ARRAY') {
$args->{$key} = [$args->{$key}]
}
push @{$args->{$key}},
ref $new_args{$key} eq 'ARRAY'
? @{$new_args{$key}}
: $new_args{$key};
}
elsif ($makemaker_argtype{$key} eq 'HASH') {
$args->{$key} = {} unless defined $args->{$key};
foreach my $skey (keys %{ $new_args{$key} }) {
$args->{$key}{$skey} = $new_args{$key}{$skey};
}
}
elsif ($makemaker_argtype{$key} eq 'APPENDABLE') {
$self->makemaker_append($key => $new_args{$key});
}
}
else {
if (defined $args->{$key}) {
warn qq{MakeMaker attribute "$key" is overriden; use "makemaker_append" to append values\n};
}
$args->{$key} = $new_args{$key};
}
}
return $args;
}
# For mm args that take multiple space-separated args,
# append an argument to the current list.
sub makemaker_append {
my $self = shift;
my $name = shift;
my $args = $self->makemaker_args;
$args->{$name} = defined $args->{$name}
? join( ' ', $args->{$name}, @_ )
: join( ' ', @_ );
}
sub build_subdirs {
my $self = shift;
my $subdirs = $self->makemaker_args->{DIR} ||= [];
for my $subdir (@_) {
push @$subdirs, $subdir;
}
}
sub clean_files {
my $self = shift;
my $clean = $self->makemaker_args->{clean} ||= {};
%$clean = (
%$clean,
FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_),
);
}
sub realclean_files {
my $self = shift;
my $realclean = $self->makemaker_args->{realclean} ||= {};
%$realclean = (
%$realclean,
FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_),
);
}
sub libs {
my $self = shift;
my $libs = ref $_[0] ? shift : [ shift ];
$self->makemaker_args( LIBS => $libs );
}
sub inc {
my $self = shift;
$self->makemaker_args( INC => shift );
}
sub _wanted_t {
}
sub tests_recursive {
my $self = shift;
my $dir = shift || 't';
unless ( -d $dir ) {
die "tests_recursive dir '$dir' does not exist";
}
my %tests = map { $_ => 1 } split / /, ($self->tests || '');
require File::Find;
File::Find::find(
sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 },
$dir
);
$self->tests( join ' ', sort keys %tests );
}
sub write {
my $self = shift;
die "&Makefile->write() takes no arguments\n" if @_;
# Check the current Perl version
my $perl_version = $self->perl_version;
if ( $perl_version ) {
eval "use $perl_version; 1"
or die "ERROR: perl: Version $] is installed, "
. "but we need version >= $perl_version";
}
# Make sure we have a new enough MakeMaker
require ExtUtils::MakeMaker;
if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
# This previous attempted to inherit the version of
# ExtUtils::MakeMaker in use by the module author, but this
# was found to be untenable as some authors build releases
# using future dev versions of EU:MM that nobody else has.
# Instead, #toolchain suggests we use 6.59 which is the most
# stable version on CPAN at time of writing and is, to quote
# ribasushi, "not terminally fucked, > and tested enough".
# TODO: We will now need to maintain this over time to push
# the version up as new versions are released.
$self->build_requires( 'ExtUtils::MakeMaker' => 6.59 );
$self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 );
} else {
# Allow legacy-compatibility with 5.005 by depending on the
# most recent EU:MM that supported 5.005.
$self->build_requires( 'ExtUtils::MakeMaker' => 6.36 );
$self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 );
}
# Generate the MakeMaker params
my $args = $self->makemaker_args;
$args->{DISTNAME} = $self->name;
$args->{NAME} = $self->module_name || $self->name;
$args->{NAME} =~ s/-/::/g;
$args->{VERSION} = $self->version or die <<'EOT';
ERROR: Can't determine distribution version. Please specify it
explicitly via 'version' in Makefile.PL, or set a valid $VERSION
in a module, and provide its file path via 'version_from' (or
'all_from' if you prefer) in Makefile.PL.
EOT
if ( $self->tests ) {
my @tests = split ' ', $self->tests;
my %seen;
$args->{test} = {
TESTS => (join ' ', grep {!$seen{$_}++} @tests),
};
} elsif ( $Module::Install::ExtraTests::use_extratests ) {
# Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness.
# So, just ignore our xt tests here.
} elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) {
$args->{test} = {
TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ),
};
}
if ( $] >= 5.005 ) {
$args->{ABSTRACT} = $self->abstract;
$args->{AUTHOR} = join ', ', @{$self->author || []};
}
if ( $self->makemaker(6.10) ) {
$args->{NO_META} = 1;
#$args->{NO_MYMETA} = 1;
}
if ( $self->makemaker(6.17) and $self->sign ) {
$args->{SIGN} = 1;
}
unless ( $self->is_admin ) {
delete $args->{SIGN};
}
if ( $self->makemaker(6.31) and $self->license ) {
$args->{LICENSE} = $self->license;
}
my $prereq = ($args->{PREREQ_PM} ||= {});
%$prereq = ( %$prereq,
map { @$_ } # flatten [module => version]
map { @$_ }
grep $_,
($self->requires)
);
# Remove any reference to perl, PREREQ_PM doesn't support it
delete $args->{PREREQ_PM}->{perl};
# Merge both kinds of requires into BUILD_REQUIRES
my $build_prereq = ($args->{BUILD_REQUIRES} ||= {});
%$build_prereq = ( %$build_prereq,
map { @$_ } # flatten [module => version]
map { @$_ }
grep $_,
($self->configure_requires, $self->build_requires)
);
# Remove any reference to perl, BUILD_REQUIRES doesn't support it
delete $args->{BUILD_REQUIRES}->{perl};
# Delete bundled dists from prereq_pm, add it to Makefile DIR
my $subdirs = ($args->{DIR} || []);
if ($self->bundles) {
my %processed;
foreach my $bundle (@{ $self->bundles }) {
my ($mod_name, $dist_dir) = @$bundle;
delete $prereq->{$mod_name};
$dist_dir = File::Basename::basename($dist_dir); # dir for building this module
if (not exists $processed{$dist_dir}) {
if (-d $dist_dir) {
# List as sub-directory to be processed by make
push @$subdirs, $dist_dir;
}
# Else do nothing: the module is already present on the system
$processed{$dist_dir} = undef;
}
}
}
unless ( $self->makemaker('6.55_03') ) {
%$prereq = (%$prereq,%$build_prereq);
delete $args->{BUILD_REQUIRES};
}
if ( my $perl_version = $self->perl_version ) {
eval "use $perl_version; 1"
or die "ERROR: perl: Version $] is installed, "
. "but we need version >= $perl_version";
if ( $self->makemaker(6.48) ) {
$args->{MIN_PERL_VERSION} = $perl_version;
}
}
if ($self->installdirs) {
warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS};
$args->{INSTALLDIRS} = $self->installdirs;
}
my %args = map {
( $_ => $args->{$_} ) } grep {defined($args->{$_} )
} keys %$args;
my $user_preop = delete $args{dist}->{PREOP};
if ( my $preop = $self->admin->preop($user_preop) ) {
foreach my $key ( keys %$preop ) {
$args{dist}->{$key} = $preop->{$key};
}
}
my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
$self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile');
}
sub fix_up_makefile {
my $self = shift;
my $makefile_name = shift;
my $top_class = ref($self->_top) || '';
my $top_version = $self->_top->VERSION || '';
my $preamble = $self->preamble
? "# Preamble by $top_class $top_version\n"
. $self->preamble
: '';
my $postamble = "# Postamble by $top_class $top_version\n"
. ($self->postamble || '');
local *MAKEFILE;
open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
eval { flock MAKEFILE, LOCK_EX };
my $makefile = do { local $/; };
$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
$makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
$makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
$makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
# Module::Install will never be used to build the Core Perl
# Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks
# PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist
$makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m;
#$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m;
# Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well.
$makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g;
# XXX - This is currently unused; not sure if it breaks other MM-users
# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
seek MAKEFILE, 0, SEEK_SET;
truncate MAKEFILE, 0;
print MAKEFILE "$preamble$makefile$postamble" or die $!;
close MAKEFILE or die $!;
1;
}
sub preamble {
my ($self, $text) = @_;
$self->{preamble} = $text . $self->{preamble} if defined $text;
$self->{preamble};
}
sub postamble {
my ($self, $text) = @_;
$self->{postamble} ||= $self->admin->postamble;
$self->{postamble} .= $text if defined $text;
$self->{postamble}
}
1;
__END__
#line 544
MojoMojo-1.12/inc/Module/Install/Metadata.pm 0000644 0001750 0001750 00000043302 13105606255 020223 0 ustar marcus marcus #line 1
package Module::Install::Metadata;
use strict 'vars';
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
my @boolean_keys = qw{
sign
};
my @scalar_keys = qw{
name
module_name
abstract
version
distribution_type
tests
installdirs
};
my @tuple_keys = qw{
configure_requires
build_requires
requires
recommends
bundles
resources
};
my @resource_keys = qw{
homepage
bugtracker
repository
};
my @array_keys = qw{
keywords
author
};
*authors = \&author;
sub Meta { shift }
sub Meta_BooleanKeys { @boolean_keys }
sub Meta_ScalarKeys { @scalar_keys }
sub Meta_TupleKeys { @tuple_keys }
sub Meta_ResourceKeys { @resource_keys }
sub Meta_ArrayKeys { @array_keys }
foreach my $key ( @boolean_keys ) {
*$key = sub {
my $self = shift;
if ( defined wantarray and not @_ ) {
return $self->{values}->{$key};
}
$self->{values}->{$key} = ( @_ ? $_[0] : 1 );
return $self;
};
}
foreach my $key ( @scalar_keys ) {
*$key = sub {
my $self = shift;
return $self->{values}->{$key} if defined wantarray and !@_;
$self->{values}->{$key} = shift;
return $self;
};
}
foreach my $key ( @array_keys ) {
*$key = sub {
my $self = shift;
return $self->{values}->{$key} if defined wantarray and !@_;
$self->{values}->{$key} ||= [];
push @{$self->{values}->{$key}}, @_;
return $self;
};
}
foreach my $key ( @resource_keys ) {
*$key = sub {
my $self = shift;
unless ( @_ ) {
return () unless $self->{values}->{resources};
return map { $_->[1] }
grep { $_->[0] eq $key }
@{ $self->{values}->{resources} };
}
return $self->{values}->{resources}->{$key} unless @_;
my $uri = shift or die(
"Did not provide a value to $key()"
);
$self->resources( $key => $uri );
return 1;
};
}
foreach my $key ( grep { $_ ne "resources" } @tuple_keys) {
*$key = sub {
my $self = shift;
return $self->{values}->{$key} unless @_;
my @added;
while ( @_ ) {
my $module = shift or last;
my $version = shift || 0;
push @added, [ $module, $version ];
}
push @{ $self->{values}->{$key} }, @added;
return map {@$_} @added;
};
}
# Resource handling
my %lc_resource = map { $_ => 1 } qw{
homepage
license
bugtracker
repository
};
sub resources {
my $self = shift;
while ( @_ ) {
my $name = shift or last;
my $value = shift or next;
if ( $name eq lc $name and ! $lc_resource{$name} ) {
die("Unsupported reserved lowercase resource '$name'");
}
$self->{values}->{resources} ||= [];
push @{ $self->{values}->{resources} }, [ $name, $value ];
}
$self->{values}->{resources};
}
# Aliases for build_requires that will have alternative
# meanings in some future version of META.yml.
sub test_requires { shift->build_requires(@_) }
sub install_requires { shift->build_requires(@_) }
# Aliases for installdirs options
sub install_as_core { $_[0]->installdirs('perl') }
sub install_as_cpan { $_[0]->installdirs('site') }
sub install_as_site { $_[0]->installdirs('site') }
sub install_as_vendor { $_[0]->installdirs('vendor') }
sub dynamic_config {
my $self = shift;
my $value = @_ ? shift : 1;
if ( $self->{values}->{dynamic_config} ) {
# Once dynamic we never change to static, for safety
return 0;
}
$self->{values}->{dynamic_config} = $value ? 1 : 0;
return 1;
}
# Convenience command
sub static_config {
shift->dynamic_config(0);
}
sub perl_version {
my $self = shift;
return $self->{values}->{perl_version} unless @_;
my $version = shift or die(
"Did not provide a value to perl_version()"
);
# Normalize the version
$version = $self->_perl_version($version);
# We don't support the really old versions
unless ( $version >= 5.005 ) {
die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
}
$self->{values}->{perl_version} = $version;
}
sub all_from {
my ( $self, $file ) = @_;
unless ( defined($file) ) {
my $name = $self->name or die(
"all_from called with no args without setting name() first"
);
$file = join('/', 'lib', split(/-/, $name)) . '.pm';
$file =~ s{.*/}{} unless -e $file;
unless ( -e $file ) {
die("all_from cannot find $file from $name");
}
}
unless ( -f $file ) {
die("The path '$file' does not exist, or is not a file");
}
$self->{values}{all_from} = $file;
# Some methods pull from POD instead of code.
# If there is a matching .pod, use that instead
my $pod = $file;
$pod =~ s/\.pm$/.pod/i;
$pod = $file unless -e $pod;
# Pull the different values
$self->name_from($file) unless $self->name;
$self->version_from($file) unless $self->version;
$self->perl_version_from($file) unless $self->perl_version;
$self->author_from($pod) unless @{$self->author || []};
$self->license_from($pod) unless $self->license;
$self->abstract_from($pod) unless $self->abstract;
return 1;
}
sub provides {
my $self = shift;
my $provides = ( $self->{values}->{provides} ||= {} );
%$provides = (%$provides, @_) if @_;
return $provides;
}
sub auto_provides {
my $self = shift;
return $self unless $self->is_admin;
unless (-e 'MANIFEST') {
warn "Cannot deduce auto_provides without a MANIFEST, skipping\n";
return $self;
}
# Avoid spurious warnings as we are not checking manifest here.
local $SIG{__WARN__} = sub {1};
require ExtUtils::Manifest;
local *ExtUtils::Manifest::manicheck = sub { return };
require Module::Build;
my $build = Module::Build->new(
dist_name => $self->name,
dist_version => $self->version,
license => $self->license,
);
$self->provides( %{ $build->find_dist_packages || {} } );
}
sub feature {
my $self = shift;
my $name = shift;
my $features = ( $self->{values}->{features} ||= [] );
my $mods;
if ( @_ == 1 and ref( $_[0] ) ) {
# The user used ->feature like ->features by passing in the second
# argument as a reference. Accomodate for that.
$mods = $_[0];
} else {
$mods = \@_;
}
my $count = 0;
push @$features, (
$name => [
map {
ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_
} @$mods
]
);
return @$features;
}
sub features {
my $self = shift;
while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
$self->feature( $name, @$mods );
}
return $self->{values}->{features}
? @{ $self->{values}->{features} }
: ();
}
sub no_index {
my $self = shift;
my $type = shift;
push @{ $self->{values}->{no_index}->{$type} }, @_ if $type;
return $self->{values}->{no_index};
}
sub read {
my $self = shift;
$self->include_deps( 'YAML::Tiny', 0 );
require YAML::Tiny;
my $data = YAML::Tiny::LoadFile('META.yml');
# Call methods explicitly in case user has already set some values.
while ( my ( $key, $value ) = each %$data ) {
next unless $self->can($key);
if ( ref $value eq 'HASH' ) {
while ( my ( $module, $version ) = each %$value ) {
$self->can($key)->($self, $module => $version );
}
} else {
$self->can($key)->($self, $value);
}
}
return $self;
}
sub write {
my $self = shift;
return $self unless $self->is_admin;
$self->admin->write_meta;
return $self;
}
sub version_from {
require ExtUtils::MM_Unix;
my ( $self, $file ) = @_;
$self->version( ExtUtils::MM_Unix->parse_version($file) );
# for version integrity check
$self->makemaker_args( VERSION_FROM => $file );
}
sub abstract_from {
require ExtUtils::MM_Unix;
my ( $self, $file ) = @_;
$self->abstract(
bless(
{ DISTNAME => $self->name },
'ExtUtils::MM_Unix'
)->parse_abstract($file)
);
}
# Add both distribution and module name
sub name_from {
my ($self, $file) = @_;
if (
Module::Install::_read($file) =~ m/
^ \s*
package \s*
([\w:]+)
[\s|;]*
/ixms
) {
my ($name, $module_name) = ($1, $1);
$name =~ s{::}{-}g;
$self->name($name);
unless ( $self->module_name ) {
$self->module_name($module_name);
}
} else {
die("Cannot determine name from $file\n");
}
}
sub _extract_perl_version {
if (
$_[0] =~ m/
^\s*
(?:use|require) \s*
v?
([\d_\.]+)
\s* ;
/ixms
) {
my $perl_version = $1;
$perl_version =~ s{_}{}g;
return $perl_version;
} else {
return;
}
}
sub perl_version_from {
my $self = shift;
my $perl_version=_extract_perl_version(Module::Install::_read($_[0]));
if ($perl_version) {
$self->perl_version($perl_version);
} else {
warn "Cannot determine perl version info from $_[0]\n";
return;
}
}
sub author_from {
my $self = shift;
my $content = Module::Install::_read($_[0]);
if ($content =~ m/
=head \d \s+ (?:authors?)\b \s*
([^\n]*)
|
=head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s*
.*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s*
([^\n]*)
/ixms) {
my $author = $1 || $2;
# XXX: ugly but should work anyway...
if (eval "require Pod::Escapes; 1") {
# Pod::Escapes has a mapping table.
# It's in core of perl >= 5.9.3, and should be installed
# as one of the Pod::Simple's prereqs, which is a prereq
# of Pod::Text 3.x (see also below).
$author =~ s{ E<( (\d+) | ([A-Za-z]+) )> }
{
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
# Pod::Text < 3.0 has yet another mapping table,
# though the table name of 2.x and 1.x are different.
# (1.x is in core of Perl < 5.6, 2.x is in core of
# Perl < 5.9.3)
my $mapping = ($Pod::Text::VERSION < 2)
? \%Pod::Text::HTML_Escapes
: \%Pod::Text::ESCAPES;
$author =~ s{ E<( (\d+) | ([A-Za-z]+) )> }
{
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
$author =~ s{E}{<}g;
$author =~ s{E}{>}g;
}
$self->author($author);
} else {
warn "Cannot determine author info from $_[0]\n";
}
}
#Stolen from M::B
my %license_urls = (
perl => 'http://dev.perl.org/licenses/',
apache => 'http://apache.org/licenses/LICENSE-2.0',
apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1',
artistic => 'http://opensource.org/licenses/artistic-license.php',
artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
lgpl => 'http://opensource.org/licenses/lgpl-license.php',
lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
bsd => 'http://opensource.org/licenses/bsd-license.php',
gpl => 'http://opensource.org/licenses/gpl-license.php',
gpl2 => 'http://opensource.org/licenses/gpl-2.0.php',
gpl3 => 'http://opensource.org/licenses/gpl-3.0.html',
mit => 'http://opensource.org/licenses/mit-license.php',
mozilla => 'http://opensource.org/licenses/mozilla1.1.php',
open_source => undef,
unrestricted => undef,
restrictive => undef,
unknown => undef,
);
sub license {
my $self = shift;
return $self->{values}->{license} unless @_;
my $license = shift or die(
'Did not provide a value to license()'
);
$license = __extract_license($license) || lc $license;
$self->{values}->{license} = $license;
# Automatically fill in license URLs
if ( $license_urls{$license} ) {
$self->resources( license => $license_urls{$license} );
}
return 1;
}
sub _extract_license {
my $pod = shift;
my $matched;
return __extract_license(
($matched) = $pod =~ m/
(=head \d \s+ L(?i:ICEN[CS]E|ICENSING)\b.*?)
(=head \d.*|=cut.*|)\z
/xms
) || __extract_license(
($matched) = $pod =~ m/
(=head \d \s+ (?:C(?i:OPYRIGHTS?)|L(?i:EGAL))\b.*?)
(=head \d.*|=cut.*|)\z
/xms
);
}
sub __extract_license {
my $license_text = shift or return;
my @phrases = (
'(?:under )?the same (?:terms|license) as (?:perl|the perl (?:\d )?programming language)' => 'perl', 1,
'(?:under )?the terms of (?:perl|the perl programming language) itself' => 'perl', 1,
'Artistic and GPL' => 'perl', 1,
'GNU general public license' => 'gpl', 1,
'GNU public license' => 'gpl', 1,
'GNU lesser general public license' => 'lgpl', 1,
'GNU lesser public license' => 'lgpl', 1,
'GNU library general public license' => 'lgpl', 1,
'GNU library public license' => 'lgpl', 1,
'GNU Free Documentation license' => 'unrestricted', 1,
'GNU Affero General Public License' => 'open_source', 1,
'(?:Free)?BSD license' => 'bsd', 1,
'Artistic license 2\.0' => 'artistic_2', 1,
'Artistic license' => 'artistic', 1,
'Apache (?:Software )?license' => 'apache', 1,
'GPL' => 'gpl', 1,
'LGPL' => 'lgpl', 1,
'BSD' => 'bsd', 1,
'Artistic' => 'artistic', 1,
'MIT' => 'mit', 1,
'Mozilla Public License' => 'mozilla', 1,
'Q Public License' => 'open_source', 1,
'OpenSSL License' => 'unrestricted', 1,
'SSLeay License' => 'unrestricted', 1,
'zlib License' => 'open_source', 1,
'proprietary' => 'proprietary', 0,
);
while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
$pattern =~ s#\s+#\\s+#gs;
if ( $license_text =~ /\b$pattern\b/i ) {
return $license;
}
}
return '';
}
sub license_from {
my $self = shift;
if (my $license=_extract_license(Module::Install::_read($_[0]))) {
$self->license($license);
} else {
warn "Cannot determine license info from $_[0]\n";
return 'unknown';
}
}
sub _extract_bugtracker {
my @links = $_[0] =~ m#L<(
https?\Q://rt.cpan.org/\E[^>]+|
https?\Q://github.com/\E[\w_]+/[\w_]+/issues|
https?\Q://code.google.com/p/\E[\w_\-]+/issues/list
)>#gx;
my %links;
@links{@links}=();
@links=keys %links;
return @links;
}
sub bugtracker_from {
my $self = shift;
my $content = Module::Install::_read($_[0]);
my @links = _extract_bugtracker($content);
unless ( @links ) {
warn "Cannot determine bugtracker info from $_[0]\n";
return 0;
}
if ( @links > 1 ) {
warn "Found more than one bugtracker link in $_[0]\n";
return 0;
}
# Set the bugtracker
bugtracker( $links[0] );
return 1;
}
sub requires_from {
my $self = shift;
my $content = Module::Install::_readperl($_[0]);
my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg;
while ( @requires ) {
my $module = shift @requires;
my $version = shift @requires;
$self->requires( $module => $version );
}
}
sub test_requires_from {
my $self = shift;
my $content = Module::Install::_readperl($_[0]);
my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
while ( @requires ) {
my $module = shift @requires;
my $version = shift @requires;
$self->test_requires( $module => $version );
}
}
# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
# numbers (eg, 5.006001 or 5.008009).
# Also, convert double-part versions (eg, 5.8)
sub _perl_version {
my $v = $_[-1];
$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
$v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
$v =~ s/(\.\d\d\d)000$/$1/;
$v =~ s/_.+$//;
if ( ref($v) ) {
# Numify
$v = $v + 0;
}
return $v;
}
sub add_metadata {
my $self = shift;
my %hash = @_;
for my $key (keys %hash) {
warn "add_metadata: $key is not prefixed with 'x_'.\n" .
"Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/;
$self->{values}->{$key} = $hash{$key};
}
}
######################################################################
# MYMETA Support
sub WriteMyMeta {
die "WriteMyMeta has been deprecated";
}
sub write_mymeta_yaml {
my $self = shift;
# We need YAML::Tiny to write the MYMETA.yml file
unless ( eval { require YAML::Tiny; 1; } ) {
return 1;
}
# Generate the data
my $meta = $self->_write_mymeta_data or return 1;
# Save as the MYMETA.yml file
print "Writing MYMETA.yml\n";
YAML::Tiny::DumpFile('MYMETA.yml', $meta);
}
sub write_mymeta_json {
my $self = shift;
# We need JSON to write the MYMETA.json file
unless ( eval { require JSON; 1; } ) {
return 1;
}
# Generate the data
my $meta = $self->_write_mymeta_data or return 1;
# Save as the MYMETA.yml file
print "Writing MYMETA.json\n";
Module::Install::_write(
'MYMETA.json',
JSON->new->pretty(1)->canonical->encode($meta),
);
}
sub _write_mymeta_data {
my $self = shift;
# If there's no existing META.yml there is nothing we can do
return undef unless -f 'META.yml';
# We need Parse::CPAN::Meta to load the file
unless ( eval { require Parse::CPAN::Meta; 1; } ) {
return undef;
}
# Merge the perl version into the dependencies
my $val = $self->Meta->{values};
my $perl = delete $val->{perl_version};
if ( $perl ) {
$val->{requires} ||= [];
my $requires = $val->{requires};
# Canonize to three-dot version after Perl 5.6
if ( $perl >= 5.006 ) {
$perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e
}
unshift @$requires, [ perl => $perl ];
}
# Load the advisory META.yml file
my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
my $meta = $yaml[0];
# Overwrite the non-configure dependency hashes
delete $meta->{requires};
delete $meta->{build_requires};
delete $meta->{recommends};
if ( exists $val->{requires} ) {
$meta->{requires} = { map { @$_ } @{ $val->{requires} } };
}
if ( exists $val->{build_requires} ) {
$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
}
return $meta;
}
1;
MojoMojo-1.12/inc/Module/Install/Fetch.pm 0000644 0001750 0001750 00000004627 13105606255 017543 0 ustar marcus marcus #line 1
package Module::Install::Fetch;
use strict;
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
sub get_file {
my ($self, %args) = @_;
my ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
$args{url} = $args{ftp_url}
or (warn("LWP support unavailable!\n"), return);
($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
}
$|++;
print "Fetching '$file' from $host... ";
unless (eval { require Socket; Socket::inet_aton($host) }) {
warn "'$host' resolve failed!\n";
return;
}
return unless $scheme eq 'ftp' or $scheme eq 'http';
require Cwd;
my $dir = Cwd::getcwd();
chdir $args{local_dir} or return if exists $args{local_dir};
if (eval { require LWP::Simple; 1 }) {
LWP::Simple::mirror($args{url}, $file);
}
elsif (eval { require Net::FTP; 1 }) { eval {
# use Net::FTP to get past firewall
my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
$ftp->login("anonymous", 'anonymous@example.com');
$ftp->cwd($path);
$ftp->binary;
$ftp->get($file) or (warn("$!\n"), return);
$ftp->quit;
} }
elsif (my $ftp = $self->can_run('ftp')) { eval {
# no Net::FTP, fallback to ftp.exe
require FileHandle;
my $fh = FileHandle->new;
local $SIG{CHLD} = 'IGNORE';
unless ($fh->open("|$ftp -n")) {
warn "Couldn't open ftp: $!\n";
chdir $dir; return;
}
my @dialog = split(/\n/, <<"END_FTP");
open $host
user anonymous anonymous\@example.com
cd $path
binary
get $file $file
quit
END_FTP
foreach (@dialog) { $fh->print("$_\n") }
$fh->close;
} }
else {
warn "No working 'ftp' program available!\n";
chdir $dir; return;
}
unless (-f $file) {
warn "Fetching failed: $@\n";
chdir $dir; return;
}
return if exists $args{size} and -s $file != $args{size};
system($args{run}) if exists $args{run};
unlink($file) if $args{remove};
print(((!exists $args{check_for} or -e $args{check_for})
? "done!" : "failed! ($!)"), "\n");
chdir $dir; return !$?;
}
1;
MojoMojo-1.12/inc/Module/Install/AutoInstall.pm 0000644 0001750 0001750 00000004162 13105606255 020743 0 ustar marcus marcus #line 1
package Module::Install::AutoInstall;
use strict;
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
sub AutoInstall { $_[0] }
sub run {
my $self = shift;
$self->auto_install_now(@_);
}
sub write {
my $self = shift;
$self->auto_install(@_);
}
sub auto_install {
my $self = shift;
return if $self->{done}++;
# Flatten array of arrays into a single array
my @core = map @$_, map @$_, grep ref,
$self->build_requires, $self->requires;
my @config = @_;
# We'll need Module::AutoInstall
$self->include('Module::AutoInstall');
require Module::AutoInstall;
my @features_require = Module::AutoInstall->import(
(@config ? (-config => \@config) : ()),
(@core ? (-core => \@core) : ()),
$self->features,
);
my %seen;
my @requires = map @$_, map @$_, grep ref, $self->requires;
while (my ($mod, $ver) = splice(@requires, 0, 2)) {
$seen{$mod}{$ver}++;
}
my @build_requires = map @$_, map @$_, grep ref, $self->build_requires;
while (my ($mod, $ver) = splice(@build_requires, 0, 2)) {
$seen{$mod}{$ver}++;
}
my @configure_requires = map @$_, map @$_, grep ref, $self->configure_requires;
while (my ($mod, $ver) = splice(@configure_requires, 0, 2)) {
$seen{$mod}{$ver}++;
}
my @deduped;
while (my ($mod, $ver) = splice(@features_require, 0, 2)) {
push @deduped, $mod => $ver unless $seen{$mod}{$ver}++;
}
$self->requires(@deduped);
$self->makemaker_args( Module::AutoInstall::_make_args() );
my $class = ref($self);
$self->postamble(
"# --- $class section:\n" .
Module::AutoInstall::postamble()
);
}
sub installdeps_target {
my ($self, @args) = @_;
$self->include('Module::AutoInstall');
require Module::AutoInstall;
Module::AutoInstall::_installdeps_target(1);
$self->auto_install(@args);
}
sub auto_install_now {
my $self = shift;
$self->auto_install(@_);
Module::AutoInstall::do_install();
}
1;
MojoMojo-1.12/inc/Module/Install/Catalyst.pm 0000644 0001750 0001750 00000002761 13105606255 020273 0 ustar marcus marcus #line 1
package Module::Install::Catalyst;
use strict;
use base qw/ Module::Install::Base /;
our @ISA;
require Module::Install::Base;
use File::Find;
use FindBin;
use File::Copy::Recursive;
use File::Spec ();
use Getopt::Long ();
use Data::Dumper;
my $SAFETY = 0;
our @IGNORE =
qw/Build Build.PL Changes MANIFEST META.yml Makefile.PL Makefile README
_build blib lib script t inc .*\.svn \.git _darcs \.bzr \.hg
debian build-stamp install-stamp configure-stamp/;
#line 52
sub catalyst {
my $self = shift;
if($Module::Install::AUTHOR) {
$self->include("File::Copy::Recursive");
}
print <catalyst_files;
print <name;
for my $orig (@files) {
my $path = File::Spec->catdir( 'blib', 'lib', @path, $orig );
File::Copy::Recursive::rcopy( $orig, $path );
}
}
#line 104
sub catalyst_ignore_all {
my ( $self, $ignore ) = @_;
@IGNORE = @$ignore;
}
#line 115
sub catalyst_ignore {
my ( $self, @ignore ) = @_;
push @IGNORE, @ignore;
}
#line 131
1;
MojoMojo-1.12/inc/Module/Install/Base.pm 0000644 0001750 0001750 00000002147 13105606255 017357 0 ustar marcus marcus #line 1
package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
$VERSION = '1.17';
}
# Suspend handler for "redefined" warnings
BEGIN {
my $w = $SIG{__WARN__};
$SIG{__WARN__} = sub { $w };
}
#line 42
sub new {
my $class = shift;
unless ( defined &{"${class}::call"} ) {
*{"${class}::call"} = sub { shift->_top->call(@_) };
}
unless ( defined &{"${class}::load"} ) {
*{"${class}::load"} = sub { shift->_top->load(@_) };
}
bless { @_ }, $class;
}
#line 61
sub AUTOLOAD {
local $@;
my $func = eval { shift->_top->autoload } or return;
goto &$func;
}
#line 75
sub _top {
$_[0]->{_top};
}
#line 90
sub admin {
$_[0]->_top->{admin}
or
Module::Install::Base::FakeAdmin->new;
}
#line 106
sub is_admin {
! $_[0]->admin->isa('Module::Install::Base::FakeAdmin');
}
sub DESTROY {}
package Module::Install::Base::FakeAdmin;
use vars qw{$VERSION};
BEGIN {
$VERSION = $Module::Install::Base::VERSION;
}
my $fake;
sub new {
$fake ||= bless(\@_, $_[0]);
}
sub AUTOLOAD {}
sub DESTROY {}
# Restore warning handler
BEGIN {
$SIG{__WARN__} = $SIG{__WARN__}->();
}
1;
#line 159
MojoMojo-1.12/inc/Module/Install/Scripts.pm 0000644 0001750 0001750 00000001011 13105606255 020121 0 ustar marcus marcus #line 1
package Module::Install::Scripts;
use strict 'vars';
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
sub install_script {
my $self = shift;
my $args = $self->makemaker_args;
my $exe = $args->{EXE_FILES} ||= [];
foreach ( @_ ) {
if ( -f $_ ) {
push @$exe, $_;
} elsif ( -d 'script' and -f "script/$_" ) {
push @$exe, "script/$_";
} else {
die("Cannot find script '$_'");
}
}
}
1;
MojoMojo-1.12/inc/Module/Install/Include.pm 0000644 0001750 0001750 00000001015 13105606255 020061 0 ustar marcus marcus #line 1
package Module::Install::Include;
use strict;
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
sub include {
shift()->admin->include(@_);
}
sub include_deps {
shift()->admin->include_deps(@_);
}
sub auto_include {
shift()->admin->auto_include(@_);
}
sub auto_include_deps {
shift()->admin->auto_include_deps(@_);
}
sub auto_include_dependent_dists {
shift()->admin->auto_include_dependent_dists(@_);
}
1;
MojoMojo-1.12/inc/Module/Install/Win32.pm 0000644 0001750 0001750 00000003403 13105606255 017403 0 ustar marcus marcus #line 1
package Module::Install::Win32;
use strict;
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
# determine if the user needs nmake, and download it if needed
sub check_nmake {
my $self = shift;
$self->load('can_run');
$self->load('get_file');
require Config;
return unless (
$^O eq 'MSWin32' and
$Config::Config{make} and
$Config::Config{make} =~ /^nmake\b/i and
! $self->can_run('nmake')
);
print "The required 'nmake' executable not found, fetching it...\n";
require File::Basename;
my $rv = $self->get_file(
url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
local_dir => File::Basename::dirname($^X),
size => 51928,
run => 'Nmake15.exe /o > nul',
check_for => 'Nmake.exe',
remove => 1,
);
die <<'END_MESSAGE' unless $rv;
-------------------------------------------------------------------------------
Since you are using Microsoft Windows, you will need the 'nmake' utility
before installation. It's available at:
http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
or
ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe
Please download the file manually, save it to a directory in %PATH% (e.g.
C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
that directory, and run "Nmake15.exe" from there; that will create the
'nmake.exe' file needed by this module.
You may then resume the installation process described in README.
-------------------------------------------------------------------------------
END_MESSAGE
}
1;
MojoMojo-1.12/inc/Module/Install/Can.pm 0000644 0001750 0001750 00000006405 13105606255 017207 0 ustar marcus marcus #line 1
package Module::Install::Can;
use strict;
use Config ();
use ExtUtils::MakeMaker ();
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.17';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
# check if we can load some module
### Upgrade this to not have to load the module if possible
sub can_use {
my ($self, $mod, $ver) = @_;
$mod =~ s{::|\\}{/}g;
$mod .= '.pm' unless $mod =~ /\.pm$/i;
my $pkg = $mod;
$pkg =~ s{/}{::}g;
$pkg =~ s{\.pm$}{}i;
local $@;
eval { require $mod; $pkg->VERSION($ver || 0); 1 };
}
# Check if we can run some command
sub can_run {
my ($self, $cmd) = @_;
my $_cmd = $cmd;
return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
next if $dir eq '';
require File::Spec;
my $abs = File::Spec->catfile($dir, $cmd);
return $abs if (-x $abs or $abs = MM->maybe_command($abs));
}
return;
}
# Can our C compiler environment build XS files
sub can_xs {
my $self = shift;
# Ensure we have the CBuilder module
$self->configure_requires( 'ExtUtils::CBuilder' => 0.27 );
# Do we have the configure_requires checker?
local $@;
eval "require ExtUtils::CBuilder;";
if ( $@ ) {
# They don't obey configure_requires, so it is
# someone old and delicate. Try to avoid hurting
# them by falling back to an older simpler test.
return $self->can_cc();
}
# Do we have a working C compiler
my $builder = ExtUtils::CBuilder->new(
quiet => 1,
);
unless ( $builder->have_compiler ) {
# No working C compiler
return 0;
}
# Write a C file representative of what XS becomes
require File::Temp;
my ( $FH, $tmpfile ) = File::Temp::tempfile(
"compilexs-XXXXX",
SUFFIX => '.c',
);
binmode $FH;
print $FH <<'END_C';
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
int main(int argc, char **argv) {
return 0;
}
int boot_sanexs() {
return 1;
}
END_C
close $FH;
# Can the C compiler access the same headers XS does
my @libs = ();
my $object = undef;
eval {
local $^W = 0;
$object = $builder->compile(
source => $tmpfile,
);
@libs = $builder->link(
objects => $object,
module_name => 'sanexs',
);
};
my $result = $@ ? 0 : 1;
# Clean up all the build files
foreach ( $tmpfile, $object, @libs ) {
next unless defined $_;
1 while unlink;
}
return $result;
}
# Can we locate a (the) C compiler
sub can_cc {
my $self = shift;
if ($^O eq 'VMS') {
require ExtUtils::CBuilder;
my $builder = ExtUtils::CBuilder->new(
quiet => 1,
);
return $builder->have_compiler;
}
my @chunks = split(/ /, $Config::Config{cc}) or return;
# $Config{cc} may contain args; try to find out the program part
while (@chunks) {
return $self->can_run("@chunks") || (pop(@chunks), next);
}
return;
}
# Fix Cygwin bug on maybe_command();
if ( $^O eq 'cygwin' ) {
require ExtUtils::MM_Cygwin;
require ExtUtils::MM_Win32;
if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) {
*ExtUtils::MM_Cygwin::maybe_command = sub {
my ($self, $file) = @_;
if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) {
ExtUtils::MM_Win32->maybe_command($file);
} else {
ExtUtils::MM_Unix->maybe_command($file);
}
}
}
}
1;
__END__
#line 245
MojoMojo-1.12/inc/File/ 0000755 0001750 0001750 00000000000 13105607167 014172 5 ustar marcus marcus MojoMojo-1.12/inc/File/Copy/ 0000755 0001750 0001750 00000000000 13105607167 015104 5 ustar marcus marcus MojoMojo-1.12/inc/File/Copy/Recursive.pm 0000644 0001750 0001750 00000023220 13105606255 017405 0 ustar marcus marcus #line 1
package File::Copy::Recursive;
use strict;
BEGIN {
# Keep older versions of Perl from trying to use lexical warnings
$INC{'warnings.pm'} = "fake warnings entry for < 5.6 perl ($])" if $] < 5.006;
}
use warnings;
use Carp;
use File::Copy;
use File::Spec; #not really needed because File::Copy already gets it, but for good measure :)
use vars qw(
@ISA @EXPORT_OK $VERSION $MaxDepth $KeepMode $CPRFComp $CopyLink
$PFSCheck $RemvBase $NoFtlPth $ForcePth $CopyLoop $RMTrgFil $RMTrgDir
$CondCopy $BdTrgWrn $SkipFlop $DirPerms
);
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(fcopy rcopy dircopy fmove rmove dirmove pathmk pathrm pathempty pathrmdir);
$VERSION = '0.38';
$MaxDepth = 0;
$KeepMode = 1;
$CPRFComp = 0;
$CopyLink = eval { local $SIG{'__DIE__'};symlink '',''; 1 } || 0;
$PFSCheck = 1;
$RemvBase = 0;
$NoFtlPth = 0;
$ForcePth = 0;
$CopyLoop = 0;
$RMTrgFil = 0;
$RMTrgDir = 0;
$CondCopy = {};
$BdTrgWrn = 0;
$SkipFlop = 0;
$DirPerms = 0777;
my $samecheck = sub {
return 1 if $^O eq 'MSWin32'; # need better way to check for this on winders...
return if @_ != 2 || !defined $_[0] || !defined $_[1];
return if $_[0] eq $_[1];
my $one = '';
if($PFSCheck) {
$one = join( '-', ( stat $_[0] )[0,1] ) || '';
my $two = join( '-', ( stat $_[1] )[0,1] ) || '';
if ( $one eq $two && $one ) {
carp "$_[0] and $_[1] are identical";
return;
}
}
if(-d $_[0] && !$CopyLoop) {
$one = join( '-', ( stat $_[0] )[0,1] ) if !$one;
my $abs = File::Spec->rel2abs($_[1]);
my @pth = File::Spec->splitdir( $abs );
while(@pth) {
my $cur = File::Spec->catdir(@pth);
last if !$cur; # probably not necessary, but nice to have just in case :)
my $two = join( '-', ( stat $cur )[0,1] ) || '';
if ( $one eq $two && $one ) {
# $! = 62; # Too many levels of symbolic links
carp "Caught Deep Recursion Condition: $_[0] contains $_[1]";
return;
}
pop @pth;
}
}
return 1;
};
my $glob = sub {
my ($do, $src_glob, @args) = @_;
local $CPRFComp = 1;
my @rt;
for my $path ( glob($src_glob) ) {
my @call = [$do->($path, @args)] or return;
push @rt, \@call;
}
return @rt;
};
my $move = sub {
my $fl = shift;
my @x;
if($fl) {
@x = fcopy(@_) or return;
} else {
@x = dircopy(@_) or return;
}
if(@x) {
if($fl) {
unlink $_[0] or return;
} else {
pathrmdir($_[0]) or return;
}
if($RemvBase) {
my ($volm, $path) = File::Spec->splitpath($_[0]);
pathrm(File::Spec->catpath($volm,$path,''), $ForcePth, $NoFtlPth) or return;
}
}
return wantarray ? @x : $x[0];
};
my $ok_todo_asper_condcopy = sub {
my $org = shift;
my $copy = 1;
if(exists $CondCopy->{$org}) {
if($CondCopy->{$org}{'md5'}) {
}
if($copy) {
}
}
return $copy;
};
sub fcopy {
$samecheck->(@_) or return;
if($RMTrgFil && (-d $_[1] || -e $_[1]) ) {
my $trg = $_[1];
if( -d $trg ) {
my @trgx = File::Spec->splitpath( $_[0] );
$trg = File::Spec->catfile( $_[1], $trgx[ $#trgx ] );
}
$samecheck->($_[0], $trg) or return;
if(-e $trg) {
if($RMTrgFil == 1) {
unlink $trg or carp "\$RMTrgFil failed: $!";
} else {
unlink $trg or return;
}
}
}
my ($volm, $path) = File::Spec->splitpath($_[1]);
if($path && !-d $path) {
pathmk(File::Spec->catpath($volm,$path,''), $NoFtlPth);
}
if( -l $_[0] && $CopyLink ) {
carp "Copying a symlink ($_[0]) whose target does not exist"
if !-e readlink($_[0]) && $BdTrgWrn;
symlink readlink(shift()), shift() or return;
} else {
copy(@_) or return;
my @base_file = File::Spec->splitpath($_[0]);
my $mode_trg = -d $_[1] ? File::Spec->catfile($_[1], $base_file[ $#base_file ]) : $_[1];
chmod scalar((stat($_[0]))[2]), $mode_trg if $KeepMode;
}
return wantarray ? (1,0,0) : 1; # use 0's incase they do math on them and in case rcopy() is called in list context = no uninit val warnings
}
sub rcopy {
if (-l $_[0] && $CopyLink) {
goto &fcopy;
}
goto &dircopy if -d $_[0] || substr( $_[0], ( 1 * -1), 1) eq '*';
goto &fcopy;
}
sub rcopy_glob {
$glob->(\&rcopy, @_);
}
sub dircopy {
if($RMTrgDir && -d $_[1]) {
if($RMTrgDir == 1) {
pathrmdir($_[1]) or carp "\$RMTrgDir failed: $!";
} else {
pathrmdir($_[1]) or return;
}
}
my $globstar = 0;
my $_zero = $_[0];
my $_one = $_[1];
if ( substr( $_zero, ( 1 * -1 ), 1 ) eq '*') {
$globstar = 1;
$_zero = substr( $_zero, 0, ( length( $_zero ) - 1 ) );
}
$samecheck->( $_zero, $_[1] ) or return;
if ( !-d $_zero || ( -e $_[1] && !-d $_[1] ) ) {
$! = 20;
return;
}
if(!-d $_[1]) {
pathmk($_[1], $NoFtlPth) or return;
} else {
if($CPRFComp && !$globstar) {
my @parts = File::Spec->splitdir($_zero);
while($parts[ $#parts ] eq '') { pop @parts; }
$_one = File::Spec->catdir($_[1], $parts[$#parts]);
}
}
my $baseend = $_one;
my $level = 0;
my $filen = 0;
my $dirn = 0;
my $recurs; #must be my()ed before sub {} since it calls itself
$recurs = sub {
my ($str,$end,$buf) = @_;
$filen++ if $end eq $baseend;
$dirn++ if $end eq $baseend;
$DirPerms = oct($DirPerms) if substr($DirPerms,0,1) eq '0';
mkdir($end,$DirPerms) or return if !-d $end;
chmod scalar((stat($str))[2]), $end if $KeepMode;
if($MaxDepth && $MaxDepth =~ m/^\d+$/ && $level >= $MaxDepth) {
return ($filen,$dirn,$level) if wantarray;
return $filen;
}
$level++;
my @files;
if ( $] < 5.006 ) {
opendir(STR_DH, $str) or return;
@files = grep( $_ ne '.' && $_ ne '..', readdir(STR_DH));
closedir STR_DH;
}
else {
opendir(my $str_dh, $str) or return;
@files = grep( $_ ne '.' && $_ ne '..', readdir($str_dh));
closedir $str_dh;
}
for my $file (@files) {
my ($file_ut) = $file =~ m{ (.*) }xms;
my $org = File::Spec->catfile($str, $file_ut);
my $new = File::Spec->catfile($end, $file_ut);
if( -l $org && $CopyLink ) {
carp "Copying a symlink ($org) whose target does not exist"
if !-e readlink($org) && $BdTrgWrn;
symlink readlink($org), $new or return;
}
elsif(-d $org) {
$recurs->($org,$new,$buf) if defined $buf;
$recurs->($org,$new) if !defined $buf;
$filen++;
$dirn++;
}
else {
if($ok_todo_asper_condcopy->($org)) {
if($SkipFlop) {
fcopy($org,$new,$buf) or next if defined $buf;
fcopy($org,$new) or next if !defined $buf;
}
else {
fcopy($org,$new,$buf) or return if defined $buf;
fcopy($org,$new) or return if !defined $buf;
}
chmod scalar((stat($org))[2]), $new if $KeepMode;
$filen++;
}
}
}
1;
};
$recurs->($_zero, $_one, $_[2]) or return;
return wantarray ? ($filen,$dirn,$level) : $filen;
}
sub fmove { $move->(1, @_) }
sub rmove {
if (-l $_[0] && $CopyLink) {
goto &fmove;
}
goto &dirmove if -d $_[0] || substr( $_[0], ( 1 * -1), 1) eq '*';
goto &fmove;
}
sub rmove_glob {
$glob->(\&rmove, @_);
}
sub dirmove { $move->(0, @_) }
sub pathmk {
my @parts = File::Spec->splitdir( shift() );
my $nofatal = shift;
my $pth = $parts[0];
my $zer = 0;
if(!$pth) {
$pth = File::Spec->catdir($parts[0],$parts[1]);
$zer = 1;
}
for($zer..$#parts) {
$DirPerms = oct($DirPerms) if substr($DirPerms,0,1) eq '0';
mkdir($pth,$DirPerms) or return if !-d $pth && !$nofatal;
mkdir($pth,$DirPerms) if !-d $pth && $nofatal;
$pth = File::Spec->catdir($pth, $parts[$_ + 1]) unless $_ == $#parts;
}
1;
}
sub pathempty {
my $pth = shift;
return 2 if !-d $pth;
my @names;
my $pth_dh;
if ( $] < 5.006 ) {
opendir(PTH_DH, $pth) or return;
@names = grep !/^\.+$/, readdir(PTH_DH);
}
else {
opendir($pth_dh, $pth) or return;
@names = grep !/^\.+$/, readdir($pth_dh);
}
for my $name (@names) {
my ($name_ut) = $name =~ m{ (.*) }xms;
my $flpth = File::Spec->catdir($pth, $name_ut);
if( -l $flpth ) {
unlink $flpth or return;
}
elsif(-d $flpth) {
pathrmdir($flpth) or return;
}
else {
unlink $flpth or return;
}
}
if ( $] < 5.006 ) {
closedir PTH_DH;
}
else {
closedir $pth_dh;
}
1;
}
sub pathrm {
my $path = shift;
return 2 if !-d $path;
my @pth = File::Spec->splitdir( $path );
my $force = shift;
while(@pth) {
my $cur = File::Spec->catdir(@pth);
last if !$cur; # necessary ???
if(!shift()) {
pathempty($cur) or return if $force;
rmdir $cur or return;
}
else {
pathempty($cur) if $force;
rmdir $cur;
}
pop @pth;
}
1;
}
sub pathrmdir {
my $dir = shift;
if( -e $dir ) {
return if !-d $dir;
}
else {
return 2;
}
pathempty($dir) or return;
rmdir $dir or return;
}
1;
__END__
#line 696
MojoMojo-1.12/root/ 0000755 0001750 0001750 00000000000 13105607167 013525 5 ustar marcus marcus MojoMojo-1.12/root/base/ 0000755 0001750 0001750 00000000000 13105607167 014437 5 ustar marcus marcus MojoMojo-1.12/root/base/this_page_link.tt 0000644 0001750 0001750 00000001306 13021751557 017770 0 ustar marcus marcus [%- IF c.req.action == "view" %]
[%- IF (!rev OR rev == page.content_version)
AND (
c.pref('anonymous_user')
OR
(user.active AND user.can_edit(page.path))
)
+%]
[% loc('Edit page') %]
[% ELSE +%]
[% loc('Edit page') %]
[% END %]
[% ELSE +%]
[% loc('Page') %]
[% END %]
MojoMojo-1.12/root/base/comment/ 0000755 0001750 0001750 00000000000 13105607167 016101 5 ustar marcus marcus MojoMojo-1.12/root/base/comment/post.tt 0000644 0001750 0001750 00000000526 13021751557 017442 0 ustar marcus marcus
MojoMojo-1.12/root/base/comment/login.tt 0000644 0001750 0001750 00000001203 13021751557 017556 0 ustar marcus marcus
MojoMojo-1.12/root/base/top.tt 0000644 0001750 0001750 00000000025 13021751557 015607 0 ustar marcus marcus [% template.title %]
MojoMojo-1.12/root/base/user/ 0000755 0001750 0001750 00000000000 13105607167 015415 5 ustar marcus marcus MojoMojo-1.12/root/base/user/validate.tt 0000644 0001750 0001750 00000001677 13021751557 017572 0 ustar marcus marcus [% WRAPPER page/wrapper.tt simple_header=1 simple_footer=1 title=loc('Email Validation') %]
[% IF error %]
[% error %]
[% ELSE %]
[% loc('Validation') %]
[% loc("We've sent you an email with an activation link. Please click on it to activate your account!") %]
[% loc('The email was sent to x.', user.email) %]
[% END %]
[% loc("Didn't receive an email?") %]
[% loc('Fill in the email address you want to use here') %]:
[% SET link = '
' _ loc('log out') _ '' %]
[% loc('If you are unable to validate, please x', link) %].
[% END # WRAPPER %]
MojoMojo-1.12/root/base/user/profile.tt 0000644 0001750 0001750 00000004131 13021751557 017425 0 ustar marcus marcus [%
SET title = loc('User profile for x',person.name);
WRAPPER page/wrapper.tt title = title;
%]
[% IF (user.login == page.name OR user.link == proto_pages.first.path
OR ( user.is_admin AND user.get_user(page.name) ) ) +%]
[% loc('Edit Profile') %]
[% END +%]
- [% loc('Name') %]:
- [% person.name || loc('Name missing') %]
[% IF person.email %]
[% IF user.admin || user.id == person.id +%]
- [% loc('Email') %]:
- [% person.email.replace('\@', '@fbi.gov') %]
[% END %]
[% END %]
[% IF person.age %]
- [% loc('Age') %]:
- [% person.age %]
[%+ END +%]
[% IF person.gender +%]
- [% loc('Gender') %]:
- [% person.gender %]
[%+ END %]
[% IF person.timezone +%]
- [% loc('Timezone') %]:
- [% person.timezone %]
[%+ END %]
[% IF person.industry +%]
- [% loc('Industry') %]:
- [% person.industry %]
[%+ END %]
[% IF person.interests_formatted +%]
- [% loc('Interests') %]:
- [% person.interests_formatted %]
[%+ END %]
[% IF person.music_formatted +%]
- [% loc('Music') %]:
- [% person.music_formatted %]
[%+ END %]
[% IF person.movies_formatted +%]
- [% loc('Movies') %]:
- [% person.movies_formatted %]
[%+ END +%]
- [% loc('Date registered') %]:
- [% c.tz(person.registered).ymd %]
- [% loc('Edits') %]:
-
-
[% FOREACH changed IN person.pages +%]
[%+ '–' UNLESS loop.first %] [% c.wikiword(changed.path, base) %]
[% END +%]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/user/user_search.tt 0000644 0001750 0001750 00000000123 13021751557 020265 0 ustar marcus marcus [%- FOREACH user IN users -%]
[% user.login %]|[% user.id %][% "\n" %]
[%- END -%]
MojoMojo-1.12/root/base/user/recover_pass.tt 0000644 0001750 0001750 00000000725 13021751557 020465 0 ustar marcus marcus [% WRAPPER page/wrapper.tt simple_header=1 title=loc('Recover Password') %]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/user/login.tt 0000644 0001750 0001750 00000001010 13021751557 017066 0 ustar marcus marcus [% WRAPPER page/wrapper.tt simple_header=1 title=loc('Login') %]
[% IF message %]
[% message %]
[% END %]
[% form %]
[% IF( c.pref( 'open_registration' ) ) %]
[% loc('Register new account') %] [% loc('or') %]
[% END %]
[% loc('Recover password') %]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/user/prefs.tt 0000644 0001750 0001750 00000000623 13021751557 017106 0 ustar marcus marcus [% WRAPPER page/wrapper.tt title=loc("preferences") %]
[% loc('Your Account') %]
[%message%]
[% form %]
[% END %]
MojoMojo-1.12/root/base/user/register.tt 0000644 0001750 0001750 00000000465 13021751557 017617 0 ustar marcus marcus [% WRAPPER page/wrapper.tt simple_footer=1 simple_header=1 title=loc('New User Registration') %]
[% IF account_taken %]
[% account_taken %]
[% END %]
[% form %]
[%message%]
[% END %]
MojoMojo-1.12/root/base/user/list.tt 0000644 0001750 0001750 00000001222 13021751557 016736 0 ustar marcus marcus [% WRAPPER page/wrapper.tt title = title || c.pref('name') %]
[% PROCESS pager.tt %]
[% WHILE( u = users.next ) -%]
-
[% c.wikiword( u.link, base, u.name, 'profile') -%]
-
[% pages = u.pages -%]
[% UNLESS pages %]
[% loc('No recent changes') %]
[% END -%]
[% FOREACH changed IN pages -%]
[% c.wikiword( changed.path, base ) -%][% '–' UNLESS loop.last -%]
[% END -%]
[% END -%]
[% PROCESS pager.tt %]
[% END # WRAPPER -%]
MojoMojo-1.12/root/base/user/editprofile.tt 0000644 0001750 0001750 00000000224 13021751557 020272 0 ustar marcus marcus [% WRAPPER page/wrapper.tt simple_footer=1 title=loc('Editing user profile for x', user.name) %]
[% form %]
[% END %]
MojoMojo-1.12/root/base/rest/ 0000755 0001750 0001750 00000000000 13105607167 015414 5 ustar marcus marcus MojoMojo-1.12/root/base/rest/page/ 0000755 0001750 0001750 00000000000 13105607167 016330 5 ustar marcus marcus MojoMojo-1.12/root/base/rest/page/view.tt 0000644 0001750 0001750 00000000071 13021751557 017651 0 ustar marcus marcus
[%page.for_rest%]
MojoMojo-1.12/root/base/rest/page/recent.tt 0000644 0001750 0001750 00000000137 13021751557 020162 0 ustar marcus marcus
[% FOREACH page IN pages %]
[%page.for_rest%]
[% END %]
MojoMojo-1.12/root/base/extensions/ 0000755 0001750 0001750 00000000000 13105607167 016636 5 ustar marcus marcus MojoMojo-1.12/root/base/extensions/counter.tt 0000644 0001750 0001750 00000000366 13021751557 020673 0 ustar marcus marcus [% WRAPPER page/wrapper.tt index_page=(c.req.params.rev ? 0 : 1) +%]
[% count -%]
+
-
[% END # WRAPPER %]
MojoMojo-1.12/root/base/child_menu.tt 0000644 0001750 0001750 00000000525 13021751557 017121 0 ustar marcus marcus
MojoMojo-1.12/root/base/message.tt 0000644 0001750 0001750 00000001136 13021751557 016435 0 ustar marcus marcus [% WRAPPER page/wrapper.tt title=loc('Error') simple_header=1 simple_footer=1 -%]
[% END %]
MojoMojo-1.12/root/base/edithelp/ 0000755 0001750 0001750 00000000000 13105607167 016235 5 ustar marcus marcus MojoMojo-1.12/root/base/edithelp/textile.tt 0000644 0001750 0001750 00000004214 13021751557 020265 0 ustar marcus marcus [%loc('Textile help')%]
[%loc('Textile2 complete reference')%]
_[%loc('your text')%]_ |
-> |
[%loc('your text')%] |
*[%loc('your text')%]* |
-> |
[%loc('your text')%] |
%{color:red}[%loc('hello')%]% |
-> |
[%loc('hello')%] |
* [%loc('Bulleted list')%] * [%loc('Second item')%] |
-> |
• [%loc('Bulleted list')%] • [%loc('Second item')%] |
# [%loc('Numbered list')%] # [%loc('Second item')%] |
-> |
1. [%loc('Numbered list')%] 2. [%loc('Second item')%] |
[% IF(INC.exists('MojoMojo/Formatter/Emote.pm')) -%]
:-) |
-> |
 [%loc('And others.')%] |
[% END -%]
"[%loc('linkname')%]":[%loc('URL')%] |
-> |
[%loc('linkname')%] |
[% IF(INC.exists('MojoMojo/Formatter/Amazon.pm')) -%]
{{http://amazon/url}} |
-> |
[%loc('Show this product')%] |
[% END -%]
[%loc('|a|table|row|')%] [%loc('|b|table|row|')%] |
-> |
[%loc('Table')%] |
!/img/url! |
-> |
[%loc('Image')%] |
[% IF(INC.exists('MojoMojo/Formatter/RSS.pm')) -%]
{{feed://[%loc('your/url')%]}} |
-> |
[%loc('include this rss feed')%] |
[% END -%]
MojoMojo-1.12/root/base/edithelp/markdown.tt 0000644 0001750 0001750 00000013755 13021751557 020443 0 ustar marcus marcus [% loc('Markdown help') %]
[% loc('Text Formatting') %] |
[% loc('Text in') %] [% loc('italics') %] |
[% loc('*italic* or _italic_') %] |
[% loc('Text in') %] [% loc('bold') %] |
[% loc('**bold** or __bold__') %] |
[% loc('Links') %] |
[% loc('Link to Another Page') %] |
[[[% loc('Page Name Here') %]]]
|
[% loc('Links to Other Sites') %]: |
[[% loc('example') %]]([% loc('http://example.com/') %])
[% loc('is formatted as:') %]
[% loc('example') %]
|
[[% loc('example') %]]([% loc('http://example.com/') %] "[% loc('Link Title') %]")
[% loc('is formatted as:') %]
[% loc('example') %]
[% loc('hover over the link to see the title') %]
|
[% loc('Headers') %] |
[% loc('Main Header') %] |
[% loc('Main Header') %]
========
|
[% loc('Main Header') %] |
# [% loc('Main Header') %] |
[% loc('Sub Header') %] |
[% loc('Sub Header') %]
--------
|
[% loc('Sub Header') %] |
## [% loc('Sub Header') %]
## [% loc('Sub Header') %] ##
[% loc('optionally, you can add the same number of trailing # marks') %] |
[% loc('Sub Sub ... Header') %]
[% loc('up to 6 levels of headers') %]
|
###### [% loc('Sub Sub ... Header') %]
###### [% loc('Sub Sub ... Header') %] ###### |
[% loc('Lists') %] |
[% loc('To get') %]:
|
[% loc('Write') %]:
* Foo
* Bar
[% loc('NOTE: you need a blank line before and after the list') %]
|
|
[% loc('For numbered lists, just use numbers instead of asterisks') %]
1. Foo
2. Foo
|
[% loc('For nested lists, indent each level by 3 spaces') %]
- [% loc('Item 1') %]
- [% loc('Item 1.1') %]
- [% loc('Item 1.2') %]
- [% loc('Item 2') %]
|
* [% loc('Item 1') %]
* [% loc('Item 1.1') %]
* [% loc('Item 1.2') %]
* [% loc('Item 1.2.1') %]
* [% loc('Item 2') %]
|
[% loc('Block quotes') %] |
> [% loc('Just like email quoting!') %]
> > [% loc('Blockquotes can be nested') %]
> ## [% loc('An h2 tag in a blockquote') %]
>
> [% loc('And additional Markdown formatting') %]:
> * [% loc('An unordered list') %]
> * [% loc('Item') %]
|
[% loc('Horizontal Rules') %] (<hr>) |
[% loc('3 or more dashes or asterisks') %]: --- [% loc('or') %] *** [% loc('or') %] * * * |
[% loc('Creates') %]:
|
[% loc('Code') %] |
`<[% loc('code') %]>` [% loc('blocks are wrapped in backticks') %]. |
[% loc('Nested backticks') %]: |
`` [% loc('just use `2`') %] `` [% loc('in the wrapping block') %] |
[% loc('Preformatted Code Blocks') %] (<pre>) |
[% loc('Simply indent every line of a code block by 4') %]:
[%- loc('Normal paragraph') +%]
[%+ loc('Spaces on the left
render text in monospace
like this example') +%]
[%+ loc('Going back to normal formatting') %]
[% loc('Note that for programming language code, it may be better to use the Syntax highlight plugin.') %]
|
[% loc('Footnotes') %] ([% loc('details') %]) |
[% loc('As detailed in the book[^footnote1], we will now show that...
...later in the document...
[^footnote1]: Conway, Damian - Perl Best Practices, p. 117') %]
|
[% loc('Images') %] |
[% loc('Inline') %] |
![[% loc('alt text') %]](/image/path/file.jpg "[% loc('Optional Title') %]") |
MojoMojo-1.12/root/base/edithelp/main.tt 0000644 0001750 0001750 00000000100 13021751557 017521 0 ustar marcus marcus [% loc('No help yet for x', c.pref('main_formatter')) %]
MojoMojo-1.12/root/base/sidebar.tt 0000644 0001750 0001750 00000000335 13021751557 016422 0 ustar marcus marcus
[% PROCESS child_menu.tt parent_page = path_pages.0 %]
MojoMojo-1.12/root/base/mail/ 0000755 0001750 0001750 00000000000 13105607167 015361 5 ustar marcus marcus MojoMojo-1.12/root/base/mail/validate.tt 0000644 0001750 0001750 00000000247 13021751557 017526 0 ustar marcus marcus [%loc('Hi. This is a mail to validate your email address, x. To confirm, please click the url below:', user.name)%]
[% c.uri_for('/.validate', user.login, secret) %]
MojoMojo-1.12/root/base/mail/reset_password.tt 0000644 0001750 0001750 00000000346 13021751557 021001 0 ustar marcus marcus [% loc('Hi there.') %]
[% loc('Your password on x has been reset. This is your new password:', c.pref('name') ) +%]
[% password +%]
--
[%+ loc('Have a nice day') +%]
[%+ loc('MojoMojo - The elegant wiki, Catalyst-powered') +%]
MojoMojo-1.12/root/base/gallery/ 0000755 0001750 0001750 00000000000 13105607167 016076 5 ustar marcus marcus MojoMojo-1.12/root/base/gallery/photo_info.tt 0000644 0001750 0001750 00000001267 13021751557 020621 0 ustar marcus marcus [% loc('Exif Data') %]
- [% loc('Taken') %]:
- [% IF photo.taken %][% USE taken=String(photo.taken); taken.replace('T',' ') %][% ELSE %][% loc('not specified') %][% END %]
- [% loc('Camera') %]:
- [% photo.camera || loc('not specified') %]
- [% loc('Lens') %]:
- [% photo.lens.replace('\.\d+mm$','mm') || loc('not specified') %]
- [% loc('ISO') %]:
- [% photo.iso|| loc('not specified') %]
- [% loc('Aperture') %]:
- [% IF photo.aperture %]f/[% photo.aperture %][% ELSE %][% loc('not specified') %][% END %]
- [% loc('Flash') %]:
- [% photo.flash|| loc('not specified') %]
MojoMojo-1.12/root/base/gallery/cloud.tt 0000644 0001750 0001750 00000000333 13021751557 017554 0 ustar marcus marcus [% WRAPPER page/wrapper.tt index_page=1 title=loc('photo tags') %]
[%
IF cloud.tags(1);
cloud.html_and_css(50);
ELSE;
"No tags in use";
END;
%]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/gallery/photo.tt 0000644 0001750 0001750 00000003304 13021751557 017600 0 ustar marcus marcus [%
title = page.name == '/' ? c.pref("name")
: c.expand_wikilink(page.name_orig);
title = title _ " " _ loc('gallery') _ " - " _ photo.title;
IF tag;
title = title _ ' (' _ tag _ ')';
END;
gallery_footer = 1;
index_page = 1;
WRAPPER page/wrapper.tt;
-%]
[% IF photo %]
[% photo.title | html %]
[% IF prev %]
<
[% END %]
(i)
[% IF next %]
>
[% END %]
[% photo.description.remove('^\s+$') || loc('no description') | html %]
[% END %]
[%+ IF c.user.obj.can_edit(page) # FIXME: inline editing needs to be formatted same as viewing the element.%]
[%+ END %]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/gallery/footer.tt 0000644 0001750 0001750 00000001237 13021751557 017750 0 ustar marcus marcus [% IF user %]
[% ELSE %]
[% END %]
[% PROCESS gallery/tags.tt %]
[% PROCESS footer.tt %]
MojoMojo-1.12/root/base/gallery/imginfo.tt 0000644 0001750 0001750 00000000250 13021751557 020074 0 ustar marcus marcus [% photo.title %]
[% photo.description %]
[% PROCESS gallery/photo_info.tt %]
MojoMojo-1.12/root/base/gallery/pager.tt 0000644 0001750 0001750 00000001232 13021751557 017543 0 ustar marcus marcus
[% UNLESS pager.current_page==pager.first_page %]
«
<
[% END %]
[% UNLESS pager.current_page==pager.last_page %]
>
»
[% END %]
[% SET link= c.wikiword(page.path,base, loc('gallery') ,'gallery') _ " " _ c.wikiword(page.path,base) %]
[%loc( 'Showing x (x-x) of x pictures in x', [pager.entries_on_this_page,pager.first,pager.last,pager.total_entries, link ])
%]
MojoMojo-1.12/root/base/gallery/tags.tt 0000644 0001750 0001750 00000002234 13021751557 017406 0 ustar marcus marcus
- [% loc('My tags') %]:
-
[% IF tags %]
[% FOREACH tag IN tags %]
[%IF tag.tag == highlight %]
[% tag.tag %] [x][% UNLESS loop.last() %],[% END %]
[%END%]
[%END%]
- [% loc('Popular tags') %]:
-
[%IF others_tags %]
[% FOREACH othertag IN others_tags %]
[% SET tagmatch='\b' _ othertag.tag _ '\b' %]
[% NEXT IF taglist.match(tagmatch) %]
[%IF othertag.tag == highlight %]
[% othertag.tag %]
[% IF user.active %]
[+][% UNLESS loop.last() %],[% END %]
[%END%]
[%END%]
[%END%]
MojoMojo-1.12/root/base/feeds.tt 0000644 0001750 0001750 00000001004 13021751557 016071 0 ustar marcus marcus [% WRAPPER page/wrapper.tt title=loc('Feeds') %]
[%loc('You can subscribe to this wiki by RSS and get either just the headlines of the pages that change or the entire page.')%]
[% END %]
MojoMojo-1.12/root/base/tag/ 0000755 0001750 0001750 00000000000 13105607167 015212 5 ustar marcus marcus MojoMojo-1.12/root/base/tag/cloud.tt 0000644 0001750 0001750 00000000716 13021751557 016675 0 ustar marcus marcus [% SET title = loc('Tags under x', page.name) %]
[% WRAPPER page/wrapper.tt title=title index_page=1 %]
[%
IF cloud.tags(1);
cloud.html_and_css(50);
ELSE;
loc('No tags in use.');
END;
%]
[% IF page.depth %]
[% SET link = '' _ loc('All tags') _ '' %]
[% loc('Or you can check out x instead', link) %]
[% END %]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/tag/recent.tt 0000644 0001750 0001750 00000002056 13021751557 017046 0 ustar marcus marcus [% PROCESS header.tt %]
[% SET now=c.tz(pages.first.updated).ymd; %]
[% PROCESS breadcrumbs.tt %]
[% PROCESS navbar.tt %]
[% loc('Tags') %]:
[% FOREACH tag IN tags.list %]
[% IF tag.tag==activetag %]
[% tag.tag %]
[% ELSE %]
[% tag.tag %] ([% tag.refcount %])
[% END %]
[% END %]
[% now %]
[% FOREACH page IN pages %]
[% IF now != c.tz(page.content.created).ymd; %]
[% SET now = c.tz(page.content.created).ymd; %]
[% now %]
[% PROCESS footer.tt %]
MojoMojo-1.12/root/base/tag/list.tt 0000644 0001750 0001750 00000002510 13021751557 016534 0 ustar marcus marcus [% PROCESS header.tt %]
[% UNLESS page.name == "/" %][% PROCESS breadcrumbs.tt %][% END %]
[% c.pref("name") %]
[% loc('All Pages') %]
[% PROCESS navbar.tt %]
[% loc('tags') %]:
[% FOREACH tag IN tags %]
[% IF tag.tag==activetag %]
[% tag.tag %]
[% ELSE %]
[% tag.tag %] ([% tag.refcount %])
[% END %]
[% END %]
[% loc('List by x', activetag) %]
[% loc('All pages tagged with x listed alphabetically', activetag) %]
[% loc('Recent pages in x', activetag) %]
[% loc('Related Tags') %]
([% loc('common uses') %])
[% FOR reltag = related.list %]
- [% reltag.tag %] ([% reltag.refcount %])
[% END %]
[% PROCESS footer.tt %]
MojoMojo-1.12/root/base/attachments/ 0000755 0001750 0001750 00000000000 13105607167 016752 5 ustar marcus marcus MojoMojo-1.12/root/base/attachments/list.tt 0000644 0001750 0001750 00000005333 13021751557 020302 0 ustar marcus marcus
Filename |
Type |
Size |
Date |
Actions |
[%
can_edit = c.check_permissions(page.path, c.user).edit;
can_attachment = c.check_permissions(page.path, c.user).attachment;
%]
[% FOR attachment IN page.attachments +%]
[% attachment.name %]
[% IF attachment.is_image %]
[% END %]
|
[% loc(attachment.human_type) %]
|
[%IF attachment.size %][% attachment.human_size %] [% ELSE %] Unknown[%END%]
|
[% attachment.uploaded.strftime('%Y-%m-%d') %]
|
|
[% END +%]
[% loc('View as gallery') %]
MojoMojo-1.12/root/base/admin/ 0000755 0001750 0001750 00000000000 13105607167 015527 5 ustar marcus marcus MojoMojo-1.12/root/base/admin/create_role.tt 0000644 0001750 0001750 00000000412 13021751557 020361 0 ustar marcus marcus [%
admin_header = 1;
title = c.pref('name');
selected = 'roles';
back = 'admin/role';
WRAPPER page/wrapper.tt;
%]
[%loc('Create Role')%]
[% PROCESS admin/role_form.tt active = 1 %]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/admin/settings.tt 0000644 0001750 0001750 00000000436 13021751557 017743 0 ustar marcus marcus [%
admin_header = 1;
title = c.pref('name');
selected = 'configuration';
WRAPPER page/wrapper.tt;
%]
[% loc('Site Configuration') %]
[% form %]
[% IF message %]
[% message %]
[% END %]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/admin/user.tt 0000644 0001750 0001750 00000003172 13021751557 017061 0 ustar marcus marcus [%
admin_header = 1;
title = c.pref('name');
selected = 'user';
WRAPPER page/wrapper.tt;
%]
[% c.loc('Users') %]
[% c.loc('Active') %] |
[% c.loc('login') %] |
[% c.loc('roles') %] |
[% loc('name') %] |
[% loc('email') %] |
[% WHILE (user=users.next) %]
[% activeurl= c.uri_for('/.admin/update_user', user.id , 'active') %]
[% active=(user.active==1) ? loc('yes') : loc('no') %]
[% active %] |
[% user.login %] |
[% FOR role=user.roles %] [% role.name %] [% END %] |
[% user.name %] |
[% IF user.email %]
[%user.email%]
[% ELSE %]
[% loc("no email address") %]
[% END %]
|
[% END %]
[% IF pager.previous_page %]
[% loc('Previous') %]
[% END %]
[% IF pager.previous_page AND pager.next_page %]
|
[% END %]
[% IF pager.next_page %]
[% loc('Next') %]
[% END %]
[% loc('Add user') %]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/admin/role_form.tt 0000644 0001750 0001750 00000002720 13021751557 020065 0 ustar marcus marcus
MojoMojo-1.12/root/base/admin/role.tt 0000644 0001750 0001750 00000002074 13021751557 017044 0 ustar marcus marcus [%
admin_header = 1;
title = c.pref('name');
selected = 'roles';
WRAPPER page/wrapper.tt;
%]
[% loc('Roles') %]
[% IF roles.size > 0 %]
[%loc('Create a new role')%]
[%loc('ID')%] |
[%loc('Name')%] |
[%loc('Active')%] |
|
[% FOREACH role IN roles %]
[% role.id %] |
[% role.name %] |
[% role.active ? loc('Yes') : loc('No') %] |
[%loc('Edit')%] |
[% END %]
[% ELSE %]
[% END %]
[% message %]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/admin/edit_role.tt 0000644 0001750 0001750 00000000446 13021751557 020052 0 ustar marcus marcus [%
admin_header = 1;
title = c.pref('name');
selected = 'roles';
back = 'admin/role';
WRAPPER page/wrapper.tt;
%]
[%loc('Edit Role')%]
[% PROCESS admin/role_form.tt active = role.active, role_name => role.name %]
[% END # WRAPPER %]
MojoMojo-1.12/root/base/admin/update_user.tt 0000644 0001750 0001750 00000000041 13021751557 020413 0 ustar marcus marcus [% user.active ? 'yes' : 'no' %]
MojoMojo-1.12/root/base/admin/toplinks.tt 0000644 0001750 0001750 00000001105 13021751557 017740 0 ustar marcus marcus [%- DEFAULT back = 'view' -%]
[%- MACRO gen_link(action, label, accesskey, selected) BLOCK; -%]
[% label %]
[%- END -%]
[% FILTER nav %]
[%+ gen_link('/.admin', loc('Configuration'), 'C', selected) %]
[%+ gen_link('admin/user', loc('Users'), 'U', selected) %]
[%+ gen_link('admin/role', loc('Roles'), 'R', selected) %]
[%+ gen_link(back, loc('Home'), 'B', selected) +%]
[% END %]
MojoMojo-1.12/root/base/mimetypes/ 0000755 0001750 0001750 00000000000 13105607167 016453 5 ustar marcus marcus MojoMojo-1.12/root/base/mimetypes/image.tt 0000644 0001750 0001750 00000000254 13021751557 020107 0 ustar marcus marcus
MojoMojo-1.12/root/base/mimetypes/default.tt 0000644 0001750 0001750 00000000521 13021751557 020446 0 ustar marcus marcus [% SET link = c.uri_for("attachment",att.id) %]
[% SET link = link.replace ('.+//.+?/','/') %]
[% IF c.pref('main_formatter') == "MojoMojo::Formatter::Textile" +%]
"[%att.name%]":[% link %]
[% ELSIF c.pref('main_formatter') == "MojoMojo::Formatter::Markdown" +%]
[[%att.name%]]([% link %])
[% ELSE %]
"[%att.name%]":[% link %]
[% END %]
MojoMojo-1.12/root/base/footer.tt 0000644 0001750 0001750 00000000413 13021751557 016304 0 ustar marcus marcus