mirror of
https://github.com/foss42/apidash.git
synced 2025-08-06 13:51:20 +08:00
added template for user defined class File
- a constructor which takes a human readable name and the file and internally stores the contents of the file - if the file does not exist, then file_get_contents function returns false, in that case the contents of the file is an empty string
This commit is contained in:
@ -58,6 +58,29 @@ curl_setopt(\$request, {{method}}, 1);
|
||||
curl_close(\$request);
|
||||
var_dump(\$response);
|
||||
|
||||
""";
|
||||
|
||||
String kFileClassString = """
|
||||
class File
|
||||
{
|
||||
public string \$name;
|
||||
public string \$filename;
|
||||
public string \$content;
|
||||
|
||||
function __construct(\$name, \$filename)
|
||||
{
|
||||
\$this->name = \$name;
|
||||
\$this->filename = \$filename;
|
||||
\$available_content = file_get_contents(\$this->filename);
|
||||
\$this->content = \$available_content ? \$available_content : "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
""";
|
||||
|
||||
}
|
||||
|
||||
""";
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user