shardj / zf1-future Goto Github PK
View Code? Open in Web Editor NEWThis project forked from zendframework/zf1
PHP 8.1 compatible version of ZF1
License: BSD 3-Clause "New" or "Revised" License
This project forked from zendframework/zf1
PHP 8.1 compatible version of ZF1
License: BSD 3-Clause "New" or "Revised" License
Zend Framework 1 reaches its End of Life (EOL) and is no longer maintained.
No Pull Requests will be accepted.
Please add this class.
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()
Hi,
Not really a bug but what about the ZendX library that contains some extras. Is there a plan
to propose a php 7.3 compatibility? Or may be nothing incompatible?
https://github.com/zendframework/zf1-extras
Thanks!
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.
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.
$ php -l shardj/zf1-future/library/Zend/Service/WindowsAzure/Storage/Batch.php
PHP Fatal error: Cannot unset $this in shardj/zf1-future/library/Zend/Service/WindowsAzure/Storage/Batch.php on line 108
Errors parsing shardj/zf1-future/library/Zend/Service/WindowsAzure/Storage/Batch.php
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!
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)];
Let's either rewrite code to be compatible with PHP 5.4 or set minimal required version to PHP 7.1
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):
Zend_Session
to bypass the the URI valid check (but that would dig pretty deep in ZF domain object validation)// lines 178 - 181
$request = $this->getRequest();
// a valid URI would be set before calling dispatch
if (null !== $url && null === $request->getRequestUri()) {
$request->setRequestUri($url);
}
$_SERVER
parameters. Default is null
(which is checked before setting something) to avoid BC breaksbest 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
has error "Method Pro_View_Helper_MinifyHeadScript::__toString() must not throw an exception, caught Error: Call to a member function doctype() on null"
here correct
zf1-future/library/Zend/View/Helper/HeadScript.php
Lines 491 to 492 in 7be5e06
P.S.: Pro_View_Helper_MinifyHeadScript extend Zend_View_Helper_HeadScript
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
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.
Merge efforts with zf1s project:
it's code lives in monorepo:
but also code is split to sub-packages to benefit composer install of needed components only.
x-ref:
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?
library/Zend/Controller/Action/Helper/Redirector.php:366
if (!preg_match('|^[a-z]+://|', $url)) {
should be
if (!preg_match('|^[a-z]+://|i', $url)) {
$controller->redirect('HTTP://DOMAIN.COM') is treated as a relative URL and appended to current URL instead of being treated as an absolute
What is minimum PHP Version for release 1.18.3 ? (Great project btw!)
Is there any possibility to implement this patch?
Its MySQL specific so not sure the best way to implement this but thinking just to check the adaptor being used. It will work with mysqli and PDO::MySQL
Is PHP 8 support planned for this repository? I am willing to help support it.
The main changes we need to look out for are listed here: https://stitcher.io/blog/new-in-php-8 under "Breaking changes".
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!
Dear Maintainer,
What a good surprise to find a fork of ZF1 compatible with PHP 7.3.
However, when deploying it in my app, I see the following error:
Deprecated: ini_set(): Use of iconv.internal_encoding is deprecated in /var/www/myapp/library/Zend/Application.php on line 278
May I do something to avoid this?
Thanks
Pierre
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
Hello,
Need to test if variable is_array before test it with count. The error:
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()
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.
Hello,
I have used "Asia Pacific (Mumbai)" region for uploading images but there are error is coming:
InvalidRequest
The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.
0
Can anyone help me?
File Path: https://github.com/Shardj/zf1-future/blob/master/library/Zend/Service/Amazon/S3.php
Approx line: 784
59fa1a8 is needed for php 7.4 compatibility, but is not included in 1.16.0
Could you tag a new release from master?
Zend_Version::getLatest() currently accesses http://framework.zend.com/api/zf-version for the latest ZF1 version.
However, zf1-future has forked the repo and so this is broken. getLatest() is currently reporting v 1.12.0 while zf1-future is presently at 1.17.0
see
and following lines'continue' in switch statements are deprecated:
https://wiki.php.net/rfc/continue_on_switch_deprecation
I think, 'continue' should be changed to 'break' in all case statements in this method.
In PHP 7.3 it shows warnings like
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ...
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.
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
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}");
}
`
Running the documentation builder no longer works. Could be an issue with the domains embedded within the script? Not sure.
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.
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.
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
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
Hello Shardj,
Have you checked Zend F1 version with PHP 7.4 and 7.5 version ?
Is it possable to remove/alter the ISSUE_TEMPLATE file as it states EOL for project.
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.
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:
The existing DOC annotations in many cases are incomplete: e.g. see the linked fetchAll-method, which actually returns array|null and not array as annotated.
Any chance to get those missing types declared (over time)?
Bootstrap fails with error Unable to resolve plugin "useragent"; no corresponding plugin with that name
this error occurs on our system with zf1-future versions > 1.17.2
I suspect d822ef1 being related to the issue (added a comment into that commit as well).
Probably additional change of the autoloader configuration must be done after this diff, related info within readme.md would be helpful.
As described in https://bugs.php.net/bug.php?id=80503
PHP 8 doesn't support "gte' operator for version_compare()
I have found this one triggered only in fpm mode which break several things like Zend_Currency
zf1-future/library/Zend/Xml/Security.php
Line 172 in c84dedf
It's an easy fix, I submit this case for memory / info.
hav a nice day.
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
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.
Hi,
There is a typo when you migrate an "list ... each" to a foreach.
L292 : It should be
foreach ($lines as $n => $line) {
instead of
foreach
($line as $n => $line) {
Hi, Could you tag a release, so we can have both the replace
PR and the warning fix in switch statement installed?
Thanks!
Would it be possible to apply best practices for ZF1 usage by commenting out nearly all require_once calls if the plan is for users to deploy using composer.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.