sandrulis Posted February 11, 2015 Report Share Posted February 11, 2015 Sveiki! Radusies neliela kļūda un īsti nesaprotu kur ir vaina, jo reāli izskatās ka ir ok? Kļūda: PHP Notice: A non well formed numeric value encountered in File/Archive/Reader/File.php on line 207 function getData($length = -1) { $error = $this->_ensureFileOpened(); if (PEAR::isError($error)) { return $error; } if (feof($this->handle)) { return null; } if ($length == -1) { $contents = ''; $blockSize = File_Archive::getOption('blockSize'); // Ensure that magic_quote_runtime isn't set, // if we don't want to have corrupted archives. $saveMagicQuotes = get_magic_quotes_runtime(); set_magic_quotes_runtime(0); while (!feof($this->handle)) { $contents .= fread($this->handle, $blockSize); } set_magic_quotes_runtime($saveMagicQuotes); return $contents; } else { if ($length == 0) { return 0; } else { return fread($this->handle, $length); } } } 207 rindiņa ir "return fread($this->handle, $length);" Link to comment Share on other sites More sharing options...
qwerty Posted February 11, 2015 Report Share Posted February 11, 2015 "PHP Notice: A non well formed numeric value encountered in File/Archive/Reader/File.php on line 207" Tulkoju: Brīdinājums - 207. rindā izmantots mainīgais, kam būtu jābūt skaitlim, bet tas nav skaitlis. Skaidroju: 207. rindā pēc skaitļa izklausās $length. Acīmredzot esi tur padevis kaut ko citu. uztaisi var_dump($length), die($length) vai kko tml Link to comment Share on other sites More sharing options...
sandrulis Posted February 11, 2015 Author Report Share Posted February 11, 2015 (edited) 207. rindā pēc skaitļa izklausās $length. Acīmredzot esi tur padevis kaut ko citu. uztaisi var_dump($length), die($length) vai kko tml es pārbaudīju un lenght ir cipars :/ Edited February 11, 2015 by sandrulis Link to comment Share on other sites More sharing options...
qwerty Posted February 11, 2015 Report Share Posted February 11, 2015 Varbūt tas ir strings, kas izskatās pēc cipara. proti "1" - tas ir teksts, nevis cipars. Link to comment Share on other sites More sharing options...
sandrulis Posted February 11, 2015 Author Report Share Posted February 11, 2015 Varbūt tas ir strings, kas izskatās pēc cipara. proti "1" - tas ir teksts, nevis cipars. $lenght pēc pārbaudes ir 16 varbūt tas ir par mazu, pats dīvainākais ir tas ka 74kB vai 333kB failam tas lenght ir vienāds, tam tā jābūt? Link to comment Share on other sites More sharing options...
Pats Toms Posted February 11, 2015 Report Share Posted February 11, 2015 intval($length) Link to comment Share on other sites More sharing options...
v3rb0 Posted February 11, 2015 Report Share Posted February 11, 2015 - $lenght jābūt tik, cik daudz daudz baitus gribi nolasīt. ja visu failu, tad 16 būs nepareizi. - ja tik tālu viss ok, tad pārbaudi ka getData() netiek izsaukts kaut kad vēl no kaut kurienes citur, kur nepārbaudīji. - un vispār tā funkcija ir unikums - viņa atgriež kļūdas kodu, null, 0 vai datus. whata?! Link to comment Share on other sites More sharing options...
F3llony Posted February 11, 2015 Report Share Posted February 11, 2015 - un vispār tā funkcija ir unikums - viņa atgriež kļūdas kodu, null, 0 vai datus. whata?! Oh boy, do I have a story for you. Link to comment Share on other sites More sharing options...
sandrulis Posted February 11, 2015 Author Report Share Posted February 11, 2015 paldies viss strādā :) Link to comment Share on other sites More sharing options...
Recommended Posts