noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
|
contains the class for connecting to Noalyss More...
Public Member Functions | |
__construct ($p_database_id=0, $p_type='dos') | |
constructor | |
apply_patch ($p_name) | |
loop to apply all the path to a folder or a template Upgrade check if the folder $p_name needs to be upgrade thanks the variable DBVERSION and run all the SQL script named upgradeX.sql from the folder noalyss/include/sql/patch until X equal DBVERSION-1 | |
format_name ($p_id, $p_type) | |
return the name of the database with the domain name | |
get_version () | |
Get version of a database, the content of the table version. | |
save_receipt ($seq) | |
![]() | |
__construct ($p_user, $p_password, $p_dbname, $p_host, $p_port) | |
__toString () | |
alter_seq ($p_name, $min) | |
alter the sequence value | |
clean_orphan_lob () | |
Find all lob and remove those which are not used by any tables. | |
clear_all_prepare () | |
clear all prepare stmt | |
clear_prepare ($sql_name) | |
clear a prepare stmt | |
close () | |
wrapper for the function pg_close | |
commit () | |
Commit the transaction. | |
count ($p_ret=null) | |
synomym for size() | |
count_sql ($p_sql, $p_array=null) | |
Count the number of row returned by a sql statement. | |
create_sequence ($p_name, $min=1) | |
Create a sequence. | |
exec_sql ($p_string, $p_array=null) | |
send a sql string to the database | |
execute ($p_string, $p_array) | |
wrapper for the function pg_execute | |
execute_script ($script) | |
Execute a sql script. | |
exist_blob ($p_oid) | |
check if the large object exists | |
exist_column ($col, $table, $schema) | |
Check if a column exists in a table. | |
exist_database ($p_name) | |
Count the database name in a system view. | |
exist_schema ($p_name) | |
exist_sequence ($p_name) | |
test if a sequence exist | |
exist_table ($p_name, $p_schema='public') | |
test if a table exist | |
exist_view ($p_name) | |
fetch ($p_indice) | |
fetch the $p_indice array from the last query | |
get_affected () | |
return the number of rows affected by the previous query | |
get_array ($p_sql, $p_array=null) | |
purpose return the result of a sql statment in a array | |
get_current_seq ($p_seq) | |
get the current sequence value | |
get_db () | |
get_encoding () | |
get_is_open () | |
get_name () | |
return the name of the current database | |
get_next_seq ($p_seq) | |
get the next sequence value | |
get_ret () | |
get_row ($p_sql, $p_array=NULL) | |
Returns only one row from a query. | |
get_sql () | |
last SQL stmt executed | |
get_value ($p_sql, $p_array=null) | |
return the value of the sql, the sql will return only one value with the value | |
is_prepare ($query_name) | |
Check if a prepared statement already exists or not. | |
lo_export ($p_oid, $tmp_file) | |
wrapper for the function pg_lo_export | |
lo_import ($p_filename) | |
wrapper for the function pg_lo_export | |
lo_unlink ($p_oid) | |
wrapper for the function pg_lo_unlink | |
make_array ($p_sql, $p_null=0, $p_array=null) | |
make a array with the sql. | |
make_list ($sql, $p_array=null) | |
create a string containing the value separated by comma for use in a SQL in statement | |
prepare ($p_string, $p_sql) | |
wrapper for the function pg_prepare | |
query_to_csv ($ret, $aheader) | |
with the handle of a successull query, echo each row into CSV and send it directly to output. | |
rollback () | |
rollback the current transaction | |
search_sql_inject ($p_sql) | |
FInd if a SQL Select has a SQL stmt to inject or damage Data When a SELECT SQL string is build, this string could contain a SQL attempt to damage data, so the statement DELETE TRUNCATE ... are forbidden. | |
set_db ($db) | |
set_encoding ($p_charset) | |
set_is_open ($is_open) | |
set_ret ($ret) | |
set_sql ($sql) | |
last SQL stmt executed | |
size ($p_ret=null) | |
return the number of rows found by the last query, or the number of rows from $p_ret | |
start () | |
: start a transaction | |
status () | |
get the transaction status : The status can be | |
upload ($p_name) | |
verify () | |
Additional Inherited Members | |
![]() | |
static | escape_string ($p_string) |
wrapper for the function pg_escape_string | |
static | fetch_all ($ret) |
wrapper for the function pg_fetch_all | |
static | fetch_array ($ret, $p_indice=0, $p_mode=PGSQL_ASSOC) |
wrapper for the function pg_fetch_array | |
static | fetch_result ($ret, $p_row=0, $p_col=0) |
wrapper for the function pg_fetch_all | |
static | fetch_row ($ret, $p_row) |
wrapper for the function pg_fetch_row | |
static | nb_column ($p_ret) |
Returns the number of columns in a ret. | |
static | num_row ($ret) |
wrapper for the function pg_num_rows | |
static | test_me () |
![]() | |
$array | |
$sql | |
last SQL stmt executed | |
contains the class for connecting to Noalyss
Definition at line 32 of file database.class.php.
Database::__construct | ( | $p_database_id = 0, | |
$p_type = 'dos' ) |
constructor
$p_database_id | is the id of the dossier, or the modele following the p_type if = 0 then connect to the repository |
$p_type | is 'DOS' (defaut) for dossier or 'MOD' |
Definition at line 40 of file database.class.php.
References $p_type, domaine, DatabaseCore\exec_sql(), and DatabaseCore\exist_schema().
Database::apply_patch | ( | $p_name | ) |
loop to apply all the path to a folder or a template Upgrade check if the folder $p_name needs to be upgrade thanks the variable DBVERSION and run all the SQL script named upgradeX.sql from the folder noalyss/include/sql/patch until X equal DBVERSION-1
$p_name | database name |
Bug in parm_code for FRANCE
Definition at line 128 of file database.class.php.
References $country, $i, $Max, $max, $Res, $res, $row, $seq, DatabaseCore\$sql, $succeed, $to, _, DatabaseCore\alter_seq(), DBVERSION, DatabaseCore\exec_sql(), DatabaseCore\execute_script(), DatabaseCore\exist_schema(), DatabaseCore\exist_table(), DatabaseCore\get_value(), get_version(), and size.
Database::format_name | ( | $p_id, | |
$p_type ) |
return the name of the database with the domain name
$p_id | of the folder WITHOUT the domain name |
$p_type | dos for folder mod for template |
Definition at line 244 of file database.class.php.
References $p_id, $p_type, domaine, and echo_error().
Database::get_version | ( | ) |
Get version of a database, the content of the table version.
Definition at line 112 of file database.class.php.
References $Res, and DatabaseCore\get_value().
Referenced by apply_patch().
Database::save_receipt | ( | $seq | ) |
Definition at line 83 of file database.class.php.
References $r, DatabaseCore\$ret, $seq, DatabaseCore\exec_sql(), DatabaseCore\lo_unlink(), and DatabaseCore\upload().