Backend code for the site generator.
More...
|
| __construct ($size, $bypasscheck, $fixeddataset=false, $filesizelimit=false, $progress=true) |
| Constructs object ready to make the site.
|
|
| dot (int $number, int $total) |
| Outputs dots.
|
|
| end_log () |
| Ends a log string that was started using log function with $leaveopen.
|
|
| log (string $langstring, $a=null, bool $leaveopen=false, string $module='tool_generator') |
| Displays information as part of progress.
|
|
| make () |
| Runs the entire 'make' process.
|
|
|
static | get_size_choices () |
| Gets a list of size choices supported by this backend.
|
|
static | size_for_name ($sizename) |
| Converts a size name into the numeric constant.
|
|
|
int const | DEFAULT_SIZE = 3 |
| Default size index.
|
|
int const | MAX_SIZE = 5 |
| Highest (largest) size index.
|
|
int const | MIN_SIZE = 0 |
| Lowest (smallest) size index.
|
|
string const | SHORTNAMEPREFIX = 'testcourse_' |
| The course's shortname prefix.
|
|
|
| run_create_course ($shortname, $coursesize) |
| Creates a course with the specified shortname, coursesize and the provided maketestsite options.
|
|
|
bool | $bypasscheck |
| If the debugging level checking was skipped.
|
|
int bool | $filesizelimit |
| Maximum number of bytes for file.
|
|
bool | $fixeddataset |
| True if we want a fixed dataset or false to generate random data.
|
|
int | $lastdot |
| Epoch time at which last dot was displayed.
|
|
int | $lastpercentage |
| Epoch time at which last percentage was displayed.
|
|
bool | $progress |
| True if displaying progress.
|
|
int | $size |
| Size code (index in the above arrays)
|
|
int | $starttime |
| Epoch time at which current step (current set of dots) started.
|
|
|
static array | $sitecourses |
| Multidimensional array where the first level is the course size and the second the site size.
|
|
Backend code for the site generator.
- Copyright
- 2013 David MonllaĆ³
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
tool_generator_site_backend::__construct |
( |
| $size, |
|
|
| $bypasscheck, |
|
|
| $fixeddataset = false, |
|
|
| $filesizelimit = false, |
|
|
| $progress = true ) |
Constructs object ready to make the site.
- Parameters
-
int | $size | Size as numeric index |
bool | $bypasscheck | If debugging level checking was skipped. |
bool | $fixeddataset | To use fixed or random data |
int | bool | $filesizelimit | The max number of bytes for a generated file |
bool | $progress | True if progress information should be displayed |
- Return values
-
◆ dot()
tool_generator_backend::dot |
( |
int | $number, |
|
|
int | $total ) |
|
inherited |
Outputs dots.
There is up to one dot per second. Once a minute, it displays a percentage.
- Parameters
-
int | $number | Number of completed items |
int | $total | Total number of items to complete |
◆ get_last_testcourse_id()
static tool_generator_site_backend::get_last_testcourse_id |
( |
| ) |
|
|
staticprotected |
Obtains the last unique sufix (numeric) using the test course prefix.
- Return values
-
int | The last generated numeric value. |
◆ get_size_choices()
static tool_generator_site_backend::get_size_choices |
( |
| ) |
|
|
static |
Gets a list of size choices supported by this backend.
- Return values
-
array | List of size (int) => text description for display |
◆ log()
tool_generator_backend::log |
( |
string | $langstring, |
|
|
| $a = null, |
|
|
bool | $leaveopen = false, |
|
|
string | $module = 'tool_generator' ) |
|
inherited |
Displays information as part of progress.
- Parameters
-
string | $langstring | Part of langstring (after progress_) |
mixed | $a | Optional lang string parameters |
bool | $leaveopen | If true, doesn't close LI tag (ready for dots) |
string | $module | module for language string |
◆ make()
tool_generator_site_backend::make |
( |
| ) |
|
Runs the entire 'make' process.
- Return values
-
◆ run_create_course()
tool_generator_site_backend::run_create_course |
( |
| $shortname, |
|
|
| $coursesize ) |
|
protected |
Creates a course with the specified shortname, coursesize and the provided maketestsite options.
- Parameters
-
string | $shortname | The course shortname |
int | $coursesize | One of the possible course sizes. |
- Return values
-
◆ size_for_name()
static tool_generator_backend::size_for_name |
( |
| $sizename | ) |
|
|
staticinherited |
Converts a size name into the numeric constant.
- Parameters
-
string | $sizename | Size name e.g. 'L' |
- Return values
-
- Exceptions
-
◆ $sitecourses
array tool_generator_site_backend::$sitecourses |
|
staticprotected |
Initial value:= array(
array(2, 8, 64, 256, 1024, 4096),
array(1, 4, 8, 16, 32, 64),
array(0, 0, 1, 4, 8, 16),
array(0, 0, 0, 1, 0, 0),
array(0, 0, 0, 0, 1, 0),
array(0, 0, 0, 0, 0, 1)
)
Multidimensional array where the first level is the course size and the second the site size.
The documentation for this class was generated from the following file: