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