Skip to content

Commit 0eee4c0

Browse files
committed
Merge pull request #150 from rwifeng/add_demos
Add demos
2 parents a864511 + 24c8ad1 commit 0eee4c0

File tree

10 files changed

+19
-14
lines changed

10 files changed

+19
-14
lines changed

autoload.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
<?php
22

3-
$path = __DIR__ . DIRECTORY_SEPARATOR . 'src';
4-
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
3+
function classLoader($class)
4+
{
5+
$path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
6+
$file = __DIR__ . '/src/' . $path . '.php';
57

6-
spl_autoload_extensions('.php');
7-
spl_autoload_register();
8+
if (file_exists($file)) {
9+
require_once $file;
10+
}
11+
}
12+
spl_autoload_register('classLoader');
813

9-
require_once 'src/Qiniu/functions.php';
14+
require_once __DIR__ . '/src/Qiniu/functions.php';

examples/bucket_mgr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
require_once '../autoload.php';
2+
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
55
use Qiniu\Storage\BucketManager;

examples/callback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
require_once '../autoload.php';
2+
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
55

examples/download_token.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
require_once '../autoload.php';
2+
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
55

examples/fetch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
require_once '../autoload.php';
2+
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
55
use Qiniu\Storage\BucketManager;

examples/list_file.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
require_once '../autoload.php';
2+
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
55
use Qiniu\Storage\BucketManager;

examples/mkzip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
require_once '../autoload.php';
2+
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
55
use Qiniu\Processing\PersistentFop;

examples/pfop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
require_once '../autoload.php';
2+
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
55
use Qiniu\Processing\PersistentFop;

examples/up.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
require_once '../autoload.php';
2+
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
55
use Qiniu\Storage\UploadManager;

examples/upload_token.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
require_once '../autoload.php';
2+
require_once __DIR__ . '/../autoload.php';
33

44
use Qiniu\Auth;
55

0 commit comments

Comments
 (0)