Skip to content

Commit 933effc

Browse files
update
1 parent 3803602 commit 933effc

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/Traits/TameTrait.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,49 @@ public static function isAppFramework()
3333
'\Symfony\Component\Routing\Annotation\Route',
3434
]);
3535
}
36+
37+
/**
38+
* Check if the application is running under Laravel.
39+
*
40+
* @return bool
41+
*/
42+
public static function isLaravel()
43+
{
44+
return self::checkClassExists('\Illuminate\Foundation\Application');
45+
}
46+
47+
/**
48+
* Check if the application is running under CodeIgniter.
49+
*
50+
* @return bool
51+
*/
52+
public static function isCodeIgniter()
53+
{
54+
return self::checkClassExists('\CI_Controller');
55+
}
56+
57+
/**
58+
* Check if the application is running under CakePhp.
59+
*
60+
* @return bool
61+
*/
62+
public static function isCakePhp()
63+
{
64+
return self::checkClassExists('\Cake\Controller\Controller');
65+
}
66+
67+
/**
68+
* Check if the application is running under Symfony.
69+
*
70+
* @return bool
71+
*/
72+
public static function isSymfony()
73+
{
74+
return self::checkClassExists([
75+
'\Symfony\Component\HttpKernel\Kernel',
76+
'\Symfony\Component\Routing\Annotation\Route'
77+
]);
78+
}
3679

3780
/**
3881
* isClosure

0 commit comments

Comments
 (0)