php - The bug Fatal error: Cannot redeclare date_diff() in -
I used the cakepad with version 1.1.7692.
When I call it php ver & gt; 5.3.2, It has a bug:
Fatal error: date_diff can not redeclare (). And I run it with php ver 5.2.9, it shows lots of text and code in the same way:
quality = 100; $ Thumb- & gt; Filename = "/ path / to / file .jpg"; / / Important - $ thumb-> any manipulation Init (); // 50% $ thumb-> percent = 50; $ Thumb- & gt; Resize (); // crop image to 350x350 $ thumbs-> crop size = 350 from the center of the image; $ Thumb- & gt; crop (); // Image size 125 px wide not $ thumb- & gt; Percentage = 0; $ Thumb- & gt; MaxWide = 125; $ Thumb- & gt; Resize (); // Save image as 'filename.jpg' $ thumb-> Save ('/ path / to / save / filename.jpg'); You can also use this class to create thumbnails and display them when you create your manipulations so you can display the result: echo ''; * / Class extends ThumbnailComponent object {var $ errmsg; // error message parse $ error to parse; // flag is a var var format; // File format format var $ currentDimensions = array (); // current dimensions of current images var $ newDimensions = array (); // New dimension after manipulation var $ newImage; // Last image to display / saved var $ oldImage; // Original image is working var $ rectangle; // Image is being manipulated; var $ fileName; // Image file name, directory can include var $ maxWidth; // Image maximum width var $ maxHeight; // maximum image height of $ var; Original image size // percent var $ quality; // image quality of jpeg images var $ cropSize; This function is date_diff: function date_diff ($ start_date, $ end_date) {$ Splitstdate = partition ("", $ start_date ); $ Splitenddate = split ("", $ end_date); List ($ years, $ months, $ days) = partition ("-", $ splitstdate [0]); List ($ year_test, $ month_test, $ day_test) = partition ("-", $ splitenddate [0]); List ($ hour, $ min, $ sec) = partition (":", $ splitstdate [1]); List ($ hour_test, $ min_test, $ sec_test) = partition (":", $ splitenddate [1]); $ Start = mktime ($ hour, $ min, $ sec, $ month, $ day, $ year); $ End = mktime ($ hours_tight, $ min_test, $ sec_test, $ month_teight, $ day_test, $ year_test); $ Date_diff = $ start- $ end; If ($ date_diff & lt; 0) $ date_diff = 0; $ Day = interval ($ dated / df / (3600 * 24)); $ Hms = Date ('h \ h \ r \ m \ i \ n s \ s \ e \ c \ a \ g \ o', $ date_diff); Return $ days. ' day '. $ HMS; } Who knows the reason for the bug and the method can solve it? Thanks all php
date_diff in the inklift function < Code> 5.3.0 You can not do it again.
Comments
Post a Comment