Skip to content

Commit a95fbcb

Browse files
committed
use composer.json in the project root
So the examples always use the latest version.
1 parent c0d4140 commit a95fbcb

File tree

9 files changed

+24
-13
lines changed

9 files changed

+24
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to `:vips` will be documented in this file.
55
## master
66

77
- improve FFI startup [West14]
8+
- revise example use of composer [jcupitt]
89

910
## 2.1.1 - 2022-11-13
1011

examples/addconst.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require __DIR__ . '/vendor/autoload.php';
4+
require dirname(__DIR__) . '/vendor/autoload.php';
55

66
use Jcupitt\Vips;
77

examples/bench.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require __DIR__ . '/vendor/autoload.php';
4+
require dirname(__DIR__) . '/vendor/autoload.php';
55

66
use Jcupitt\Vips;
77

8+
if (count($argv) != 3) {
9+
echo("usage: ./bench.php input-image output-image\n");
10+
exit(1);
11+
}
12+
813
$im = Vips\Image::newFromFile($argv[1], ['access' => Vips\Access::SEQUENTIAL]);
914

1015
$im = $im->crop(100, 100, $im->width - 200, $im->height - 200);

examples/class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require __DIR__ . '/vendor/autoload.php';
4+
require dirname(__DIR__) . '/vendor/autoload.php';
55

66
use Jcupitt\Vips;
77

examples/composer.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/sig.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require __DIR__ . '/vendor/autoload.php';
4+
require dirname(__DIR__) . '/vendor/autoload.php';
55

66
use Jcupitt\Vips;
77

@@ -141,6 +141,11 @@ function sigLAB(Vips\Image $image, bool $sharpen, float $midpoint, float $contra
141141
]);
142142
}
143143

144+
if (count($argv) != 3) {
145+
echo("usage: ./sig.php input-image output-image\n");
146+
exit(1);
147+
}
148+
144149
$im = Vips\Image::newFromFile($argv[1], ['access' => Vips\Access::SEQUENTIAL]);
145150

146151
/**

examples/vips-magick.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require __DIR__ . '/vendor/autoload.php';
4+
require dirname(__DIR__) . '/vendor/autoload.php';
55

66
use Jcupitt\Vips;
77

8+
if (count($argv) != 3) {
9+
echo("usage: ./vips-magick.php input-image output-image\n");
10+
exit(1);
11+
}
12+
813
/* Load an image with libvips, render to a large memory buffer, wrap a imagick
914
* image around that, then use imagick to save as another file.
1015
*/

examples/watermark-image.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require __DIR__ . '/vendor/autoload.php';
4+
require dirname(__DIR__) . '/vendor/autoload.php';
55
use Jcupitt\Vips;
66

77
#Vips\Config::setLogger(new Vips\DebugLogger());
@@ -41,4 +41,4 @@
4141
$image = null;
4242
$watermark = null;
4343

44-
Vips\Config::shutDown();
44+
Vips\FFI::shutDown();

examples/watermark-text.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require __DIR__ . '/vendor/autoload.php';
4+
require dirname(__DIR__) . '/vendor/autoload.php';
55
use Jcupitt\Vips;
66

77
#Vips\Config::setLogger(new Vips\DebugLogger());

0 commit comments

Comments
 (0)