1 %include /usr/lib/rpm/macros.php
3 %define _pearname PHP_Fork
4 Summary: %{_pearname} - Wrapper for pcntl_fork() with Java-like API
5 Summary(pl.UTF-8): %{_pearname} - Wrapper dla pcntl_fork() z API zbliżonym do Javy
6 Name: php-pear-%{_pearname}
10 Group: Development/Languages/PHP
11 Source0: http://pear.php.net/get/%{_pearname}-%{version}.tgz
12 # Source0-md5: b3bcc3e56d429f7810af28e74b5c3280
13 URL: http://pear.php.net/package/PHP_Fork/
14 BuildRequires: php-pear-PEAR
15 BuildRequires: rpm-php-pearprov >= 4.4.2-11
16 BuildRequires: rpmbuild(macros) >= 1.300
20 Requires: php-pear >= 4:1.0-7
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 PHP_Fork class. Wrapper around the pcntl_fork() stuff with a API set
26 like Java language. Practical usage is done by extending this class,
27 and re-defining the run() method.
29 This way PHP developers can enclose logic into a class that extends
30 PHP_Fork, then execute the start() method that forks a child process.
31 Communications with the forked process is ensured by using a Shared
32 Memory Segment; by using a user-defined signal and this shared memory
33 developers can access to child process methods that returns a
34 serializable variable.
36 The shared variable space can be accessed with the two methods:
37 - void setVariable($name, $value)
38 - mixed getVariable($name)
40 $name must be a valid PHP variable name; $value must be a variable or
41 a serializable object.
43 Resources (db connections, streams, etc.) cannot be serialized and so
44 they're not correctly handled.
46 In PEAR status of this package is: %{_status}.
48 %description -l pl.UTF-8
49 Klasa PHP_Fork. Wrapper dla zbioru funkcji pcntl_fork() i pochodnych z
50 API zbliżonym do języka Javy. Praktyczne zastosowanie polega na
51 rozszerzeniu tej klasy i przedefiniowaniu metody run().
53 Dzięki temu deweloper PHP może zamknąć warstwę logiczną wewnątrz klasy
54 rozszerzającej PHP_Fork, a następnie uruchomić metodę start() która
55 wywoła proces potomny. Komunikacja z nowo powstałym procesem jest
56 zapewniona za pomocą Segmentu Współdzielonej Pamięci (Shared Memory
57 Segment); używając zdefiniowanych przez użytkownika sygnałów i tejże
58 dzielonej pamięci deweloperzy mają dostęp do metod procesu potomnego,
59 które zwraca zmienną dająca się zserializować.
61 Dostęp do dzielonej przestrzeni zmiennych jest możliwy poprzez dwie
63 - void setVariable($name, $value)
64 - mixed getVariable($name)
66 $name musi być poprawną zmienną PHP; $value musi być zmienną lub
67 obiektem możliwym do serializacji.
69 Zasoby (połączenia z bazami danych, strumienie, itp) nie mogą być
70 zserializowane i jako takie nie są poprawnie obsługiwane.
72 Ta klasa ma w PEAR status: %{_status}.
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT%{php_pear_dir}
83 rm -rf $RPM_BUILD_ROOT
86 %defattr(644,root,root,755)
87 %doc install.log docs/%{_pearname}/examples
88 %{php_pear_dir}/.registry/*.reg
89 %{php_pear_dir}/PHP/*.php