94 lines
2.7 KiB
PHP
94 lines
2.7 KiB
PHP
<?php
|
|
|
|
namespace Config;
|
|
|
|
use App\Services\Auth\GoogleService;
|
|
use App\Services\Auth\LocalService;
|
|
use App\Services\TrafficService;
|
|
use App\Services\UserService;
|
|
use CodeIgniter\Config\BaseService;
|
|
|
|
/**
|
|
* Services Configuration file.
|
|
*
|
|
* Services are simply other classes/libraries that the system uses
|
|
* to do its job. This is used by CodeIgniter to allow the core of the
|
|
* framework to be swapped out easily without affecting the usage within
|
|
* the rest of your application.
|
|
*
|
|
* This file holds any application-specific services, or service overrides
|
|
* that you might need. An example has been included with the general
|
|
* method format you should use for your service methods. For more examples,
|
|
* see the core Services file at system/Config/Services.php.
|
|
*/
|
|
class Services extends BaseService
|
|
{
|
|
/*
|
|
* public static function example($getShared = true)
|
|
* {
|
|
* if ($getShared) {
|
|
* return static::getSharedInstance('example');
|
|
* }
|
|
*
|
|
* return new \CodeIgniter\Example();
|
|
* }
|
|
*/
|
|
//로그인정보요
|
|
public static function myauth($getShared = true): LocalService
|
|
{
|
|
if ($getShared) {
|
|
return static::getSharedInstance(__FUNCTION__);
|
|
} else {
|
|
return new LocalService(
|
|
new \App\Models\UserModel(),
|
|
new \App\Forms\Auth\LocalForm()
|
|
);
|
|
}
|
|
}
|
|
//로그인처리용
|
|
public static function localauth($getShared = true): LocalService
|
|
{
|
|
if ($getShared) {
|
|
return static::getSharedInstance(__FUNCTION__);
|
|
} else {
|
|
return new LocalService(
|
|
new \App\Models\UserModel(),
|
|
new \App\Forms\Auth\LocalForm()
|
|
);
|
|
}
|
|
}
|
|
public static function googleauth($getShared = true): GoogleService
|
|
{
|
|
if ($getShared) {
|
|
return static::getSharedInstance(__FUNCTION__);
|
|
}
|
|
return new GoogleService(
|
|
new \App\Models\USerModel(),
|
|
new \App\Forms\Auth\GoogleForm(),
|
|
new \App\Libraries\MySocket\GoogleSocket\CURL()
|
|
);
|
|
}
|
|
//로그인처리용
|
|
public static function userservice($getShared = true): UserService
|
|
{
|
|
if ($getShared) {
|
|
return static::getSharedInstance(__FUNCTION__);
|
|
}
|
|
return new UserService(
|
|
new \App\Models\USerModel(),
|
|
new \App\Forms\UserForm()
|
|
);
|
|
}
|
|
|
|
public static function trafficservice($getShared = true): TrafficService
|
|
{
|
|
if ($getShared) {
|
|
return static::getSharedInstance(__FUNCTION__);
|
|
}
|
|
return new TrafficService(
|
|
new \App\Models\TrafficModel(),
|
|
new \App\Forms\TrafficForm()
|
|
);
|
|
}
|
|
}
|