This repository was archived by the owner on Oct 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -13,4 +13,6 @@ public function getConfig(): ConfigInterface;
1313 public function getStatistics (): StatisticsInterface ;
1414
1515 public function getCertificates (): array ;
16+
17+ public function setAccessLog ($ path , $ format = null );
1618}
Original file line number Diff line number Diff line change 33namespace Pavlusha311245 \UnitPhpSdk ;
44
55use Pavlusha311245 \UnitPhpSdk \Config \Statistic ;
6+ use Pavlusha311245 \UnitPhpSdk \Enums \HttpMethodsEnum ;
67use Pavlusha311245 \UnitPhpSdk \Exceptions \UnitException ;
78use Pavlusha311245 \UnitPhpSdk \Interfaces \UnitInterface ;
89
@@ -99,4 +100,27 @@ public function getStatistics(): Interfaces\StatisticsInterface
99100
100101 return new Statistic ($ result );
101102 }
103+
104+ /**
105+ * Setup access log file
106+ *
107+ * @return void
108+ * @throws UnitException
109+ */
110+ public function setAccessLog ($ path , $ format = null )
111+ {
112+ $ data ['path ' ] = $ path ;
113+
114+ if (!empty ($ format )) {
115+ $ data ['format ' ] = $ format ;
116+ }
117+
118+ $ request = new UnitRequest ($ this ->socket , $ this ->address );
119+ $ request ->setMethod (HttpMethodsEnum::PUT ->value );
120+ $ request ->setData (json_encode ($ data ));
121+
122+ return $ request ->send ('/config/access_log ' );
123+ // TODO: Implement setApplicationLogPath() method.
124+ // Implement functions from this source https://unit.nginx.org/configuration/#access-log
125+ }
102126}
You can’t perform that action at this time.
0 commit comments