How to change location for mpdf - yii2

In Yii2 kartik-v version 7.0 mpdf, I am trying to change location for saving temporary files as required. Where should I edit to change the location?

from MPDF yii2 docs
tempPath: string, the folder path for storing the temporary data generated by mpdf. If not set this defaults to Yii::$app->getAlias('#app/runtime/mpdf').
you can set like this
$pdf->tempPath = Yii::getAlias('#web/runtime/mpdf/');
http://demos.krajee.com/mpdf#settings

Related

Best practices for creating and reading app configuration file for angular app

I have an angular application that is gona be installed on many sites (owner requeriment) but, for every site, the configuration must be different (colors, some texts, some logos, backend server, etc). I want to write a configuration file that will be read by the angular app and then apply that configuration, I will put the file in every site and when I make a change to the backend server, any configuration text or other configuration I will only change the configuration file and the angular app will work transparently.
How can I achieve this?
I was thinking in writing a json file and read it from angular. Is this a good practice?
you can use 'environment.ts' for your problem.
but I use 'environment.ts' or 'environment.prod.ts' for the Variables that have different value in product and develop mode.
for values like store/app/crm name, simply you can add 'ts' file like 'myAppConfig.ts' in 'src' folder or 'app' folder.
then declare your variables like this:
export const myAppConfig = {
appName:'samuels online store',
expireDate:'2023/30/12',
customerName:'samuel l jackson'
};
then you can use it,like this:
first import it in your 'ts' file, for example in 'app.component.ts'.
import { myAppConfig } from 'src/myAppConfig';
then use the values of it, like this:
customerName = myAppConfig.clientName;
finally, you can put or change values in 'myAppConfig' from your backend and give a fresh version to your new customers.
have a good time!

Create hidden file template in PhpStorm

What is the best approach to creating a PhpStorm file template for a hidden file that pre-populates the file name (.htaccess) and does not include an extension?
The workflow currently is as follows:
Create file from template
Type in .editorconfig filename and hit 'ok'. Generated filename is .editorconfig..
Rename .editorconfig. to .editorconfig.
Is it possible to optimize this workflow to:
Create file from template
'editorconfig' filename prepopulated; simply hit 'ok'
AFAIK you cannot create File Template using File & Code Templates functionality for extensionless files (e.g. .editorconfig or .haccess) using standard GUI as it requires file extension part.
Few options:
1. Write custom plugin that would offer such functionality -- that's what .ignore plugin does.
2. Create File Template using .editorconfig extension (IDE will ask what File Type to use to associate *.editorfocnfig files with; I would choose "Ini").
Then create new file File | New | Your New FileTemplate and give it some name (e.g. a) -- in the end you will have a.editorconfig file.
Now just rename it to .editorconfig only.
You seem to be doing already that (slightly different version of it).
3. Do not use any File Templates. Just create brand new empty file (File | New | File) -- here you have to specify full file name including extension .. so .editorconfig can be entered here.
Once done -- just use Live Template functionality and quickly paste needed content.
You just need to create such Live Template in advance and give it some easy to use and remember abbreviation (if you wish to enter such text by typing abbreviation[TAB] (e.g. ec[TAB] where [TAB] is the expand key).
Live Templates official manual/how-to: https://confluence.jetbrains.com/display/PhpStorm/Live+Templates+%28Snippets%29+in+PhpStorm
Official Help pages: https://www.jetbrains.com/help/phpstorm/2016.3/live-templates.html?search=live%20template

How to pick path of file from System properties in jmeter CSV Data Set Config

I am trying to use CSV Data Set Config to get some data from csv file to be used in jmeter script but i don't want to hardcode the file path as it will be changing according to the test environment. Is there a way i can pick this path from System properties i.e some export set in my bashrc file.
Export in my bashrc :
export NIMBUS4_PERFORMANCE_TEST_REPO=/Users/rahul/Documents/verecloud/performancetest/data/user.csv
I would suggest the following workaround:
Change "Filename" setting of the CSV Data Set Config to following:
${__BeanShell(System.getenv().get("NIMBUS4_PERFORMANCE_TEST_REPO"))}
Where:
System.getenv() - method which provides access to underlying operating system environment variables
__Beanshell() - JMeter built-in function which allows executing of arbitrary Beanshell code
you could create a softlink at some static path. For example,
say we have created a soft link to /user/data/csvs folder.
You are in say ~/Documents , there run below
ln -s /user/data/csvs
Now we can access it in the jmeter and you will also have the flexibility to modify the softlink to point to some other location too.
Only constraint i see is the pointed directory name shouldn't change.
Hope this will help!!!
You can have just users.csv if the file is in the same folder as the .jmx itself;
You can have ${location}\users.csv
And in your UserDefinedVariables you'll have
and in non-gui mode you'll refer as
%RUNNER_HOME%\Test.jmx -Jloc=%RUNNER_HOME%\users.csv -Jusers=100 -Jloop=1 -Jrampup=5

Change namespace to Setting file

Is it possible to create a new folder in the project browser and move there the Setting file
(The one which was created under the main namespace folder by default) ?
Do I have to change the configuration file itself (like to specify the new folder name)?
Yes, it is possible :
From Properties file move the Settings (with its Settings.designer.cs) to the new folder.
Open the Settings.designer.cs file and change the namespace from ApplicationName.Properties to NewFileName.
In the app.config file, change the <userSettings>
<ApplicationName.Properties.Settings> places
to <userSettings>
<NewFileName.Settings>
Along the program use NewFileName.Settings instead of Properties.Settings.

PHPStorm: Generate filename on custom file template

PHP Storm: File templates
I would like to add custom file template with generated filename. I do not want to prompt filename by hand, I want it generated with variable values.
E.g. ${YEAR}${MONTH}${DAY}_${MyCustomVar}.sql
It there a way to do that?
Would you like to create files with 'fixed' names generated using temploate variables? It's not currently possible - you can file a request for this feature to youtrack (http://youtrack.jetbrains.com/issues/IDEA)
Related ticket: http://youtrack.jetbrains.com/issue/IDEABKL-6428