aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/component/process
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/component/process')
-rw-r--r--crates/shirabe-external-packages/src/symfony/component/process/exception/mod.rs3
-rw-r--r--crates/shirabe-external-packages/src/symfony/component/process/exception/process_signaled_exception.rs13
-rw-r--r--crates/shirabe-external-packages/src/symfony/component/process/exception/process_timed_out_exception.rs13
-rw-r--r--crates/shirabe-external-packages/src/symfony/component/process/exception/runtime_exception.rs13
-rw-r--r--crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs16
-rw-r--r--crates/shirabe-external-packages/src/symfony/component/process/mod.rs4
-rw-r--r--crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs16
-rw-r--r--crates/shirabe-external-packages/src/symfony/component/process/process.rs110
8 files changed, 188 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/component/process/exception/mod.rs b/crates/shirabe-external-packages/src/symfony/component/process/exception/mod.rs
new file mode 100644
index 0000000..0fec4ee
--- /dev/null
+++ b/crates/shirabe-external-packages/src/symfony/component/process/exception/mod.rs
@@ -0,0 +1,3 @@
+pub mod process_signaled_exception;
+pub mod process_timed_out_exception;
+pub mod runtime_exception;
diff --git a/crates/shirabe-external-packages/src/symfony/component/process/exception/process_signaled_exception.rs b/crates/shirabe-external-packages/src/symfony/component/process/exception/process_signaled_exception.rs
new file mode 100644
index 0000000..154a7a7
--- /dev/null
+++ b/crates/shirabe-external-packages/src/symfony/component/process/exception/process_signaled_exception.rs
@@ -0,0 +1,13 @@
+#[derive(Debug)]
+pub struct ProcessSignaledException {
+ pub message: String,
+ pub code: i64,
+}
+
+impl std::fmt::Display for ProcessSignaledException {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "{}", self.message)
+ }
+}
+
+impl std::error::Error for ProcessSignaledException {}
diff --git a/crates/shirabe-external-packages/src/symfony/component/process/exception/process_timed_out_exception.rs b/crates/shirabe-external-packages/src/symfony/component/process/exception/process_timed_out_exception.rs
new file mode 100644
index 0000000..cbcdaa4
--- /dev/null
+++ b/crates/shirabe-external-packages/src/symfony/component/process/exception/process_timed_out_exception.rs
@@ -0,0 +1,13 @@
+#[derive(Debug)]
+pub struct ProcessTimedOutException {
+ pub message: String,
+ pub code: i64,
+}
+
+impl std::fmt::Display for ProcessTimedOutException {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "{}", self.message)
+ }
+}
+
+impl std::error::Error for ProcessTimedOutException {}
diff --git a/crates/shirabe-external-packages/src/symfony/component/process/exception/runtime_exception.rs b/crates/shirabe-external-packages/src/symfony/component/process/exception/runtime_exception.rs
new file mode 100644
index 0000000..3ac2c8b
--- /dev/null
+++ b/crates/shirabe-external-packages/src/symfony/component/process/exception/runtime_exception.rs
@@ -0,0 +1,13 @@
+#[derive(Debug)]
+pub struct RuntimeException {
+ pub message: String,
+ pub code: i64,
+}
+
+impl std::fmt::Display for RuntimeException {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
+ write!(f, "{}", self.message)
+ }
+}
+
+impl std::error::Error for RuntimeException {}
diff --git a/crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs b/crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs
new file mode 100644
index 0000000..9aa5a8b
--- /dev/null
+++ b/crates/shirabe-external-packages/src/symfony/component/process/executable_finder.rs
@@ -0,0 +1,16 @@
+#[derive(Debug)]
+pub struct ExecutableFinder;
+
+impl ExecutableFinder {
+ pub fn new() -> Self {
+ todo!()
+ }
+
+ pub fn add_suffix(&mut self, suffix: &str) {
+ todo!()
+ }
+
+ pub fn find(&self, name: &str, default: Option<&str>, dirs: &[String]) -> Option<String> {
+ todo!()
+ }
+}
diff --git a/crates/shirabe-external-packages/src/symfony/component/process/mod.rs b/crates/shirabe-external-packages/src/symfony/component/process/mod.rs
new file mode 100644
index 0000000..4d21bf3
--- /dev/null
+++ b/crates/shirabe-external-packages/src/symfony/component/process/mod.rs
@@ -0,0 +1,4 @@
+pub mod exception;
+pub mod executable_finder;
+pub mod php_executable_finder;
+pub mod process;
diff --git a/crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs b/crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs
new file mode 100644
index 0000000..be99e8c
--- /dev/null
+++ b/crates/shirabe-external-packages/src/symfony/component/process/php_executable_finder.rs
@@ -0,0 +1,16 @@
+#[derive(Debug)]
+pub struct PhpExecutableFinder;
+
+impl PhpExecutableFinder {
+ pub fn new() -> Self {
+ todo!()
+ }
+
+ pub fn find(&self, include_args: bool) -> Option<String> {
+ todo!()
+ }
+
+ pub fn find_arguments(&self) -> Vec<String> {
+ todo!()
+ }
+}
diff --git a/crates/shirabe-external-packages/src/symfony/component/process/process.rs b/crates/shirabe-external-packages/src/symfony/component/process/process.rs
new file mode 100644
index 0000000..7572f3b
--- /dev/null
+++ b/crates/shirabe-external-packages/src/symfony/component/process/process.rs
@@ -0,0 +1,110 @@
+use shirabe_php_shim::PhpMixed;
+use indexmap::IndexMap;
+
+#[derive(Debug)]
+pub struct Process;
+
+impl Process {
+ pub const ERR: &'static str = "err";
+ pub const OUT: &'static str = "out";
+
+ pub fn new(
+ command: Vec<String>,
+ cwd: Option<String>,
+ env: Option<IndexMap<String, String>>,
+ input: Option<String>,
+ timeout: Option<f64>,
+ ) -> Self {
+ todo!()
+ }
+
+ pub fn from_shell_commandline(
+ command: &str,
+ cwd: Option<&str>,
+ env: Option<IndexMap<String, String>>,
+ input: Option<String>,
+ timeout: Option<f64>,
+ ) -> Self {
+ todo!()
+ }
+
+ pub fn set_timeout(&mut self, timeout: Option<f64>) -> &mut Self {
+ todo!()
+ }
+
+ pub fn set_env(&mut self, env: IndexMap<String, String>) -> &mut Self {
+ todo!()
+ }
+
+ pub fn set_input(&mut self, input: Option<String>) -> &mut Self {
+ todo!()
+ }
+
+ pub fn run(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) -> i64 {
+ todo!()
+ }
+
+ pub fn must_run(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) -> anyhow::Result<&mut Self> {
+ todo!()
+ }
+
+ pub fn start(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) {
+ todo!()
+ }
+
+ pub fn wait(&mut self, callback: Option<Box<dyn FnMut(&str, &str)>>) -> i64 {
+ todo!()
+ }
+
+ pub fn stop(&mut self, timeout: f64, signal: Option<i64>) -> Option<i64> {
+ todo!()
+ }
+
+ pub fn is_running(&self) -> bool {
+ todo!()
+ }
+
+ pub fn is_successful(&self) -> bool {
+ todo!()
+ }
+
+ pub fn is_started(&self) -> bool {
+ todo!()
+ }
+
+ pub fn is_terminated(&self) -> bool {
+ todo!()
+ }
+
+ pub fn get_output(&self) -> String {
+ todo!()
+ }
+
+ pub fn get_error_output(&self) -> String {
+ todo!()
+ }
+
+ pub fn get_exit_code(&self) -> Option<i64> {
+ todo!()
+ }
+
+ pub fn get_exit_code_text(&self) -> Option<String> {
+ todo!()
+ }
+
+ pub fn get_command_line(&self) -> String {
+ todo!()
+ }
+
+ pub fn check_timeout(&self) -> anyhow::Result<()> {
+ todo!()
+ }
+
+ pub fn get_timeout(&self) -> Option<f64> {
+ todo!()
+ }
+
+ pub fn set_working_directory(&mut self, cwd: &str) -> &mut Self {
+ todo!()
+ }
+}