How to grab the url or path of generated docs created in phpdocx - phpdocx

We have a project in which we are using phpdocx in generating word document. We would like to grab the url or path of the generated docs and send it to email. How can we grab the url? Thanks!

When you generate docs, you pass $path parameter to the method createdocx() like this:
<?php
$docx = new CreateDocx();
$docx->addText('This is just a dummy text');
$docx->createDocx($path);
?>
This generate the document at $path. So you always have the path of the generated docs

Related

How do you add a "general info" section to an NSwag generated API document website?

Our current method uses a manually maintained and formatted YML document. At the beginning is a lengthy introduction/instruction section that I would like to include in generated documentation. The swagger docs suggest that I can add a markdown compatible, multi-line description but that's not really something I want to do in my Startup.cs file. How can I add this sort of extended introduction?
An example of the what I'm looking to do is shown on docs.discourse.org which is generated using Redoc.
I would suggest placing your API introduction to a static file that is copied to build output, then configure open api document to read it.
The file can contain HTML markup or markdown. I tend to use markdown to get heading links appear in the sidebar in redoc, it is completely up to you.
services.AddOpenApiDocument(document =>
{
document.Description = File.ReadAllText("Docs/Description.html");
// other properties
document.AddSecurity("Bearer", Enumerable.Empty<string>(), new OpenApiSecurityScheme
{
Type = OpenApiSecuritySchemeType.ApiKey,
Name = "Authorization",
In = OpenApiSecurityApiKeyLocation.Header,
Description = File.ReadAllText("Docs/Authentication.html")
});
document.OperationProcessors.Add(new AspNetCoreOperationSecurityScopeProcessor("Bearer"));
});

How to dynamically create URL having path in between URL using Karate framework

I want to create a dynamic url using karate framework. lets assume URL I want to create is :
https://www.mars.com/mars/profile/{profileID}/line
In above URL {profileID} is path.
Currently I have written below feature file which is able to create the url however due using path keyword it encodes the url and add %0A after profile id.
https://www.mars.com/mars/profile/264%0A/line
Feature File:
#smoke
Scenario: Create a line score in existing profile
And def urlname = marsuri+ '/mars/profile/'
Given url urlname
Given path id + '/line'
Please let me know how can I create a URL with path in between URL without encoding it.
You are not using the path syntax correctly. Please read the documentation: https://github.com/intuit/karate#path
Make this change:
Given path id, 'line'
EDIT: please also see this answer: https://stackoverflow.com/a/54477346/143475
Actually that id variable wherever you are getting it from is having a new line at the end of the string, something like this "264\n" that is why it is getting encoded to 264%0A
If all you wanted to pass is "264" you have to remove the unwanted values before adding it to the path
Background:
* def removeNewLine = function(x){return x.replace("\n","")}
Scenario: Create a line score in existing profile
And def urlname = marsuri+ '/mars/profile/'
Given url urlname
* def id = removeNewLine(id)
Given path id + '/line'
If you can modify the data directly from the source where you are getting the id that would be great.

New blank page in Zen-Cart

How can I create a new blank page in zen-cart without applying the template.
I want to create a page that will result only a JSON data...
Thanks in advance
Create a php file in your store directory. In that file, if you want to use ZenCart functions you can include them, like so:
<?php
include "includes/application_top.php";
set headers for mime type
set headers for not caching
YOUR CODE
echo $json;
// below is optional if you didn't create/edit session
include "includes/application_bottom.php";

bazaar auto tag

I want to use the automatic_tag_name hook to automatic create tag name without the need of manually typing
I tried to write it like it : automatic_tag_name(branch name,10)= "GIL"
Is it the correct syntax? (i found iittle information on it in the documents)
Is it possible to create tag name from a file? this file will contains only the tag name
See this example pahe here:
http://doc.bazaar.canonical.com/latest/en/user-guide/hooks.html
SO correct call should be:
def post_push_autotag(push_result):
automatic_tag_name(push_result.new_revno)
branch.Branch.hooks.install_named_hook('post_push_autotag', post_push_autotag, 'My autotag')

Input files from ExpressionEngine?

Is there a way to reference uploaded files using EE's Input class? I know it has a "post" method to get post variables, but what about files?
Not in the input class, you can just use $_FILES.
You may want to have a look at the Upload class though. For a good overview of how it works, you can check out the function _upload_file() in the Filemanager library file within your EE directory. A primer:
$this->EE->load->library('upload');
$this->EE->upload->initialize($config);
if ( ! $this->EE->upload->do_upload($field_name))
{
return $this->_upload_error(
$this->EE->upload->display_errors()
);
}
$file = $this->EE->upload->data();
The $config array contains the options for the upload, which you can review in the CodeIgniter docs.