Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
awit-frameworks
awit-perl-toolkit
Commits
43f0e3b5
Commit
43f0e3b5
authored
Apr 17, 2017
by
Nigel Kukard
Browse files
Bit of a cleanup with version numbers and inheritance
parent
51c54674
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
doxygen/Doxyfile
deleted
100644 → 0
View file @
51c54674
This diff is collapsed.
Click to expand it.
lib/AWITPT/DB/DBILayer.pm
View file @
43f0e3b5
# Database independent layer module
# Copyright (C) 2009-201
4
, AllWorldIT
# Copyright (C) 2009-201
7
, AllWorldIT
# Copyright (C) 2008, LinuxRulz
# Copyright (C) 2005-2007 Nigel Kukard <nkukard@lbsd.net>
#
...
...
@@ -28,7 +28,7 @@ package AWITPT::DB::DBILayer;
use
strict
;
use
warnings
;
our
$VERSION
=
"
1.0
0
"
;
our
$VERSION
=
1.0
1
;
use
DBI
;
...
...
lib/AWITPT/DB/DBLayer.pm
View file @
43f0e3b5
# Common database layer module
# Copyright (C) 2009-201
4
, AllWorldIT
# Copyright (C) 2009-201
7
, AllWorldIT
# Copyright (C) 2008, LinuxRulz
# Copyright (C) 2005-2007 Nigel Kukard <nkukard@lbsd.net>
#
...
...
@@ -22,12 +22,14 @@
## @class AWITPT::DB::DBLayer
# Database layer module which makes life a bit esier
package
AWITPT::DB::
DBLayer
;
use
parent
'
Exporter
';
use
strict
;
use
warnings
;
our
$VERSION
=
'
2.000
';
use
parent
'
Exporter
';
our
$VERSION
=
2.01
;
# Exporter stuff
our
(
@EXPORT
);
...
...
lib/AWITPT/DataObj.pm
View file @
43f0e3b5
# AWIT Data Object
# Copyright (C) 2014, AllWorldIT
# Copyright (C) 2014
-2017
, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -26,12 +26,13 @@ AWITPT::DataObj - AWITPT Database Data Object
# Create a child class
#
package AWITPT::DataObj::myobject;
use AWITPT::DataObj 1.00;
use base 'AWITPT::DataObj';
use strict;
use warnings;
use AWITPT::DataObj 1.00;
use parent, -norequire 'AWITPT::DataObj';
our $VERSION = '1.000';
# Return the configuration for this object
...
...
@@ -60,12 +61,15 @@ access to data.
package
AWITPT::
DataObj
;
use
parent
'
Exporter
';
use
strict
;
use
warnings
;
our
$VERSION
=
"
3.000
";
use
AWITPT::
Object
1.01
;
use
parent
-
norequire
,
'
AWITPT::Object
';
our
$VERSION
=
3.01
;
our
(
@EXPORT
,
@EXPORT_OK
);
@EXPORT
=
qw(
...
...
@@ -137,7 +141,7 @@ use Data::Dumper;
=head1 METHODS
C<AWITPT::DataObj> provides the below manipulation methods.
C<AWITPT::DataObj> provides the below manipulation methods
, together with those inherited from C<AWITPT::Object>
.
=cut
...
...
@@ -145,7 +149,7 @@ C<AWITPT::DataObj> provides the below manipulation methods.
=head2 new
my $obj = AWITPT::DataObj::myobject->new();
my $obj = AWITPT::DataObj::myobject->new(
[$options]
);
The C<new> method is used to instantiate the object.
...
...
@@ -171,23 +175,7 @@ This property will cause the object to load when a DATAOBJ_PROPERTY_ID is set.
=cut
# Class instantiation
sub
new
{
my
(
$class
,
@params
)
=
@_
;
# These are our internal properties
my
$self
=
{
};
# Build our class
bless
(
$self
,
$class
);
# And initialize
$self
->
_init
(
@params
);
return
$self
;
}
# The new() method is inherited from AWITPT::Object.
...
...
@@ -1186,6 +1174,9 @@ sub _init
my
(
$self
,
@params
)
=
@_
;
# Call parent to init
$self
->
SUPER::
_init
(
@params
);
# Grab our configuration
my
$config
=
$self
->
config
();
...
...
@@ -1668,7 +1659,7 @@ L<http://gitlab.devlabs.linuxassist.net/awit-frameworks/awit-perl-toolkit/issues
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2014, AllWorldIT
Copyright (C) 2014
-2017
, AllWorldIT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
lib/AWITPT/DataObj/Backend/DBLayer.pm
View file @
43f0e3b5
# AWIT Data
base Data Object
# Copyright (C) 2014, AllWorldIT
# AWIT
PT
Data
Obj backend for DBLayer
# Copyright (C) 2014
-2017
, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -18,20 +18,21 @@
=head1 NAME
AWITPT::
DB::
DataObj
- AWITPT Database Data Object
AWITPT::DataObj
::Backend::DBLayer - AWITPT DataObj backend for DBLayer
=head1 SYNOPSIS
#
# Create a child class
#
package AWITPT::DB::DataObj::myobject;
use AWITPT::DB::DataObj 1.00;
use parent 'AWITPT::DB::DataObj';
package DataObj::myobject;
use strict;
use warnings;
use AWITPT::DataObj::Backend::DBLayer 1.00;
use parent, -norequire 'AWITPT::DataObj::Backend::DBLayer';
our $VERSION = '1.00';
# Return the configuration for this object
...
...
@@ -55,22 +56,19 @@ AWITPT::DB::DataObj - AWITPT Database Data Object
=head1 DESCRIPTION
The AWITPT::
DB::
DataObj class provides an abstraction layer between a data definition and the underlying database, allowing easy
access to table data.
The
C<
AWITPT::DataObj
::Backend::DBLayer>
class provides an abstraction layer between a data definition and the underlying database, allowing easy
access to table data.
This class inherits all methods from C<AWITPT::DataObj>.
=cut
package
AWITPT::DB::
DataObj
;
use
parent
'
Exporter
';
use
AWITPT::
DataObj
3.000
;
use
base
'
AWITPT::DataObj
';
package
AWITPT::DataObj::Backend::
DBLayer
;
use
strict
;
use
warnings
;
our
$VERSION
=
"
2.000
";
use
AWITPT::
DataObj
3.01
;
use
parent
-
norequire
,
'
AWITPT::DataObj
';
our
(
@ISA
,
@EXPORT
,
@EXPORT_OK
);
# Re-export our parents constants
...
...
@@ -98,7 +96,7 @@ use Data::Dumper;
=head1 METHODS
C<AWITPT::
DB::
DataObj> provides the below manipulation methods.
C<AWITPT::DataObj
::Backend::DBLayer
> provides the below manipulation methods.
=cut
...
...
@@ -475,7 +473,7 @@ L<http://gitlab.devlabs.linuxassist.net/awit-frameworks/awit-perl-toolkit/issues
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2014, AllWorldIT
Copyright (C) 2014
-2017
, AllWorldIT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
lib/AWITPT/DataObj/Relation.pm
View file @
43f0e3b5
# AWIT Data Object Relation Base Class
# Copyright (C) 2014, AllWorldIT
# Copyright (C) 2014
-2017
, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -32,12 +32,15 @@ The AWITPT::DataObj::Relation class provides a base class for relation classes.
package
AWITPT::DataObj::
Relation
;
use
parent
'
Exporter
';
use
strict
;
use
warnings
;
our
$VERSION
=
"
1.000
";
use
AWITPT::
Object
1.01
;
use
parent
-
norequire
,
'
AWITPT::Object
';
our
$VERSION
=
1.01
;
our
(
@EXPORT
,
@EXPORT_OK
);
@EXPORT
=
qw(
...
...
@@ -66,56 +69,53 @@ The C<new> method is used to instantiate the object, in this case a root relatio
=cut
# Class instantiation
sub
new
{
my
(
$class
,
$parent
,
$childClass
)
=
@_
;
# The new() method is inherited from AWITPT::Object
# Check if we firstly have a parent object
if
(
!
defined
(
$parent
))
{
die
"
Parent object is required for DataObj::Relation
";
}
# If there is no child class defined, we need to abort
if
(
!
defined
(
$childClass
))
{
die
"
Child class is required for DataObj::Relation
";
}
=head2 _init
# These are our internal properties
my
$self
=
{
'
_parent
'
=>
$parent
,
'
_child
'
=>
undef
,
'
_child_class_name
'
=>
$childClass
};
sub _init
{
my ($self,@params) = @_;
# Build our class
bless
(
$self
,
$class
);
$self->SUPER::_init(@params);
# Initialize the object
$self
->
init
(
$parent
,
$childClass
);
$self->{'_myinternal'} = "hello";
return
$self
;
}
return $self;
}
The internal C<_init> method is overridden in child objects to perform initialization tasks;
=cut
# Object initialization
sub
_init
{
my
(
$self
,
@params
)
=
@_
;
my
(
$parent
,
$childClass
)
=
@params
;
=head2 init
sub init
{
my $self = shift;
# Check if we firstly have a parent object
if
(
!
defined
(
$parent
))
{
die
"
Parent object is required for DataObj::Relation
";
}
$self->{'_myinternal'} = "hello";
# If there is no child class defined, we need to abort
if
(
!
defined
(
$childClass
))
{
die
"
Child class is required for DataObj::Relation
";
}
The C<init> method is overridden in child objects to perform initialization tasks;
# Call parent initialization
$self
->
SUPER::
_init
(
@params
);
=cut
# These are our internal properties
$self
->
{'
_parent
'}
=
$parent
,
$self
->
{'
_child
'}
=
undef
;
$self
->
{'
_child_class_name
'}
=
$childClass
;
# Object initialization
sub
init
{
return
$self
;
}
...
...
@@ -221,7 +221,7 @@ L<http://gitlab.devlabs.linuxassist.net/awit-frameworks/awit-perl-toolkit/issues
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2014, AllWorldIT
Copyright (C) 2014
-2017
, AllWorldIT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
lib/AWITPT/DataObj/Relation/Direct.pm
View file @
43f0e3b5
# AWIT Data Object Direct Relation
# Copyright (C) 2014, AllWorldIT
# Copyright (C) 2014
-2017
, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -39,13 +39,15 @@ The AWITPT::DataObj::Relation::Direct class provides a direct relation between D
package
AWITPT::DataObj::Relation::
Direct
;
use
AWITPT::DataObj::
Relation
1.000
;
use
base
'
AWITPT::DataObj::Relation
';
use
strict
;
use
warnings
;
our
$VERSION
=
"
1.000
";
use
AWITPT::DataObj::
Relation
1.01
;
use
parent
-
norequire
,
'
AWITPT::DataObj::Relation
';
our
$VERSION
=
1.01
;
use
AWITPT::
DataObj
;
...
...
@@ -93,7 +95,7 @@ L<http://gitlab.devlabs.linuxassist.net/awit-frameworks/awit-perl-toolkit/issues
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2014, AllWorldIT
Copyright (C) 2014
-2017
, AllWorldIT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
lib/AWITPT/DataObj/Relation/List.pm
View file @
43f0e3b5
# AWIT Data Object List Relation
# Copyright (C) 2014, AllWorldIT
# Copyright (C) 2014
-2017
, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -43,13 +43,15 @@ The AWITPT::DataObj::Relation::List class provides a list relation between DataO
package
AWITPT::DataObj::Relation::
List
;
use
AWITPT::DataObj::
Relation
1.00
;
use
base
'
AWITPT::DataObj::Relation
';
use
strict
;
use
warnings
;
our
$VERSION
=
"
1.00
";
use
AWITPT::DataObj::
Relation
1.01
;
use
parent
-
norequire
,
'
AWITPT::DataObj::Relation
';
our
$VERSION
=
1.01
;
use
AWITPT::
DataObj
;
...
...
@@ -64,17 +66,20 @@ C<AWITPT::DataObj::Relation::List> provides the below methods.
=head2 init
=head2
_
init
The C<init> method is used internally by AWITPT::DataObj;
The C<
_
init> method is used internally by AWITPT::DataObj;
=cut
# Class initialization
sub
init
sub
_
init
{
my
$self
=
shift
;
my
(
$self
,
@params
)
=
@_
;
# Call parent initialization
$self
->
SUPER::
_init
(
@params
);
# Initialize our child list
$self
->
{'
_childList
'}
=
{
};
...
...
@@ -196,7 +201,7 @@ L<http://gitlab.devlabs.linuxassist.net/awit-frameworks/awit-perl-toolkit/issues
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2014, AllWorldIT
Copyright (C) 2014
-2017
, AllWorldIT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
lib/AWITPT/NetIP.pm
View file @
43f0e3b5
# Network IP Address Handling
# Copyright (C) 2009-201
4
, AllWorldIT
# Copyright (C) 2009-201
7
, AllWorldIT
# Copyright (C) 2008, LinuxRulz
#
# This program is free software; you can redistribute it and/or modify
...
...
@@ -23,6 +23,8 @@
# - Robert Anderson <randerson@lbsd.net>
# * * *
# TODO: Needs to inherit AWITPT::Object
# TODO: Needs documentation
package
AWITPT::
NetIP
;
...
...
lib/AWITPT/Object.pm
View file @
43f0e3b5
# AWIT Object
# Copyright (C) 2016, AllWorldIT
# Copyright (C) 2016
-2017
, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -27,7 +27,7 @@ AWITPT::Object - AWITPT Object
#
package myobject;
use AWITPT::Object 1.00;
use
base
'AWITPT::Object';
use
parent -norequire,
'AWITPT::Object';
use strict;
use warnings;
...
...
@@ -55,12 +55,14 @@ The AWITPT::Object class provides a basic abstraction layer to Perl objects.
package
AWITPT::
Object
;
use
parent
'
Exporter
';
use
strict
;
use
warnings
;
our
$VERSION
=
"
1.000
";
use
parent
'
Exporter
';
our
$VERSION
=
1.01
;
our
(
@EXPORT
,
@EXPORT_OK
);
@EXPORT
=
qw(
...
...
@@ -95,6 +97,7 @@ sub new
{
my
(
$class
,
@params
)
=
@_
;
# These are our internal properties
my
$self
=
{
};
...
...
@@ -156,7 +159,7 @@ L<http://gitlab.devlabs.linuxassist.net/awit-frameworks/awit-perl-toolkit/issues
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2016, AllWorldIT
Copyright (C) 2016
-2017
, AllWorldIT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
lib/AWITPT/PWLib.pm
View file @
43f0e3b5
# Copyright (c) 2014, AllWorldIT
# Copyright (c) 2010 Dominik Schulz (dominik.schulz@gauner.org). All rights reserved.
# Copyright (c) 2014-2017, AllWorldIT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -17,15 +16,19 @@
#
#
# Based off of work from http://www.vboxadm.net/
# Copyright (c) 2010 Dominik Schulz (dominik.schulz@gauner.org). All rights reserved.
#
# TODO: Needs to inherit AWITPT::Object
# TODO: Needs documentation
package
AWITPT::
PWLib
;
use
parent
'
Exporter
';
use
strict
;
use
warnings
;
our
$VERSION
=
"
1.0
00
"
;
our
$VERSION
=
1.0
1
;
our
(
@EXPORT
,
@EXPORT_OK
);
@EXPORT
=
qw(
...
...
lib/AWITPT/Util.pm
View file @
43f0e3b5
...
...
@@ -24,7 +24,7 @@ use parent 'Exporter';
use
strict
;
use
warnings
;
our
$VERSION
=
"
2.0
00
"
;
our
$VERSION
=
2.0
1
;
# Exporter stuff
our
(
@EXPORT
,
@EXPORT_OK
);
...
...
lib/AWITPT/Util/ConvertTSQL.pm
View file @
43f0e3b5
# TSQL conversion
# Copyright (C) 2016, AllWorldIT
# Copyright (C) 2016
-2017
, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -38,9 +38,11 @@ package AWITPT::Util::ConvertTSQL;
use
strict
;
use
warnings
;
use
base
'
AWITPT::Object
';
use
AWITPT::
Object
1.01
;
use
parent
-
norequire
,
'
AWITPT::Object
';
our
$VERSION
=
"
1.000
";
our
$VERSION
=
1.01
;
...
...
@@ -169,6 +171,9 @@ sub _init
my
(
$self
,
@params
)
=
@_
;
# Call parent initialization
$self
->
SUPER::
_init
(
@params
);
# If we have uneven number of params, the first will be our sub-class
if
(
@params
%
2
)
{
my
$subClass
=
shift
(
@params
);
...
...
lib/AWITPT/Util/ConvertTSQL/MySQL.pm
View file @
43f0e3b5
# TSQL conversion to MySQL
# Copyright (C) 2016, AllWorldIT
# Copyright (C) 2016
-2017
, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -38,9 +38,12 @@ package AWITPT::Util::ConvertTSQL::MySQL;
use
strict
;
use
warnings
;
use
base
'
AWITPT::Util::ConvertTSQL
';
use
AWITPT::Util::
ConvertTSQL
1.01
;
use
parent
-
norequire
,
'
AWITPT::Util::ConvertTSQL
';
our
$VERSION
=
1.01
;
our
$VERSION
=
"
1.000
";
our
(
@EXPORT
,
@EXPORT_OK
);
@EXPORT
=
qw(
...
...
lib/AWITPT/Util/ConvertTSQL/PgSQL.pm
View file @
43f0e3b5
# TSQL conversion to PgSQL
# Copyright (C) 2016, AllWorldIT
# Copyright (C) 2016
-2017
, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -38,7 +38,9 @@ package AWITPT::Util::ConvertTSQL::PgSQL;
use
strict
;
use
warnings
;
use
base
'
AWITPT::Util::ConvertTSQL
';
use
AWITPT::Util::
ConvertTSQL
1.01
;
use
parent
-
norequire
,
'
AWITPT::Util::ConvertTSQL
';
our
$VERSION
=
"
1.000
";
...
...
@@ -119,7 +121,7 @@ L<http://gitlab.devlabs.linuxassist.net/awit-frameworks/awit-perl-toolkit/issues
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2016, AllWorldIT
Copyright (C) 2016
-2017
, AllWorldIT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
lib/AWITPT/Util/ConvertTSQL/SQLite.pm
View file @
43f0e3b5
# TSQL conversion to SQLite
# Copyright (C) 2016, AllWorldIT
# Copyright (C) 2016
-2017
, AllWorldIT
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -38,9 +38,11 @@ package AWITPT::Util::ConvertTSQL::SQLite;
use
strict
;
use
warnings
;
use
base
'
AWITPT::Util::ConvertTSQL
';
use
AWITPT::Util::
ConvertTSQL
1.01
;
use
parent
-
norequire
,
'
AWITPT::Util::ConvertTSQL
';
our
$VERSION
=
"
1.000
";
our
$VERSION
=
1.01
;
our
(
@EXPORT
,
@EXPORT_OK
);
@EXPORT
=
qw(
...
...
@@ -121,7 +123,7 @@ L<http://gitlab.devlabs.linuxassist.net/awit-frameworks/awit-perl-toolkit/issues
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2016, AllWorldIT
Copyright (C) 2016
-2017
, AllWorldIT
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
lib/AWITPT/Util/ConvertTSQL/client.pm