Jump to:

547 Posts in 2233 Topics by 238 members

Hosting Requirements

SilverStripe Forums » Hosting Requirements » Deprecated Functions in PHP5.3

What you need to consider when choosing a hosting provider and plan.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1320 Views
  • teejay
    Avatar
    Community Member
    63 Posts

    Deprecated Functions in PHP5.3 Link to this post

    Hello,
    I am just wondering why there are still so may deprecated function used in the latest 2.4 version. We have written a little scanner which looks up some keywords (could be comments as well so its not hundred percent correct but it gives a good overview) to find deprecated function calls. The result is really not so bad as for lots of the functions there is a replacement even in php 5.2. eg split -> explode, ereg -> preg_match (slight change necessary). So here is the list

    php 5.3 deprecatinator
    +++++++++++++looking for call_user_method++++++++++
    +++++++++++++looking for call_user_method_array++++++++++
    +++++++++++++looking for define_syslog_variables++++++++++

    +++++++++++++looking for ereg++++++++++
    ./sapphire/forms/CreditCardField.php
    ./sapphire/email/Email.php
    ./sapphire/email/Mailer.php
    ./sapphire/core/HTTP.php
    ./sapphire/core/i18nTextCollector.php
    ./sapphire/core/i18n.php
    ./sapphire/core/SSViewer.php
    ./sapphire/core/model/fieldtypes/Date.php
    ./sapphire/core/model/fieldtypes/Varchar.php
    ./sapphire/core/model/fieldtypes/Datetime.php
    ./sapphire/integration/Geoip.php
    ./silverstripe-blog/thirdparty/xmlrpc/xmlrpc.php

    +++++++++++++looking for ereg_replace++++++++++
    ./sapphire/dev/SapphireTestReporter.php
    ./sapphire/forms/CheckboxSetField.php
    ./sapphire/forms/FormField.php
    ./sapphire/forms/FieldGroup.php
    ./sapphire/forms/OptionsetField.php
    ./sapphire/email/Mailer.php
    ./sapphire/search/AdvancedSearchForm.php
    ./sapphire/security/PermissionCheckboxSetField.php
    ./sapphire/widgets/Widget.php
    ./sapphire/core/control/ContentNegotiator.php
    ./sapphire/core/control/Director.php
    ./sapphire/core/ManifestBuilder.php
    ./sapphire/core/i18nTextCollector.php
    ./sapphire/core/Convert.php
    ./sapphire/core/SSViewer.php
    ./sapphire/core/model/Image.php
    ./sapphire/core/model/SiteTree.php
    ./sapphire/core/model/Database.php
    ./sapphire/integration/XML.php
    ./sapphire/filesystem/Folder.php
    ./sapphire/filesystem/Upload.php
    ./sapphire/filesystem/File.php
    ./cms/code/SideReport.php
    ./cms/code/CMSSiteTreeFilter.php
    ./cms/code/LeftAndMain.php
    ./cms/code/sitefeatures/PageCommentInterface.php
    ./cms/code/staticpublisher/FilesystemPublisher.php
    ./cms/code/AssetAdmin.php

    +++++++++++++looking for eregi++++++++++

    +++++++++++++looking for eregi_replace++++++++++
    ./sapphire/core/control/ContentNegotiator.php
    ./sapphire/core/Convert.php
    ./sapphire/core/model/Database.php

    +++++++++++++looking for set_magic_quotes_runtime++++++++++
    ./sapphire/thirdparty/Zend/Cache/Backend/File.php

    +++++++++++++looking for session_register++++++++++
    +++++++++++++looking for session_unregister++++++++++
    +++++++++++++looking for session_is_registered++++++++++
    +++++++++++++looking for set_socket_blocking++++++++++

    +++++++++++++looking for split++++++++++
    ./recaptcha/code/RecaptchaField.php
    ./sapphire/forms/DatetimeField.php
    ./sapphire/forms/CreditCardField.php
    ./sapphire/forms/PhoneNumberField.php
    ./sapphire/tasks/MigrateTranslatableTask.php
    ./sapphire/thirdparty/simplepie/idn/idna_convert.class.php
    ./sapphire/thirdparty/tinymce/plugins/spellchecker/rpc.php
    ./sapphire/thirdparty/json/JSON.php
    ./sapphire/thirdparty/Zend/Cache/Frontend/Page.php
    ./sapphire/thirdparty/Zend/Locale/Format.php
    ./sapphire/thirdparty/Zend/Locale/Math.php
    ./sapphire/thirdparty/simpletest/http.php
    ./sapphire/thirdparty/simpletest/url.php
    ./sapphire/parsers/HTML/HTMLBBCodeParser.php
    ./sapphire/core/i18nTextCollector.php
    ./sapphire/core/SSViewer.php
    ./sapphire/core/model/fieldtypes/HTMLText.php
    ./sapphire/core/model/Translatable.php
    ./sapphire/filesystem/File.php
    ./sapphire/tests/fieldtypes/TextTest.php
    ./cms/code/CMSBatchActionHandler.php
    ./cms/code/LeftAndMain.php
    ./cms/code/AssetAdmin.php
    ./cms/code/Diff.php
    ./cms/code/CMSMain.php
    ./cms/code/ModelAdmin.php
    ./silverstripe-blog/code/widgets/TagCloudWidget.php
    ./silverstripe-blog/code/BlogEntry.php
    ./silverstripe-blog/thirdparty/xmlrpc/xmlrpcs.php
    ./silverstripe-blog/thirdparty/xmlrpc/xmlrpc.php

    +++++++++++++looking for spliti++++++++++
    +++++++++++++looking for sql_regcase++++++++++
    +++++++++++++looking for mysql_db_query++++++++++
    +++++++++++++looking for mysql_escape_string++++++++++

    I know they will spit out only notices but come one we are reaching already php 5.4 and silverstripe didn't even sort out php 5.3.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Deprecated Functions in PHP5.3 Link to this post

    SS 2.4 uses ereg and such deprecated functions. When it came out, PHP 5.3 was only in it's first few versions and 5.2 was still a common PHP version, so deprecated functions weren't replaced.

    SS 3.0 has been patched to work the highest level of error reporting turned on. E_ALL and E_STRICT which includes also E_DEPRECATED.
    If someone uses a deprecated function in SS 3.0, an E_DEPRECATED error is reported.

    Thanks,
    Sean

    1320 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.