Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
Latest commit
50 lines (39 loc) · 1.31 KB
/
Copy pathfunctions.php
File metadata and controls
50 lines (39 loc) · 1.31 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
// a handy function to "console.log" PHP data
functionconsoleLog($data, $function)
{
if (is_array($data) || is_object($data)) $data = json_encode($data);
elseif (is_string($data)) $data = '"' . $data . '"';
if (!$function) $function = 'log';
echo('<script>console.' . $function . '(' . $data . ');</script>');
}
// let's give a proper name to the function to print the active theme's folder
functiontheActiveThemeDirectory()
{
$directory = get_template_directory_uri() . '/';
print$directory;
}
functiongetBowerDirectory()
{
$directory = get_template_directory_uri() . '/bower_components/';
if (!fileExists($directory)) consoleLog("You seem to be missing the 'bower_components' folder", 'error');
elsereturn$directory;
}
functiontheHTML5BoilerplateDirectory()
{
$directory = getBowerDirectory() . 'html5-boilerplate/dist/';
if (!fileExists($directory)) consoleLog("You seem to be missing the 'html5-boilerplate/dist' folder", 'error');
print$directory;
}
functiontheSkeletonDirectory()
{
$directory = getBowerDirectory() . 'skeleton-css/';
if (!fileExists($directory)) consoleLog("You seem to be missing the 'skeleton-css' folder", 'error');
print$directory;
}
// from http://php.net/manual/en/function.file-exists.php#103436
functionfileExists($path)
{
return (@fopen($path, 'r') == true);
}
?>