fatal-error

Why, Fatal error: Class 'PHPUnit_Framework_TestCase' not found in …?

最后都变了- 提交于 2019-11-27 03:02:09
Why I'm getting this PHP error? Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ... defines The PHPUnit documentation says used to say to include/require PHPUnit/Framework.php, as follows: require_once ('PHPUnit/Framework/TestCase.php'); UPDATE As of PHPUnit 3.5, there is a built-in autoloader class that will handle this for you: require_once 'PHPUnit/Autoload.php'; Thanks to Phoenix for pointing this out! shadi For those arriving here after updating phpunit to version 6 or greater released on 2017-02-03 (e.g. with composer), you may be getting this error because phpunit code is

relative path in require_once doesn't work

限于喜欢 提交于 2019-11-27 02:59:52
I have the following structure otsg > class > authentication.php > database.php > user.php > include > config.inc.php > encryption.php > include.php > session.php > index.php > registration.php include.php file has the following ini_set('display_errors', 1); error_reporting(E_ALL); ini_set('include_path',ini_get('include_path').':/Applications/MAMP/htdocs/otsg/:'); require_once 'config.inc.php'; require_once '../class/database.php'; require_once '../class/user.php'; require_once 'encryption.php'; require_once 'session.php'; require_once '../class/authentication.php'; and in the index.php page

Cannot redeclare function php [duplicate]

ⅰ亾dé卋堺 提交于 2019-11-27 01:32:00
This question already has an answer here: “Fatal error: Cannot redeclare <function>” 14 answers I have a function called parseDate, but when i call it on my php page (it's a joomla component page) I get Fatal error: Cannot redeclare parsedate() (previously declared in templates/ja_zeolite/assets/functions.php:2) in templates/ja_zeolite/assets/functions.php on line 21 line 2 is function parsedate($data) and line 21 is } (end of function). The function is: function parseDate($date){ $items = explode('.', $date); switch($items[1]){ case 1: $mese = 'Gen'; break; case 2: $mese = 'Feb'; break; case

Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 32140

风流意气都作罢 提交于 2019-11-27 00:37:14
问题 50% of the time when running my app I'm getting this error 06-20 12:56:51.183: A/libc(32140): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 32140 (example.www) I just have to reopen the app and then it works. But I don't know why I'm getting this error and the app crashes. I'm working with big images with dimensions, almost 1200x1200px and setting that as a background. I also use that image as a bitmap for some other activities as background. Also doing some calls to a server and

PHP Notice: Undefined offset: 1 with array when reading data

断了今生、忘了曾经 提交于 2019-11-27 00:16:14
问题 I am getting this PHP error: PHP Notice: Undefined offset: 1 Here is the PHP code that throws it: $file_handle = fopen($path."/Summary/data.txt","r"); //open text file $data = array(); // create new array map while (!feof($file_handle) ) { $line_of_text = fgets($file_handle); // read in each line $parts = array_map('trim', explode(':', $line_of_text, 2)); // separates line_of_text by ':' trim strings for extra space $data[$parts[0]] = $parts[1]; // map the resulting parts into array //

Fatal error: Using $this when not in object context

爷,独闯天下 提交于 2019-11-26 23:05:30
here is the part if having error. Fatal error: Using $this when not in object context in /pb_events.php on line 6 line 6 is: $jpp = $this->vars->data["jpp"]; function DoEvents($this) { global $_CONF, $_PAGE, $_TSM , $base; $jpp = $this->vars->data["jpp"]; $cache["departments"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_departments]}"); $cache["locations"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_location]}"); $cache["names"] = $this->db->QFetchRowArray("SELECT * FROM {$this->tables[job_names]}"); $cache["categories"] = $this->db->QFetchRowArray("SELECT *

swift can catch fatal error?

核能气质少年 提交于 2019-11-26 22:04:23
问题 I am trying to use Swift 2.0 try-catch. I originally had the following code override func viewDidLoad() { var obj : Object?; Hi( obj ); } But it procdues an error func Hi( open : Open? ) -> Open? { open!.Hi(); <-- here is error point. Fatal error ! print( "OK" ); return open; } Therefore I changed the code in viewDidLoad() to: override func viewDidLoad() { try { var obj : Object?; Hi( obj ); } catch { print( "bug !!!" ); <- I want to this !!! } } But it does not work !!! I guess swift's try

Handle fatal errors in PHP using register_shutdown_function()

拜拜、爱过 提交于 2019-11-26 21:56:31
According to the comment on this answer it is possible to catch Fatal Errors through a shutdown function which cannot be caught using set_error_handler() . However, I couldn't find out how to determine if the shutdown has occured due to a fatal error or due to the script reaching its end. Additionally, the debug backtrace functions seem to be defunct in the shutdown function, making it pretty worthless for logging the stack trace where the Fatal Error occured. So my question is: what's the best way to react on Fatal Errors (especially undefined function calls) while keeping the ability to

How can I catch a “catchable fatal error” on PHP type hinting?

♀尐吖头ヾ 提交于 2019-11-26 21:22:23
I am trying to implement Type Hinting of PHP5 on one of my class, class ClassA { public function method_a (ClassB $b) {} } class ClassB {} class ClassWrong{} Correct usage: $a = new ClassA; $a->method_a(new ClassB); producing error: $a = new ClassA; $a->method_a(new ClassWrong); Catchable fatal error: Argument 1 passed to ClassA::method_a() must be an instance of ClassB, instance of ClassWrong given... May I know if it is possible to catch that error(since it says "catchable")? and if yes, how? Thank you. Update: This is not a catchable fatal error anymore in php 7. Instead an "exception" is

require_once :failed to open stream: no such file or directory

本秂侑毒 提交于 2019-11-26 20:38:13
问题 I have this testing code in "PAGE A" : <?php require_once('../mysite/php/classes/eventManager.php'); $x=new EventManager(); $y=$x->loadNumbers(); ?> "eventManager.php" has inside a require_once: <?php require_once('../includes/dbconn.inc'); class EventManager {...} ?> My folders structure is this: mysite/php/classes folder and includes folder If i test PAGE A in a browser i receive: Warning: require_once(../includes/dbconn.inc) [function.require-once]: failed to open stream: No such file or