Skip to content

Commit b9dec34

Browse files
authored
Update README.md
1 parent c61178b commit b9dec34

File tree

1 file changed

+1
-246
lines changed

1 file changed

+1
-246
lines changed

README.md

Lines changed: 1 addition & 246 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ $backup = new SQL_Backup();
5757
$backup->con($HOST,$USER,$PASSWD,$NAME);
5858
```
5959

60-
### _execute(NULL)_
60+
### _execute(void)_
6161

6262
Run Command
6363

@@ -291,248 +291,3 @@ Example:
291291
> **Note: Attention this class has not been tested in all possible situations. So if you have problems you disclose them to me.**.
292292

293293
> **Note 2: I do not take responsibility in case of failure to backup or if the result you do not like or does not work**
294-
295-
``` php
296-
$con = new mysqli($HOST,$USER,$PASSWD,$NAME);
297-
$backup = new SQL_Backup($con);
298-
```
299-
300-
Case : Connection closed....
301-
302-
``` php
303-
$backup = new SQL_Backup();
304-
$backup->con($HOST,$USER,$PASSWD,$NAME);
305-
```
306-
307-
### _execute(NULL)_
308-
309-
Run Command
310-
311-
**Is critical . To run every time at the end!**
312-
313-
314-
### $ _table_name_ (_String or Array_)
315-
316-
The tables that you want to backup.
317-
318-
EXAMPLE:
319-
320-
String:
321-
322-
``` php
323-
$backup->table_name = "users,alldata";
324-
```
325-
326-
Array:
327-
328-
``` php
329-
$backup->table_name = array('users','alldata');
330-
```
331-
332-
333-
### $_folder_ (_String_)
334-
335-
``` php
336-
$backup->folder = "backup/database"; /* ONLY DIR */
337-
```
338-
339-
340-
### $_query_limit_ (_Int_)
341-
342-
Number of queries at a time to execute in SQL.
343-
344-
Exemple q_limit = 400
345-
346-
>INSERT INTO table ( '' ,'' ,'') VALUES ('' ,'' ,'') ,('' ,'' ,'') ,('' ,'' ,'') ...... * 400 ,('' ,'' ,'');
347-
>INSERT INTO table ( '' ,'' ,'') VALUES ('' ,'' ,'') ,('' ,'' ,'') ,('' ,'' ,'') ...... * 400 ,('' ,'' ,'');
348-
..... etc.
349-
350-
351-
``` php
352-
$backup->qlimit=400;
353-
```
354-
355-
### $_compress_ (_Bool_)
356-
357-
If set to true the result is compressed. (.zip)
358-
359-
``` php
360-
$backup->compress = true;
361-
```
362-
363-
### $_ext_ (_Int_)
364-
365-
The extension of the destination file.
366-
367-
``` php
368-
const SQL = 13;
369-
const CSV = 26;
370-
const JSON = 49;
371-
```
372-
- SQL extension
373-
374-
375-
``` php
376-
$backup->ext = $backup::SQL;
377-
```
378-
379-
``` php
380-
$backup->ext = 13;
381-
```
382-
- CSV extension
383-
384-
``` php
385-
$backup->ext = $backup::CSV;
386-
```
387-
388-
``` php
389-
$backup->ext = 26;
390-
```
391-
- JSON extension
392-
393-
``` php
394-
$backup->ext = $backup::JSON;
395-
```
396-
397-
``` php
398-
$backup->ext = 49;
399-
```
400-
401-
#### Combinations
402-
403-
SQL + CSV
404-
405-
``` php
406-
$backup->ext = $backup::SQL + $backup::CSV;
407-
```
408-
409-
``` php
410-
$backup->ext = 13 + 26; // 39
411-
```
412-
413-
``` php
414-
$backup->ext = array($backup::SQL, $backup::CSV);
415-
```
416-
417-
``` php
418-
$backup->ext = array(13,26);
419-
```
420-
421-
``` php
422-
$backup->ext = "39";
423-
```
424-
425-
**Same for JSON and CSV or JSON and SQL**
426-
427-
**_For all three formats use ($n > 100)_**
428-
429-
> NOTE: If you use the CSV extension, if you want you can add the field delimiter and the enclosure of the camps.
430-
By default they are:
431-
- Delimiter => ,
432-
- Enclosure => "
433-
434-
>Example: "Data","DATA2","datA3"
435-
436-
``` php
437-
$backup->del_csv=";";
438-
$backup->enc_csv="'";
439-
```
440-
441-
### $_alltable_in_file_ (_Bool_)
442-
443-
If set to TRUE:
444-
445-
- If the 'compress' variable is true all the files will be saved in a single zip file otherwise all will be saved individually.
446-
447-
- If the 'compress' variable is false all the files will be saved into a single folder (Depending on the extension. Example Choose SQL extension dir/sql/name_file) or else each file will be saved individually.
448-
449-
``` php
450-
$backup->alltable_in_file = true;
451-
```
452-
453-
454-
### $_save_ (_Bool_)
455-
456-
If set to FALSE, the result will not be saved but will be loaded on the variable of Class sql, csv, json (**ARRAY**)
457-
458-
EXAMPLE
459-
460-
SQL:
461-
462-
object(SQL_Backup)[1]
463-
464-
...
465-
public 'sql' =>
466-
array (size=1)
467-
'name_table' => string '...'
468-
469-
470-
### $_sql_unique_ (_Bool_)
471-
472-
If set to true the SQL dump is a single file with all the tables. (Valid only for the SQL format)
473-
474-
> Table 1 SQL + Table 2 SQL + ETC.
475-
476-
## In V 1.0.5
477-
478-
Added:
479-
480-
### $_close_ (_Bool_)
481-
482-
If set to true, at the end of operations the MySQL connection is closed otherwise the connection will be allowed in the class.
483-
484-
### $_json_pretty_ (_Bool_)
485-
486-
If set to true, the output of the json will be like this:
487-
488-
``` json
489-
{
490-
"Info": {
491-
"alldata": {
492-
"R": 35954,
493-
"C": 14
494-
}
495-
},
496-
"Avg": 0.5024807643890381
497-
}
498-
```
499-
Otherwise:
500-
501-
``` json
502-
{"Info":{"alldata":{"R":35954,"C":14}},"Avg":0.5024807643890381}
503-
```
504-
505-
### $_info_t_ (_Bool_)
506-
507-
If set to true, some information will be returned in the info array. (Look under)
508-
509-
### $_info_ (_Array_)
510-
511-
Here it will be returned any errors or information.
512-
513-
MySQL Error, table columns and rows, etc.
514-
515-
Example:
516-
517-
``` json
518-
{"alldata":{"R":35954,"C":14}
519-
```
520-
521-
## DEFAULT SETTING
522-
523-
- Folder = "backup/database";
524-
- Query Limit = 400
525-
- Compress = true
526-
- Extension = SQL
527-
- Alltable_in_file = false
528-
- Save = true
529-
- Sql_unique = false
530-
- Del= [,]
531-
- Enc= ["]
532-
- Close = null
533-
- Info_t = null
534-
- Json_pretty = null
535-
536-
> **Note: Attention this class has not been tested in all possible situations. So if you have problems you disclose them to me.**
537-
538-
> **Note 2: I do not take responsibility in case of failure to backup or if the result you do not like or does not work**

0 commit comments

Comments
 (0)