forked from php-pm/php-pm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
30 lines (27 loc) · 791 Bytes
/
functions.php
File metadata and controls
30 lines (27 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use PHPPM\ProcessSlave;
/**
* Adds a file path to the watcher list of PPM's master process.
*
* If you have a custom template engine, cache engine or something dynamic
* you probably want to call this function to let PPM know,
* that you want to restart all workers when this file has changed.
*
* @param string $path
*/
function ppm_register_file($path)
{
ProcessSlave::$slave->registerFile($path);
}
/**
* Dumps information about a variable into your console output.
*
* @param mixed $expression The variable you want to export.
* @param mixed $_ [optional]
*/
function ppm_log($expression, $_ = null)
{
ob_start();
call_user_func_array('var_dump', func_get_args());
file_put_contents('php://stderr', ob_get_clean() . PHP_EOL, FILE_APPEND);
}