• Resolved thomasprice61

    (@thomasprice61)


    Hi ERA404,
    I installed the latest version 3.0.0 of StaffList but it broke my website.
    Critical error as there was a dependency on PHP 7.3

    It seems, StaffList now needs PHP7.3, but my site is still PHP7.2
    Unfortunately, we are unable to upgrade to PHP7.3+ due to some legacy code (but we are working on it)

    I understand the reason this 7.3 dependency occurred is StaffList has migrated to PHPSpreadsheet.
    We also looked at PHPSpreadsheet for our project, but rejected it as it is too large and too complex. Instead, we chose:
    * https://github.com/shuchkin/simplexlsx (read)
    * https://github.com/shuchkin/simplexlsxgen (write)
    They are each a single PHP file, very simple to install, no dependencies, very simple to use, also reliable and supported.

    You may wish to look at these for StaffList to eliminate future dependency and complexity issues.

    regards Thomas

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ERA404

    (@era404)

    Hello Thomas,

    The library doesn’t explicitly support CSV format.
    We could look into the lib you recommended and fallback to native PHP/CSV support ( https://www.php.net/manual/en/function.fgetcsv.php ).

    Plugin Author ERA404

    (@era404)

    Hello Thomas,

    We removed PhpSpreadsheet in favor of the library(s) you recommended. These changes were made in version 3.1.0 of StaffList. Please let us know if this resolves your compat issues on PHP7.2.

    See the Changelog.

    ERA404

    Thread Starter thomasprice61

    (@thomasprice61)

    Hi ERA404,
    Many thanks for making the change to the SimpleXLS(x) library set.
    I hope it makes the management of the plugin easier for you.

    One thing I noticed in your code.
    You are calling the library without any exception handling … example:

    
    require_once( STAFFLIST__PLUGIN_DIR . '/lib/shuchkin/SimpleXLSXGen.php' );
    

    As this is a common library another plugin may use it, thus use the same class name.
    If so there will be an error:

    
    Fatal error: Cannot declare class SimpleXLSXGen, because the name is already in use in ...
    

    To resolve this you could:
    * use if ( !class_exists( 'SimpleXLSXGen' ) but that assumes the SimpleXLSXGen libraries will be identical (not a good assumption)
    * use namespaces (best long term solution)
    * rename the class ‘SimpleXLSXGen’ to ‘StaffList-SimpleXLSXGen’. A reasonable quick fix.

    FYI, we chose to rename the class as a short term fix but plan to introduce namespaces sometime soon.

    regards Thomas

    Thread Starter thomasprice61

    (@thomasprice61)

    Hi ERA404,
    Many thanks for 3.1.1
    Nice use of namespaces, we will learn from it ??

    regards Thomas

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘v3.0.0 broke my website’ is closed to new replies.