[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pecl-cvs
Subject:    [PECL-CVS] =?utf-8?q?svn:_/pecl/yaf/trunk/tests/_037.phpt?=
From:       Xinchen_Hui <laruence () php ! net>
Date:       2012-11-21 9:26:48
Message-ID: svn-laruence-1353490008-328441-1493436287 () svn ! php ! net
[Download RAW message or body]

laruence                                 Wed, 21 Nov 2012 09:26:48 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=328441

Log:
update test

Changed paths:
    U   pecl/yaf/trunk/tests/037.phpt

Modified: pecl/yaf/trunk/tests/037.phpt
===================================================================
--- pecl/yaf/trunk/tests/037.phpt	2012-11-21 08:56:37 UTC (rev 328440)
+++ pecl/yaf/trunk/tests/037.phpt	2012-11-21 09:26:48 UTC (rev 328441)
@@ -1,15 +1,42 @@
 --TEST--
 Check for Yaf_Loader and open_basedir
 --SKIPIF--
-<?php if (!extension_loaded("yaf")) print "skip"; ?>
+<?php
+if (!extension_loaded("yaf")) {
+   die("skip");
+}
+if (version_compare(PHP_VERSION, "5.3", "lt")) {
+   die("skip open_basedir only can be tightened as of 5.3.0");
+}
+?>
 --INI--
-open_basedir=.
 yaf.lowcase_path=0
 --FILE--
 <?php
-$loader = Yaf_Loader::getInstance("/tmp");
-$loader->import('/tmp/no_exists_037.php');
-$loader->autoload("Foo_Bar307");
+$dir = __DIR__;
+$odir = $dir . "/foo";
+file_put_contents($dir . "/Dummy.php", "");
+
+ini_set("open_basedir",  $odir);
+$loader = Yaf_Loader::getInstance($dir);
+$loader->import($dir . "/Dummy.php");
+$loader->autoload("Dummy");
 ?>
+--CLEAN--
+<?php
+unlink(__DIR__ . "/Dummy.php");
+?>
 --EXPECTF--
-Warning: Yaf_Loader::autoload(): Failed opening script %sBar307.php: No such file or \
directory in %s037.php on line %d +Warning: Yaf_Loader::import(): open_basedir \
restriction in effect. File(%sDummy.php) is not within the allowed path(s): (%sfoo) \
in %s037.php on line %d +
+Warning: Yaf_Loader::import(%sDummy.php): failed to open stream: Operation not \
permitted in %s037.php on line %d +
+Warning: Yaf_Loader::import(): Failed opening '%sDummy.php' for inclusion \
(include_path='%s') in %s037.php on line %d +
+Warning: Yaf_Loader::autoload(): open_basedir restriction in effect. \
File(%sDummy.php) is not within the allowed path(s): (%sfoo) in %s037.php on line %d \
+ +Warning: Yaf_Loader::autoload(%sDummy.php): failed to open stream: Operation not \
permitted in %s037.php on line %d +
+Warning: Yaf_Loader::autoload(): Failed opening '%sDummy.php' for inclusion \
(include_path='%s') in %s037.php on line %d +
+Warning: Yaf_Loader::autoload(): Failed opening script %sDummy.php: Operation not \
permitted in %s037.php on line %d



-- 
PECL CVS Mailing List 
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic