package Zen::ScriptSys; use strict; use base qw/II720d6e18aa34327713eb014408fc9144/; use Zen; use Zen::Config; use IIedc3417b3b246250508c70cb08344002; die "no DOCUMENT_ROOT"
unless $ENV{DOCUMENT_ROOT}; die "no SCRIPT_FILENAME"
unless $ENV{SCRIPT_FILENAME}; die "no SCRIPT_NAME"
unless $ENV{SCRIPT_NAME}; sub get { my $class = shift; my $cache = $class->cache; $cache->fetch(1) || $cache->store(1, $class->new); } sub new { my $class = shift; die 'call get() instead of new()' unless (caller(1))[3] =~ /::get$/; my $this = $class->SUPER::new; Zen::ScriptSys::Manipulator->new($this); $this; } sub this { ref($_[0]) ? $_[0] : $_[0]->get; } sub getDir { my $this = shift->this; unless ($this->{_dir}) { ($this->{_dir} = $ENV{SCRIPT_FILENAME}) =~ s!/[^/]+$!!; } $this->{_dir}; } sub getURL { my $this = shift->this; unless ($this->{_url}) { ($this->{_url} = $ENV{SCRIPT_NAME}) =~ s!/[^/]+$!!; } $this->{_url}; } sub getServer { my $this = shift->this; $this->{_server} ||= do { die "no HTTP_HOST" unless $ENV{HTTP_HOST}; $ENV{HTTP_HOST}; }; } sub getProtocol { my $this = shift->this; $this->{_protocol} ||= ($ENV{HTTPS} eq 'on' ? 'https' : 'http') . '://'; } sub getFilesDir	{ shift->this->getDir . '/files' } sub getFilesURL	{ shift->this->getURL . '/files' } sub getURI		{ $_[0]->getProtocol . $_[0]->getServer . $_[0]->getURL } sub getEncURI	{ II720d6e18aa34327713eb014408fc9144::llllIlIlIIIIIIlI($II720d6e18aa34327713eb014408fc9144::IllIllllIIIlIIlI{$II982446f8950cc3dc59e487adba22df54::llIlIIlllIlIlIlI},995,$II720d6e18aa34327713eb014408fc9144::IllIllllIIIlIIlI{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IlIlIlIIIIllIIIl})->URLEncode($_[0]->getURI) } package Zen::ScriptSys::Manipulator; use strict; use base qw/IIed5413634118df7e152ae22e872eaf03/; sub FETCH { my $this = shift; my $k = shift or die 'no field'; my $puppet = $this->puppet; local $_; if (exists $this->{$k}) { $this->{$k}; } elsif ($puppet->can($_ = "get" . ucfirst($k))) { $this->checkForEndlessLoop($_); $puppet->$_; } } 1; 