load .profile with proc_open()

I don’t have a ksh, but I’ve managed to do it with bash. /home/galymzhan/.bash_profile: export VAR_FROM_PROFILE=”foobar” /home/galymzhan/test.php: #!/usr/bin/php -n <?php if (!isset($_SERVER[‘VAR_FROM_PROFILE’])) { $descriptors = array(0 => array(‘pipe’, ‘r’), 1 => array(‘pipe’, ‘w’)); $process = proc_open(‘bash’, $descriptors, $pipes); fwrite($pipes[0], escapeshellcmd(‘source /home/galymzhan/.bash_profile’) . “\n”); fwrite($pipes[0], escapeshellcmd(‘/home/galymzhan/test.php’) . “\n”); fclose($pipes[0]); echo “Output:\n”; echo stream_get_contents($pipes[1]); echo “\n”; fclose($pipes[1]); … Read more

How to allow html in return of angular2 pipe?

Use bindings to innerHTML or outerHTML to render already escaped html. For example <span [innerHTML]=”someString | toHtmlPipe”></span>. See this plunk: @Pipe({ name: ‘wrapBold’ }) class WrapBold { transform(content) { return `<b>${content}</b>`; } } @Component({ selector: ‘my-app’, pipes: [WrapBold], template: ` <div> Hello <span [outerHTML]=”content | wrapBold”></span> </div> ` }) export class App { constructor() { … Read more