-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
29 lines (22 loc) · 834 Bytes
/
Copy pathinit.php
File metadata and controls
29 lines (22 loc) · 834 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
<?php
use Bookstore\Domain\Book;
use Bookstore\Domain\Customer;
error_reporting( E_ALL );
ini_set( 'display_errors', '1' );
require_once __DIR__ . '/Book.php';
require_once __DIR__ . '/Customer.php';
/* function __autoload ( $classname )
{
$lastSlash = strpos($classname, '\\') + 1;
$classname = substr($classname, $lastSlash);
$directory = str_replace('\\', '/', $classname);
$filename = __DIR__ . '/src/' . $directory . '.php';
require_once($filename);
}
*/
$book1 = new Bookstore\Domain\Book("9785267006323", "The Book PhP", "George Washington", 12);
$book2 = new Bookstore\Domain\Book("9780061120084", "To Kill a Mockingbird", "Harper Lee", 2);
$customer1 = new Customer(1, 'John', 'Doe', 'johndoe@mail.com');
$customer2 = new Customer(2, 'Mary', 'Poppins', 'mp@mail.com');
$book1->available = 2;
$customer1->id = 3;