This commit is contained in:
Paulis
2019-08-02 15:57:22 -04:00
parent 279e251a62
commit d3e632a4db
22 changed files with 58 additions and 55 deletions

View File

@@ -93,7 +93,7 @@ class DBConnection
* @return string
*
*/
public function DBConnection($strServer = DB_HOST, $strUser = DB_USER, $strPwd = DB_PASS, $strDB = DB_NAME, $type = DB_ADAPTER, $strPort = 0, $errorLevel = 2)
public function __construct($strServer = DB_HOST, $strUser = DB_USER, $strPwd = DB_PASS, $strDB = DB_NAME, $type = DB_ADAPTER, $strPort = 0, $errorLevel = 2)
{
$this->errorLevel = $errorLevel;
if ($type == null) {

View File

@@ -47,9 +47,9 @@ class DBRecordSet
* @param string $intResult Database recordset default value = false
* @return void
*/
function DBRecordSet ($intResult = null)
public function __construct($intResult = null)
{
$this->SetTo( $intResult );
$this->SetTo($intResult);
}
/**

View File

@@ -52,12 +52,12 @@ class DBSession
* @return void
*
*/
function DBSession ($objConnection = null, $strDBName = '')
public function __construct($objConnection = null, $strDBName = '')
{
if ($strDBName != '') {
$strDBName = $objConnection->db->_db;
}
$this->setTo( $objConnection, $strDBName );
$this->setTo($objConnection, $strDBName);
}
/**

View File

@@ -53,12 +53,15 @@ class DBTable
/**
* Initiate a database conecction using default values
*
* @author Fernando Ontiveros Lira <fernando@colosa.com>
* @access public
* @param object $objConnection conecction string
*
* @param object $objConnection
* @param string $strTable
* @param array $arrKeys
*
* @return void
*/
public function dBTable($objConnection = null, $strTable = "", $arrKeys = array('UID'))
public function __construct($objConnection = null, $strTable = "", $arrKeys = ['UID'])
{
$this->_dbc = null;
$this->_dbses = null;

View File

@@ -77,12 +77,12 @@ class G_Error extends PEAR_Error
*
* @see PEAR_Error
*/
public function G_Error ($code = G_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
public function __construct($code = G_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
{
if (is_int( $code )) {
$this->PEAR_Error( 'G Error: ' . G_Error::errorMessage( $code ), $code, $mode, $level, $debuginfo );
if (is_int($code)) {
$this->PEAR_Error('G Error: ' . G_Error::errorMessage($code), $code, $mode, $level, $debuginfo);
} else {
$this->PEAR_Error( "G Error: $code", DB_ERROR, $mode, $level, $debuginfo );
$this->PEAR_Error("G Error: $code", DB_ERROR, $mode, $level, $debuginfo);
}
}

View File

@@ -25,13 +25,13 @@ class InputFilter
/**
* Constructor for inputFilter class. Only first parameter is required.
* @access constructor
* @param Array $tagsArray - list of user-defined tags
* @param Array $attrArray - list of user-defined attributes
* @param array $tagsArray - list of user-defined tags
* @param array $attrArray - list of user-defined attributes
* @param int $tagsMethod - 0= allow just user-defined, 1= allow all but user-defined
* @param int $attrMethod - 0= allow just user-defined, 1= allow all but user-defined
* @param int $xssAuto - 0= only auto clean essentials, 1= allow clean blacklisted tags/attr
*/
public function inputFilter($tagsArray = array(), $attrArray = array(), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1)
public function __construct($tagsArray = [], $attrArray = [], $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1)
{
// make sure user defined arrays are in lowercase
for ($i = 0; $i < count($tagsArray); $i++) {

View File

@@ -44,7 +44,7 @@ class objectTemplate extends Smarty
* @return void
*/
function objectTemplate ($templateFile)
public function __construct($templateFile)
{
$this->template_dir = PATH_TPL;
$this->compile_dir = PATH_SMARTY_C;

View File

@@ -49,16 +49,16 @@ class Table
public $_contexto = '';
/**
* Set conecction using default values
* Set connection using default values
*
* @author Fernando Ontiveros Lira <fernando@colosa.com>
* @access public
* @param string $objConnection connection string
*
* @return void
* @access public
*/
public function Table ($objConnection = null)
public function __construct($objConnection = null)
{
$this->SetTo( $objConnection );
$this->SetTo($objConnection);
}
/**

View File

@@ -25,9 +25,9 @@ class PmTree extends Xml_Node
*
* @param array $xmlnode default value NULL
*
* @return none
* @return void
*/
public function PmTree($xmlnode = null)
public function __construct($xmlnode = null)
{
if (!isset($xmlnode)) {
return;

View File

@@ -48,34 +48,34 @@ class WebResource
* @param string $uri
* @param string $post
*
* @return none
* @return void
*/
function WebResource ($uri, $post)
public function __construct($uri, $post)
{
$this->_uri = $uri;
if (isset( $post['function'] ) && $post['function'] != '') {
if (isset($post['function']) && $post['function'] != '') {
/*Call a function*/
header( 'Content-Type: text/json' );
header('Content-Type: text/json');
//$parameters=G::json_decode((urldecode($post['parameters']))); //for %AC
$parameters = G::json_decode( ($post['parameters']) );
$paramsRef = array ();
$parameters = G::json_decode(($post['parameters']));
$paramsRef = array();
foreach ($parameters as $key => $value) {
if (is_string( $key )) {
$paramsRef[] = "\$parameters['" . addcslashes( $key, '\\\'' ) . "']";
if (is_string($key)) {
$paramsRef[] = "\$parameters['" . addcslashes($key, '\\\'') . "']";
} else {
$paramsRef[] = '$parameters[' . $key . ']';
}
}
$paramsRef = implode( ',', $paramsRef );
$paramsRef = implode(',', $paramsRef);
$filter = new InputFilter();
$post['function'] = $filter->validateInput($post['function']);
$paramsRef = $filter->validateInput($paramsRef);
$res = eval( 'return ($this->' . $post['function'] . '(' . $paramsRef . '));' );
$res = G::json_encode( $res );
print ($res) ;
$res = eval('return ($this->' . $post['function'] . '(' . $paramsRef . '));');
$res = G::json_encode($res);
print ($res);
} else {
/*Print class definition*/
$this->_encode();

View File

@@ -61,11 +61,11 @@ class XmlFormFieldXmlMenu extends XmlFormField
* @param string $home default value ''
* @param string $owner
*
* @return none
* @return void
*/
public function XmlFormFieldXmlMenu ($xmlNode, $lang = 'en', $home = '', $owner = null)
public function __construct($xmlNode, $lang = 'en', $home = '', $owner = null)
{
parent::__construct( $xmlNode, $lang, $home, $owner );
parent::__construct($xmlNode, $lang, $home, $owner);
$this->home = $home;
}

View File

@@ -17,13 +17,13 @@ class xmlformTemplate extends Smarty
/**
* Function xmlformTemplate
*
* @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public
* @param string form
* @param string templateFile
*
* @return string
* @access public
*/
public function xmlformTemplate (&$form, $templateFile)
public function __construct(&$form, $templateFile)
{
$this->template_dir = PATH_XMLFORM;
$this->compile_dir = PATH_SMARTY_C;