Skip to content

Commit 378e7b0

Browse files
committed
first commit after removing the C stuff
the C layer has moved off to a separate `vips-base` extension
1 parent b9279e4 commit 378e7b0

12 files changed

+208
-1823
lines changed

Diff for: CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Changelog
2+
All notable changes to `:vips` will be documented in this file.
3+
4+
## 0.1.0 - 2016-09-03
5+
6+
### Added
7+
- First commit
8+
9+
### Deprecated
10+
- Nothing
11+
12+
### Fixed
13+
- Nothing
14+
15+
### Remove
16+
- Nothing
17+
18+
### Security
19+
- Nothing

Diff for: CONTRIBUTING.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
We accept contributions via Pull Requests on [Github](https://github.com/thephpleague/:package_name).
6+
7+
8+
## Pull Requests
9+
10+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
11+
12+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
13+
14+
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
15+
16+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
17+
18+
- **Create feature branches** - Don't ask us to pull from your master branch.
19+
20+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
21+
22+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
23+
24+
25+
## Running Tests
26+
27+
``` bash
28+
$ phpunit
29+
```
30+
31+
32+
**Happy coding**!

Diff for: README.md

+20-106
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# PHP binding for libvips
1+
# use libvips from PHP
22

3-
This package lets you use the libvips image processing library from PHP.
3+
A high-level, fluent interface to the libvips image processing library. This
4+
module depends upon the `vips-base` extension.
5+
6+
The `vips-base` extension is very low-level. This module builds on that to make
7+
a high-level, fluent interface, very similar to the libvips bindings for Ruby
8+
and Python.
49

510
`vips` is fast and it can work without needing to have the
611
entire image loaded into memory. Programs that use `vips` don't
@@ -32,6 +37,14 @@ $image->writeToFile($argv[2]);
3237
?>
3338
```
3439

40+
And run with:
41+
42+
```
43+
$ ./try1.php ~/pics/k2.jpg x.tif
44+
```
45+
46+
See `examples/`.
47+
3548
Almost all methods return a new image for the result, so you can chain them.
3649
For example:
3750

@@ -76,120 +89,20 @@ http://www.vips.ecs.soton.ac.uk/supported/current/doc/html/libvips/
7689

7790
### How it works
7891

79-
`vips.c` defines a simple but ugly way to call any libvips operation from PHP.
92+
`vips-base` defines a simple but ugly way to call any libvips operation from PHP.
8093
It uses libvips' own introspection facilities and does not depend on anything
8194
else (so no gobject-introspection, for example). It's a fairly short 1,600
8295
lines of C.
8396

84-
`vips.php` is a PHP layer over the ugly `vips.c` API that tries to make a nice
85-
interface for programmers. It uses `__call()` and `__get()` to make all
97+
This module is a PHP layer over the ugly `vips-base` API that tries to make a
98+
nice interface for programmers. It uses `__call()` and `__get()` to make all
8699
libvips operations appear as methods, and all libvips properties as
87100
properties of the PHP `Vips\Image` class.
88101

89-
### Preparation
90-
91-
PHP is normally built for speed and is missing a lot of debugging support you
92-
need for extension development. For testing and dev, build your own php.
93-
I used 7.0.10 and configured with:
94-
95-
```
96-
$ ./configure --prefix=/home/john/vips --enable-debug --enable-maintainer-zts \
97-
--enable-cgi --enable-cli --with-readline --with-openssl
98-
```
99-
100-
### Regenerate build system
101-
102-
Run:
103-
104-
```
105-
$ phpize
106-
```
107-
108-
To scan `config.m4` and your php install and regenerate the build system.
109-
110-
### Configuring
111-
112-
Run
113-
114-
```
115-
$ ./configure
116-
```
117-
118-
Check the output carefully for errors, and obviously check that it found your
119-
libvips.
120-
121-
### Installing
122-
123-
Run:
124-
125-
126-
```
127-
$ make
128-
```
129-
130-
To build the module to the `modules/` directory in this repository.
131-
132-
Don't post php-vips test results to php.net! Stop this with:
133-
134-
135-
```
136-
$ export NO_INTERACTION=1
137-
```
138-
139-
140-
Test with:
141-
142-
143-
```
144-
$ make test
145-
```
146-
147-
Finally, install to your php extensions area with:
148-
149-
```
150-
$ make install
151-
```
152-
153-
### Using
154-
155-
Try:
156-
157-
```php
158-
#!/usr/bin/env php
159-
<?php
160-
include 'vips.php';
161-
162-
$image = Vips\Image::newFromFile($argv[1]);
163-
164-
echo "width = ", $image->width, "\n";
165-
166-
$image = $image->invert();
167-
168-
$image->writeToFile($argv[2]);
169-
?>
170-
```
171-
172-
And run with:
173-
174-
```
175-
$ ./try1.php ~/pics/k2.jpg x.tif
176-
```
177-
178-
See `examples/`.
179-
180-
### Links
181-
182-
http://php.net/manual/en/internals2.php
183-
184-
https://devzone.zend.com/303/extension-writing-part-i-introduction-to-php-and-zend/
185-
186-
https://devzone.zend.com/317/extension-writing-part-ii-parameters-arrays-and-zvals/
187-
188-
https://devzone.zend.com/446/extension-writing-part-iii-resources/
189-
190102
### Documentation
191103

192104
```
105+
$ phpcs src
193106
$ pear channel-discover pear.phpdoc.org
194107
$ pear install phpdoc/phpDocumentor
195108
$ phpdoc
@@ -204,3 +117,4 @@ Interactive mode enabled
204117
php > dl('imagick.' . PHP_SHLIB_SUFFIX);
205118
php > $im = new Imagick();
206119
```
120+

Diff for: composer.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "jcupitt/vips",
3+
"description": "A high-level, fluent interface to the libvips image processing library.",
4+
"keywords": [
5+
"image",
6+
"processing",
7+
"libvips"
8+
],
9+
"homepage": "https://github.com/jcupitt/php-vips",
10+
"license": "MIT",
11+
"authors": [
12+
{
13+
"name": "John Cupitt",
14+
"email": "[email protected]",
15+
"homepage": "https://github.com/jcupitt",
16+
"role": "Developer"
17+
}
18+
],
19+
"require": {
20+
"php" : ">=7.0.0",
21+
"jcupitt/vips-base" : ">=0.1.0"
22+
},
23+
"require-dev": {
24+
"phpunit/phpunit" : "4.*"
25+
},
26+
"autoload": {
27+
"psr-4": {
28+
"Jcupitt\\Vips\\": "src"
29+
}
30+
},
31+
"autoload-dev": {
32+
"psr-4": {
33+
"Jcupitt\\Vips\\Test\\": "tests"
34+
}
35+
},
36+
"extra": {
37+
"branch-alias": {
38+
"dev-master": "1.0-dev"
39+
}
40+
}
41+
}

Diff for: config.m4

-41
This file was deleted.

Diff for: config.w32

-9
This file was deleted.

Diff for: php_vips.h

-43
This file was deleted.

Diff for: phpdoc.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
</transformer>
1111

1212
<files>
13-
<file>vips.php</file>
14-
<file>vips.c</file>
13+
<directory>src</directory>
1514
</files>
1615

1716
</phpdocumentor>

Diff for: phpunit.xml.dist

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="League Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
<logging>
23+
<log type="tap" target="build/report.tap"/>
24+
<log type="junit" target="build/report.junit.xml"/>
25+
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
26+
<log type="coverage-text" target="build/coverage.txt"/>
27+
<log type="coverage-clover" target="build/logs/clover.xml"/>
28+
</logging>
29+
</phpunit>

0 commit comments

Comments
 (0)