Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 80 lines (50 sloc) 2.509 kb
b6ad004 Jon Parise Add an initial README file.
authored
1 # Python in PHP
2
3 Copyright © 2002-2012 Jon Parise
4
5 ## Overview
6
7 This code is released under the terms of the [MIT License][license].
8
9 ### Requirements
10
11 The Python extension has the following system requirements:
12
13 - PHP version 5.2.0 or later
14 - PEAR installer version 1.4.3 or later
15
16 ### Installation
17
18 The easiest way to install the Perforce extension is by using the PECL
19 installer::
20
21 pecl install python
22
23 If you're building from source code, should use the ``--with-python``
24 configuration option. If your copy of the Python hasn't been installed in one
25 of the default locations, you can specify it as a parameter::
26
27 --with-python=/opt/python
28
29 More detailed information on installing PECL packages in general can be found
30 in the [Installation of PECL Extensions][pecl-install] section of the [PHP
31 Manual][php-manual].
32
33 ### Source Code
34
35 This package's source code is hosted on GitHub:
36
37 https://github.com/jparise/php-python.git
38
39 A number of unit tests are included to help maintain correct and expected
40 behavior. The tests can be run using PECL tool's `run-tests` command:
41
42 pecl run-tests -p python
43
44 Additional unit test contributions are welcome, especially when they increase
45 code coverage or exercise specific use cases.
46
47 ## Usage
48
49 ### INI Settings
50
51 #### python.optimize
52
53 The `python.optimize` INI setting controls the Python interpreter's runtime
54 optimization level. This is a global, system-wide setting and therefore can
55 only be set in the PHP.ini file.
56
57 When set to **0** (the default), no additional optimizations are enabled, and
58 the built-in `__debug__` flag is True.
59
60 When set to **1** (equivalent to Python's `-O` command line option), the
61 Python interpreter will generate optimized bytecode, and the built-in
62 `__debug__` flag is set to False.
63
64 When set to **2** (equivalent to Python's `-OO` command line option), the
65 Python doc-strings will be removed in addition to the above optimizations.
66
67 ## Development and Support
68
69 ### Reporting Problems and Suggestions
70
71 If you run into a problem or would like to make a suggestion, please use the
72 [issue tracker][]. Feel free to contact me directly for other issues, but
73 please try to use the bug tracker whenever possible so that others in the
74 community will benefit from your feedback and my responses.
75
76 [license]: http://www.opensource.org/licenses/mit-license.php
77 [pecl-install]: http://www.php.net/manual/install.pecl.php
78 [php-manual]: http://www.php.net/manual/
79 [issue tracker]: https://github.com/jparise/php-python/issues
Something went wrong with that request. Please try again.