-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.php
39 lines (30 loc) · 1.21 KB
/
main.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
<?php
require_once 'IOC/XMLApplicationContext.php';
require_once 'IOC/WebApplicationContext.php';
require_once 'IOC/WebApplicationContextUtils.php';
require_once 'Services/CustomerService.php';
require_once 'Services/CustomerServiceImpl.php';
require_once 'Services/DepartmentService.php';
require_once 'Services/DepartmentServiceImpl.php';
require_once 'Services/EmployeeService.php';
require_once 'Services/EmployeeServiceImpl.php';
require_once 'Services/BirthdayService.php';
require_once 'Services/BirthdayServiceImpl.php';
require_once 'Services/Child.php';
require_once 'Services/MaleChild.php';
require_once 'Services/FemaleChild.php';
require_once 'Services/UnbornChild.php';
try {
$context = WebApplicationContextUtils::getContext('applicationContext.xml');
/* @var $customerService CustomerService */
$customerService = $context->getObject('customerService');
print $customerService->getNameAndDepartment();
print "**********************************************\n";
// @var $birthdayService BirthdayService */
$birthdayService = $context->getObject('birthdayService');
$birthdayService->birthday();
} catch (Exception $e) {
print $e->getMessage();
}
print "\n";
?>