forked from enlacee/heatmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.php
42 lines (37 loc) · 1 KB
/
install.php
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
<?php
/**
* Process for create all directories, Dinamic
* each table.page
*
*/
require_once 'config.php';
/**
* create directororyes in ./image/resolutions/xx
* permission 777
*/
function createDirectoryOfPages($id)
{
$return = false;
if (!empty($id)) {
$directorory = __DIR__. "/image/resolution/$id";
if (!is_dir($directorory)) {
$oldmask = umask(0);
$return = mkdir($directorory, 0777);
umask($oldmask);
}
}
return $return;
}
echo "<br>*****************************************";
echo "<br> Create directories";
echo "<br>*****************************************";
$link = mysqli_connect($servidor, $user, $pass, $database) or die("Error " . mysqli_error($link));
$query = 'SELECT id FROM page ';
$result = mysqli_query($link, $query);
if (mysqli_num_rows($result) > 0 ) {
while($row = $result->fetch_assoc()) {
$flag = createDirectoryOfPages($row['id']);
echo ($flag) ? '<BR>OK' : '<BR>FAIL';
}
}
mysqli_close($link);