Code Monkey home page Code Monkey logo

zf1-future's People

Contributors

adeelnawaz avatar akrabat avatar croensch avatar develart-projects avatar emelyanov-s avatar ezimuel avatar fballiano avatar froschdesign avatar gelolabs avatar glensc avatar holtkamp avatar hungtrinh avatar jack-worman avatar jimbolino avatar kaktusas2598 avatar kstenschke avatar luigifab avatar mhujer avatar mlocati avatar nazin avatar ondram avatar phpgangsta avatar shardj avatar siad007 avatar sreichel avatar techi602 avatar thomaslauria avatar tsmgeek avatar ventycz avatar weierophinney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zf1-future's Issues

Zend_Session Exceptions after migration from 1.18.3 to 1.18.9

I have updated the lastest version of zf1-future (1.18.9) into my production server running (PHP 7.4.13) and my error tracking begins to report a lot of session errors, some errors are difficult to reproduce, but in several requests I receive a lot of them, I investigated other causes, but the erros only stopped after I downgrade to 1.18.3. Bellow I list some of these errors, one of a login page, and another of a Zend_Captcha form. Some errors I able to reproduce, others my clients advice me.

Message:
The session has already been started. The session id must be set first.

Stack trace:
#0 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Session.php(436): Zend_Session::setId('63041a5e48e115c...')
#1 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Session/Namespace.php(143): Zend_Session::start(true)
#2 /home/cms2rs/www/application/classes/CmsAuth.php(9): Zend_Session_Namespace->__construct('Cms_Auth')
#3 /home/cms2rs/www/application/cms/controllers/AuthController.php(20): Class_CmsAuth->__construct()
#4 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(516): Cms_AuthController->loginAction()
#5 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('loginAction')
#6 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#7 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#8 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#9 /home/cms2rs/www/public/index.php(74): Zend_Application->run()

Message:
Exception caught by form: The session has already been started. The session id must be set first.

Stack trace:
#0 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Session.php(436): Zend_Session::setId('0ba6a0be45e7ba3...')
#1 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Session/Namespace.php(143): Zend_Session::start(true)
#2 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Captcha/Word.php(270): Zend_Session_Namespace->__construct('Zend_Form_Captc...')
#3 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Captcha/Word.php(314): Zend_Captcha_Word->getSession()
#4 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Captcha/Word.php(361): Zend_Captcha_Word->_setWord('c7p2')
#5 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Captcha/Image.php(438): Zend_Captcha_Word->generate()
#6 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Form/Element/Captcha.php(188): Zend_Captcha_Image->generate()
#7 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Form/Decorator/FormElements.php(116): Zend_Form_Element_Captcha->render()
#8 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Form.php(2993): Zend_Form_Decorator_FormElements->render('')
#9 /home/cms2rs/www/vendor/shardj/zf1-future/library/Zend/Form.php(3009): Zend_Form->render()
#10 /home/cms2rs/www/public/layouts/site/veiculos/custom_views/proposta/form.phtml(3): Zend_Form->__toString()

Zend_Validate_Hostname and new TLD

Hello,
Hostname validator not support a lot of top level domains. In my opinion is so confusing and overloaded. This validator is used also in email validator. I think simpler validator may be is better.
What is your opinion?

P.S. Sorry for my bad English.

Zend_Validate_File_Count PHP 5.x compatibility

Could you please maintain also PHP 5.x compatibility as original Zend1 does?
Fix in Zend_Validate_File_Count broke compatibility, because it uses null coalescing operator available from PHP 7.0.

Just wanted to say thank you

Most of us know that projects like this are a thankless endeavor , just wanted to say thank you as this project has made it so that some of our older applications are able to run on newer, more stable/secure environments!

Invalid required PHP version.

In composer.json we see that lib requires php >= 5.4 version.

    "require": {
        "php": ">=5.4"
    },

But in code I see some features that requires at least PHP 7.1 version:

[$type, $value] = [key($xml), current($xml)];
  1. https://github.com/Shardj/zf1-future/blob/master/library/Zend/XmlRpc/Value.php#L489
  2. https://github.com/Shardj/zf1-future/blob/master/library/Zend/XmlRpc/Value.php#L495

Let's either rewrite code to be compatible with PHP 5.4 or set minimal required version to PHP 7.1

Request Uri problem in controller tests

Hi,

I am currently writing some smoke tests for an old ZF1 application. I encountered a problem with the REQUEST URI generation of ZF. If dispatching an action via Zend_Test_PHPUnit_ControllerTestCase, the URI $_SERVER['REQUEST_URI'] generation is done automatically, which leads to some problems.

The dispatch looks like this:

$url = '/' . $category_slug . '/'. $product_slug;
$this->dispatch($url);

The action is correctly dispatched. But the inspection of $this in the .phtml temaplate shows:
message="Invalid URI supplied".

I digged into ZF1 and found the reason in the library/Zend/Uri/Http.php file:

public function validateHost($host = null)
    {
        if ($host === null) {
            $host = $this->_host;
        }

        // If the host is empty, then it is considered invalid
        if (strlen($host) === 0) {
            return false;
        }

        // Check the host against the allowed values; delegated to Zend_Filter.
        $validate = new Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_ALL);

        return $validate->isValid($host);
    }

The dispatch method sets the Request URI by itself. I already tried setting it manually, but it's overwritten:

// same without scheme
$this->getRequest()->setRequestUri('http://host.domain:port' . $url);

The URI is evaluated, and the empty check triggers.
Passing a complete URI (with host) to dispatch tirggers also: message="Invalid controller specified".

So basically if you evaluate the $_SERVER['REQUEST_URI'] variable in the template (I know, I don't like it either, but it's there, currently), you will always throw in a PHPUnit test.

I spontaniusly see three ways of solving this problem (if it is a problem at all and I am not getting something terribly wrong):

  • adding a PHPUnit flag like the one in Zend_Session to bypass the the URI valid check (but that would dig pretty deep in ZF domain object validation)
  • adding a condition to the dispatch method which considers an already set RequestUri:
// lines 178 - 181
$request    = $this->getRequest();
// a valid URI would be set before calling dispatch
if (null !== $url && null === $request->getRequestUri()) {
    $request->setRequestUri($url);
}
  • adding an optional argument to the dispatch method to supply it with manually set $_SERVER parameters. Default is null (which is checked before setting something) to avoid BC breaks

best regards,
spigandromeda

P.S. it also took me a while to find a working package combination for using PHPUnit at all. Maybe you want to add this somewhere in the documentation:

"require-dev": {
    "phpunit/dbunit": "2.0.3",
    "phpunit/php-invoker": "1.1.4",
     "phpunit/phpunit": "5.3.5"
}

That seems to be the most up-to-date version of PHPUnit working with ZF1 (ZF1 tests are unsing DBUnit tests, which is deprecated since two years or something and this resitrcts the PHPUnit version).

P.P.S I really appreciate your work! I bet there are tons of old projects still running on ZF1 which would starve for the necessary updates to use PHP7 and composer. <3

Zend_View_Helper_HeadScript error where not View

has error "Method Pro_View_Helper_MinifyHeadScript::__toString() must not throw an exception, caught Error: Call to a member function doctype() on null"

if ('defer' === $key && !$this->view->doctype()->isHtml5()) {

if ($this->view->doctype()->isHtml5() && empty($value)) {

if ($this->view->doctype()->isHtml5() && $type === 'text/javascript') {

here correct

if ($this->view) {
$useCdata = $this->view->doctype()->isXhtml() ? true : false;

P.S.: Pro_View_Helper_MinifyHeadScript extend Zend_View_Helper_HeadScript

Zend From File Count Validation

Hey,

I cannot provide any more information at the moment but the issue seems to be pretty straight forward:

'count(): Parameter must be an array or an object that implements Countable' in file '/vendor/shardj/zf1-future/library/Zend/Validate/File/Count.php' on line '257'

Running on PHP 7.3.

Let me know if you need any more info.

Thanks

PHP7.4 bootup issue.

Hi,

Is this fork version of zf1 is only limited to PHP7.3? because i am trying to set it up on PHP7.4 and it's not booting up and it's also not giving any kind of error.
So my question is it possible to run this fork version on PHP7.4 by any means.

zf create project warning PHP7.3 count(): Parameter must be an array or an object

Hi,

can you see this?

PHP Warning: count(): Parameter must be an array or an object that implements Countable in .\zf1-future\library\Zend\Tool\Project\Profile\Resource\Container.php on line 386

I think that count() of boolean will never be an array or an object :)

It would be
return (count($this->_subResources) > 0) ? true : false;
instead of
return (count($this->_subResources > 0)) ? true : false;

isn't it?

Cannot declare class Zend_Loader

Hello!

I'm trying to install your package in an existing Zend Project but after running composer require shardj/zf1-future I'm getting this error:

Fatal error: Cannot declare class Zend_Loader, because the name is already in use in C:\xampp\htdocs\docs\trunk\library\Zend\Loader.php on line 30

Is there any additional configuration that's needed to do in the project?

Thank you very much!

Pg12: Undefined column: 7 ERROR: column d.adsrc does not exist

Cause:
In postgresql 12(deprecated from pg11), it was removed the query field adsrc from table `pg_attrdef``.

Solution:
For resolve the problem you can replace with pg_get_expr(d.adbin, d.adrelid) AS default_value info Zend/DbAdapter/Pdo line 159.

Thanks for your job!
Francesco

Zend_Cache_Frontend_Page

Hello,

Need to test if variable is_array before test it with count. The error:

if (count($var) > 0) {

Uncaught Exception: count(): Parameter must be an array or an object that implements Countable in /vendor/shardj/zf1-future/library/Zend/Cache/Frontend/Page.php:3982.

Stack trace:
#0 vendor/shardj/zf1-future/library/Zend/Cache/Frontend/Page.php(398): RS_Error_Handler::handle()
#1 vendor/shardj/zf1-future/library/Zend/Cache/Frontend/Page.php(346): Zend_Cache_Frontend_Page->_makePartialId()
#2 vendor/shardj/zf1-future/library/Zend/Cache/Frontend/Page.php(264): Zend_Cache_Frontend_Page->_makeId()
#3 application/Bootstrap.php(135): Zend_Cache_Frontend_Page->start()

PHP 7.4 preloading compatibility

When I try preload zend vendor it hangs. I excluded some clases and this works. But only on dev env it looks that it varies by enviroment, probably load order.
Same php config, on docker I excluded:
'Zend_Soap_Client',
'Zend_Soap_AutoDiscover_Exception',
'Zend_EventManager_SharedEventManager',
'Zend_Feed_Writer',
'Zend_Feed',
And it works but when I move to production env it crash on diferent Classes.

Zend\Tool\Project\Provider\DbAdapter.php contains reference to deprecated function get_magic_quotes_gpc()

Zend\Tool\Project\Provider\DbAdapter.php contains a reference to the deprecated function get_magic_quotes_gpc(). Per https://www.php.net/manual/en/function.get-magic-quotes-gpc.php, this method only returned false anyway and is now deprecated as of PHP 7.4 (See https://www.php.net/manual/en/migration74.deprecated.php#migration74.deprecated.core.magic-quotes-functions)

Solution:

Remove the following lines around line # 99 (in _configureViaDSN()):

    // parse_str suffers when magic_quotes is enabled
    if (get_magic_quotes_gpc()) {
        array_walk_recursive($dsnVars, [$this, '_cleanMagicQuotesInValues']);
    }

I can come up with a simple PR if necessary.

Deprecation Notice: Class does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0.

Oops, I forgot about adding these changes earlier :)

The upcoming composer 2.0 will require a stricter matching between class names and filenames.
Current composer version throws these deprecation notices.

Deprecation Notice: Class Zend_Tool_Framework_Provider_DocblockManifestInterface located in ./library/Zend/Tool/Framework/Provider/DocblockManifestable.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Zend_Application_Resource_UserAgent located in ./library/Zend/Application/Resource/Useragent.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Zend_Validate_Barcode_IntelligentMail located in ./library/Zend/Validate/Barcode/Intelligentmail.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Zend_Gdata_Analytics_Goal located in ./library/Zend/Gdata/Analytics/Extension/Goal.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201

[PHP7.0] htmlspecialchars() expects parameter 1 to be string, array given

Cause:

"htmlspecialchars() expects parameter 1 to be string, array given" into
Zend/View/Abstract.php line 905

Solution:
`
if (in_array($this->_escape, array('htmlspecialchars', 'htmlentities'))) {
return call_user_func($this->_escape, "{$var}", ENT_COMPAT, $this->_encoding);
}

    if (1 == func_num_args()) {
        return call_user_func($this->_escape, "{$var}");
    }

`

Documentation Builder Broken

Running the documentation builder no longer works. Could be an issue with the domains embedded within the script? Not sure.

Headers already sent

Hi,
My php version is 7.4.4 and phpunit version is 9.1.0 when i run my test-sut it gives error
ini_set(): Headers already sent. You cannot change the session module's ini settings at this time
vendor/shardj/zf1-future/library/Zend/Session.php:205
vendor/shardj/zf1-future/library/Zend/Session.php:445
No idea how to resolve this.

Controller Plugin Broker tries throwing Error to Exception Class

On lines 263, 298, 312, 336, and 358, the Controller Plugin Broker is catching any \Trowable $e (including Errors) and then tries to re-throw as previous to the Zend_Exception class. If the \Throwable is an Error and not an Exception, PHP complains with a Fatal Error:

Fatal error: Uncaught TypeError: Argument 3 passed to Zend_Exception::__construct() must be an instance of Exception or null, instance of TypeError given, called in /var/www/tiger-vendor/vendor/shardj/zf1-future/library/Zend/Controller/Plugin/Broker.php on line 312 and defined in /var/www/tiger-vendor/vendor/shardj/zf1-future/library/Zend/Exception.php:43

Not exactly sure of the best way to handle this. I can trap and re-throw the error within the Controller Plugin, but this feels more like an architectural issue with PHP 7's use of Errors and ErrorExceptions now being handled like Exceptions. Everyone's thoughts on the issue are welcome.

Checkbox validation

Hi, man.
I've found an issue related to checkbox validation:

class FormCheckboxTest extends Zend_Test_PHPUnit_ControllerTestCase
{

    private $form;

    public function setUp()
    {
        $form = new Zend_Form();

        $element = new Zend_Form_Element_Checkbox("my_checkbox");
        $element->setRequired(true);
        $form->addElement($element);

        $this->form = $form;
    }

    // OK
    public function testChecked()
    {
        $this->form->isValid(["my_checkbox" => '1']);

        $this->assertEquals(
            ["my_checkbox" => []],
            $this->form->getErrors()
        );
    }

    // OK
    public function testUnchecked()
    {
        $this->form->isValid(["my_checkbox" => '0']);

        $this->assertEquals(
            ["my_checkbox" => []],
            $this->form->getErrors()
        );
    }

    // THIS FAILS
    public function testEmpty()
    {
        $this->form->isValid(["my_checkbox" => '']);

        $this->assertEquals(
            ["my_checkbox" => ["isEmpty"]],
            $this->form->getErrors()
        );
    }

    // THIS FAILS
    public function testMissing()
    {
        $this->form->isValid([]);

        $this->assertEquals(
            ["my_checkbox" => ["isEmpty"]],
            $this->form->getErrors()
        );
    }

}

At URL https://stackoverflow.com/questions/6926544/validation-issue-with-zend-checkbox a user suggests to add $element->setUncheckedValue(null); to enforce expected behaviour, but it only changes the problem: instead of the third and fourth tests failing, only the second does.

Thanks in advance!

Francesco

Zend_Config_Yaml broken

3e9b26c#diff-9235a8f0d83484e2adcf78f7ebffe2caL292

This change broke Zend_Config_Yaml because the class was using the internal array pointer to handle the loop's search space with each() and prev(). Since PHP7 foreach no longer respects the internal array pointer, so adding next() in the loop wouldn't help either

I have attempted my best at solving this issue by using array_slice() to handle the loop's search space in https://gist.github.com/blinktag/b2757d9f20177237b21b0270436b6009

It now correctly handles the following yaml:

development:
  maindb:
    default:  true
    host:     data.server.com.local
    username: db_user
    password: -
    dbname:   db_development
    adapter:  pdo_mysql
    profiler:
      enabled: true
      class: Zend_Db_Profiler

However it duplicates maindb's sub-values in the root of the config object, and I haven't been able to figure this part out:

$database_config = new Zend_Config_Yaml('database.yml', APPLICATION_ENV);
dump($database_config);

Zend_Config_Yaml {#17 ▼
  #_skipExtends: false
  #_yamlDecoder: array:2 [▶]
  #_allowModifications: false
  #_index: 0
  #_count: 10
  #_data: array:10 [▼
    "maindb" => Zend_Config {#18 ▼
      #_allowModifications: false
      #_index: 0
      #_count: 9
      #_data: array:9 [▼
        "default" => true
        "host" => "data.server.com.local"
        "username" => "db_user"
        "password" => "-"
        "dbname" => "db_development"
        "adapter" => "pdo_mysql"
        "profiler" => Zend_Config {#20 ▶}
        "enabled" => true
        "class" => "Zend_Db_Profiler"
      ]
      #_skipNextIteration: null
      #_loadedSection: null
      #_extends: []
      #_loadFileErrorStr: null
    }
    "default" => true
    "host" => "data.server.com.local"
    "username" => "db_user"
    "password" => "-"
    "dbname" => "db_development"
    "adapter" => "pdo_mysql"
    "profiler" => Zend_Config {#21 ▶}
    "enabled" => true
    "class" => "Zend_Db_Profiler"
  ]
  #_skipNextIteration: null
  #_loadedSection: "development"
  #_extends: []
  #_loadFileErrorStr: null
}

Perhaps someone with better recursion skills can take a look at this

Alter ISSUE_TEMPLATE

Is it possable to remove/alter the ISSUE_TEMPLATE file as it states EOL for project.

Text Email sending fails with Array to String conversion notice

First of all, thank you so much for supporting PHP7 for this legacy beast!

Today I came across a problem, where I get the following notice:

message: "Array to string conversion"
code: 8
file: "/var/www/html/vendor/shardj/zf1-future/library/Zend/Mime.php"
line: 472
severity: E_NOTICE

when I try to send an email without HTML content - just Text and one attachment.

I had a look around the code and on that line it looks like the str_replace function is used incorrectly.

    /**
     * Converts a string into quoted printable format.
     *
     * @param  string $str
     * @return string
     */
    private static function _encodeQuotedPrintable($str)
    {
        $str = str_replace(
            ['=', self::$qpKeys],
            ['=3D', self::$qpReplaceValues],
            $str);
        
        return rtrim($str);
    }

qpKeys and qpRelaceValues (both arrays) should be spread in order for it to work as expected in future PHP versions.

We could use the spread operator, but since you are aiming min 7.0 support, another means should be used. I will create a PR soon.

Source for Zend_Config XML namespace?

The Zend_Config has it's own XML namespace, which was available at http://framework.zend.com/xml/zend-config-xml/1.0/ (source: Zend_Config_Xml Zend Framework Documentation).

But this XML resource is not available anymore.

And sadly I can't get a copy of it using Wayback Machine because they had a special webpage served (when query was not coming from ZF?): https://github.com/zendframework/zf-web/blob/master/module/PageController/view/page-controller/zend-config-xml-1-0.phtml

Is there:

  1. A copy of this XML somewhere (can't find it on GitHub)?
  2. A place for this XML in the zf1-future repo?

PHPUnit >= 5 compatibility

Hi, man.
Currently only PHPUnit < 5 is supported out-of-the-box.
My VERY DIRTY solution is the following script, executed after each composer install and composer update:

<?php
/**
 * Zend_Test_PHPUnit fix for PHPUnit > 4
 *
 * This fix is required because PHPUnit > 4 uses namespaces.
 *
 * @author Francesco Zanoni
 * @version 2020-01-05
 */

$basePath = realpath(__DIR__ . "/../vendor/shardj/zf1-future/library/Zend/Test/PHPUnit");

// ########################################################################

$filePath = $basePath . "/ControllerTestCase.php";

file_put_contents(
    $filePath,
    str_replace(
        [
            "/** @see Zend_Controller_Front */",
            "require_once 'Zend/Controller/Front.php';",
            "/** @see Zend_Controller_Action_HelperBroker */",
            "require_once 'Zend/Controller/Action/HelperBroker.php';",
            "/** @see Zend_Layout */",
            "require_once 'Zend/Layout.php';",
            "/** @see Zend_Session */",
            "require_once 'Zend/Session.php';",
            "/** @see Zend_Registry */",
            "require_once 'Zend/Registry.php';",
            "require_once 'Zend/Exception.php';",
            "require_once 'Zend/Loader.php';",
            "require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php';",
            "require_once 'Zend/Test/PHPUnit/Constraint/Redirect.php';",
            "require_once 'Zend/Test/PHPUnit/Constraint/ResponseHeader.php';",
            "require_once 'Zend/Controller/Request/HttpTestCase.php';",
            "require_once 'Zend/Dom/Query.php';",
        ],
        '',
        file_get_contents($filePath)
    )
);

file_put_contents(
    $filePath,
    str_replace(
        ' extends PHPUnit_Framework_TestCase',
        ' extends \\PHPUnit\\Framework\\TestCase',
        file_get_contents($filePath)
    )
);

file_put_contents(
    $filePath,
    str_replace(
        ' instanceof PHPUnit_Framework_TestCase',
        ' instanceof \\PHPUnit\\Framework\\TestCase',
        file_get_contents($filePath)
    )
);

file_put_contents(
    $filePath,
    str_replace(
        'PHPUnit_Runner_Version',
        '\\PHPUnit\\Runner\\Version',
        file_get_contents($filePath)
    )
);

file_put_contents(
    $filePath,
    str_replace(
        'new Zend_Test_PHPUnit_Constraint_DomQuery(',
        'new Zend_Test_PHPUnit_Constraint_DomQuery41(',
        file_get_contents($filePath)
    )
);

file_put_contents(
    $filePath,
    str_replace(
        'new Zend_Test_PHPUnit_Constraint_Redirect(',
        'new Zend_Test_PHPUnit_Constraint_Redirect41(',
        file_get_contents($filePath)
    )
);

file_put_contents(
    $filePath,
    str_replace(
        'new Zend_Test_PHPUnit_Constraint_ResponseHeader(',
        'new Zend_Test_PHPUnit_Constraint_ResponseHeader41(',
        file_get_contents($filePath)
    )
);

// ########################################################################

$filePath = $basePath . "/Constraint/DomQuery41.php";

file_put_contents(
    $filePath,
    str_replace(
        'extends PHPUnit_Framework_Constraint',
        'extends \\PHPUnit\\Framework\\Constraint\\Constraint',
        file_get_contents($filePath)
    )
);

// ########################################################################

$filePath = $basePath . "/Constraint/Redirect41.php";

file_put_contents(
    $filePath,
    str_replace(
        'extends PHPUnit_Framework_Constraint',
        'extends \\PHPUnit\\Framework\\Constraint\\Constraint',
        file_get_contents($filePath)
    )
);

// ########################################################################

$filePath = $basePath . "/Constraint/ResponseHeader41.php";

file_put_contents(
    $filePath,
    str_replace(
        'extends PHPUnit_Framework_Constraint',
        'extends \\PHPUnit\\Framework\\Constraint\\Constraint',
        file_get_contents($filePath)
    )
);

// ########################################################################

$filePath = $basePath . "/Constraint/Exception.php";

file_put_contents(
    $filePath,
    str_replace(
        'extends PHPUnit_Framework_ExpectationFailedException',
        'extends \\PHPUnit\\Framework\\ExpectationFailedException',
        file_get_contents($filePath)
    )
);

Couldn't this be achieved in a more elegant and convenient way? Any advice is welcome.

Thanks in advance!

Francesco

Zend_Mail & TLS1.2 - Unable to connect via TLS

I know this isn't an issue with zf1-future exactly but thought I might get some help here.

I have an old app running on an old server that connects to my a mail server that has just dropped support for TLS1.0 and TLS1.1 - TLS1.2 must now be used.

I can connect and send an email via the terminal so I don't think there is a problem with TLS1.2 not being supported on my server, however in php if I dump stream_get_transports() I get:

I've seen a workaround where Zend_Mail_Protocol_Smtp can be modified by changing a line in the helo function to:
if (true !== $enableCrypto = stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT))
but this will only work on php>=5.6.

[0] => string(3) "tcp"
[1] => string(3) "udp"
[2] => string(4) "unix"
[3] => string(3) "udg"
[4] => string(3) "ssl"
[5] => string(5) "sslv3"
[6] => string(3) "tls"

How can I make Zend_Mail use TLS1.2?

My server setup:
Ubuntu 14.04
Apache 2.4.7
PHP 5.5.9
OpenSSL 1.0.1f

Thanks for any feed back.

Tag release

Hi, Could you tag a release, so we can have both the replace PR and the warning fix in switch statement installed?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.