Commit 0bca5135 authored by Ryan Wade's avatar Ryan Wade

modified so that the fake database has been extracted from SQL.php

this allows fakeSQL.php to be branched with new content for testing scenarios while keeping functionality isolated
parent 81e321f3
......@@ -20,17 +20,7 @@
//private $pages = null;
function SQL()
{
$this->pages =
[new SQL_ROW([0,-1,"Home" , null , null ,"This is the homepage" ]),
new SQL_ROW([1, 0,"Page1" ,"Page 1 Description" , "./title.jpg" ,"This is page 1 html content" ]),
new SQL_ROW([2, 0,"Page2" ,"Page 2 Description" , "./title.jpg" ,"This is page 2 html content</br><button>Logon</button>" ]),
new SQL_ROW([3, 0,"Page3" ,"Page 3 Description" , "./title.jpg" ,"This is page 3 html content" ]),
new SQL_ROW([4, 0,"Page4" ,"Page 4 Description" , "./title.jpg" ,"This is page 4 html content" ]),
new SQL_ROW([5, 3,"Page5" , null , null ,"This is SUB page 5 html content" ]),
new SQL_ROW([6, 3,"Page6" , null , null ,"This is SUB page 6 html content" ]),
new SQL_ROW([7, 3,"Page7" , null , null ,"This is SUB page 7 html content" ]),
new SQL_ROW([8, 6,"Page8" , null , null ,"This is SUB SUB page 8 html content" ])
];
include "./fakeSQL.php";
}
private function getFile($location)
{
......
<?php
function getFile($location)
{
$myfile = fopen($location,"r");
return fread($myfile,filesize($location));
}
function SQL_GET_SITE_TITLE()
{
return "My Website";
}
function SQL_GET_SITE_LOGO()
{
return "./logo.png";
}
// ID PID Title Description Image Content
$pages = [[0,-1,"Home" , null , null ,"This is the homepage"],
[1, 0,"Page1" ,"Page 1 Description" , "./title.jpg" ,"This is page 1 html content"],
[2, 0,"Page2" ,"Page 2 Description" , "./title.jpg" ,"This is page 2 html content</br><button>Logon</button>"],
[3, 0,"Page3" ,"Page 3 Description" , "./title.jpg" ,"This is page 3 html content"],
[4, 0,"Page4" ,"Page 4 Description" , "./title.jpg" ,"This is page 4 html content"],
[5, 3,"Page5" , null , null ,"This is SUB page 5 html content"],
[6, 3,"Page6" , null , null ,"This is SUB page 6 html content"],
[7, 3,"Page7" , null , null ,"This is SUB page 7 html content"],
[8, 6,"Page8" , null , null ,"This is SUB SUB page 8 html content"],
];
// Name Password (Hashed) AccessLevel
$this->pages =
[new SQL_ROW([0,-1,"Home" , null , null ,"This is the homepage" ]),
new SQL_ROW([1, 0,"Page1" ,"Page 1 Description" , "./title.jpg" ,"This is page 1 html content" ]),
new SQL_ROW([2, 0,"Page2" ,"Page 2 Description" , "./title.jpg" ,"This is page 2 html content</br><button>Logon</button>" ]),
new SQL_ROW([3, 0,"Page3" ,"Page 3 Description" , "./title.jpg" ,"This is page 3 html content" ]),
new SQL_ROW([4, 0,"Page4" ,"Page 4 Description" , "./title.jpg" ,"This is page 4 html content" ]),
new SQL_ROW([5, 3,"Page5" , null , null ,"This is SUB page 5 html content" ]),
new SQL_ROW([6, 3,"Page6" , null , null ,"This is SUB page 6 html content" ]),
new SQL_ROW([7, 3,"Page7" , null , null ,"This is SUB page 7 html content" ]),
new SQL_ROW([8, 6,"Page8" , null , null ,"This is SUB SUB page 8 html content" ])
];
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment