File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,24 @@ public function getPhysicalHostingDescriptor()
2525 return new Struct \PhysicalHostingDescriptor ($ response );
2626 }
2727
28+ /**
29+ * @param string $field
30+ * @param integer|string $value
31+ * @return Struct\PhpSettings
32+ */
33+ public function getPhpSettings ($ field , $ value )
34+ {
35+ $ packet = $ this ->_client ->getPacket ();
36+ $ getTag = $ packet ->addChild ($ this ->_wrapperTag )->addChild ('get ' );
37+
38+ $ getTag ->addChild ('filter ' )->addChild ($ field , $ value );
39+ $ getTag ->addChild ('dataset ' )->addChild ('php-settings ' );
40+
41+ $ response = $ this ->_client ->request ($ packet , \PleskX \Api \Client::RESPONSE_FULL );
42+
43+ return new Struct \PhpSettings ($ response );
44+ }
45+
2846 /**
2947 * @param array $properties
3048 * @param array|null $hostingProperties
Original file line number Diff line number Diff line change 1+ <?php
2+ // Copyright 1999-2019. Parallels IP Holdings GmbH.
3+
4+ namespace PleskX \Api \Struct \Webspace ;
5+
6+ class PhpSettings extends \PleskX \Api \Struct
7+ {
8+ /** @var array */
9+ public $ properties ;
10+
11+ public function __construct ($ apiResponse )
12+ {
13+ $ this ->properties = [];
14+
15+ foreach ($ apiResponse ->webspace ->get ->result ->data ->{'php-settings ' }->setting as $ setting ) {
16+ $ this ->properties [(string )$ setting ->name ] = (string )$ setting ->value ;
17+ }
18+ }
19+ }
Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ public function testGetPhysicalHostingDescriptor()
3737 $ this ->assertEquals ('string ' , $ ftpLoginProperty ->type );
3838 }
3939
40+ public function testGetPhpSettings ()
41+ {
42+ $ webspace = static ::_createWebspace ();
43+ $ info = static ::$ _client ->webspace ()->getPhpSettings ('id ' , $ webspace ->id );
44+
45+ $ this ->assertArrayHasKey ('open_basedir ' , $ info ->properties );
46+ }
47+
4048 public function testCreateWebspace ()
4149 {
4250 $ webspace = static ::_createWebspace ();
You can’t perform that action at this time.
0 commit comments