diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:25:52 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-17 02:25:52 +0900 |
| commit | 7f606f36fef0c0467c3c0db3d0da33af486dae8a (patch) | |
| tree | c3f0a3340e1dbfc5245964a775b73030d5abf44e /crates/shirabe-external-packages/src/symfony/component/process | |
| parent | 9389ddbf06f6d38445c277640cab7b2270057790 (diff) | |
| download | php-shirabe-7f606f36fef0c0467c3c0db3d0da33af486dae8a.tar.gz php-shirabe-7f606f36fef0c0467c3c0db3d0da33af486dae8a.tar.zst php-shirabe-7f606f36fef0c0467c3c0db3d0da33af486dae8a.zip | |
feat(port): add stub implementations of shirabe-external-packages
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/component/process')
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!() + } +} |
