Giter Site home page Giter Site logo

zf1s / zf1 Goto Github PK

View Code? Open in Web Editor NEW
54.0 8.0 20.0 22.1 MB

Monorepo of a fork of Zend Framework 1, with all components split into individual composer packages. PHP 5.3-8.3 compatible.

License: BSD 3-Clause "New" or "Revised" License

PHP 99.66% Batchfile 0.01% PowerShell 0.01% Shell 0.02% Roff 0.01% HTML 0.30% JavaScript 0.01% Hack 0.01% TSQL 0.01%

zf1's Introduction

Monorepo for zf1s (Zend Framework 1) packages

Build Status

This is a monorepo of a fork of Zend Framework 1, made after it's reached its EOL.

All original framework's components have been split into individual packages, which can be installed separately with composer, e.g.

composer require zf1s/zend-*

where * may be one of: acl, amf, application, auth, barcode, cache, captcha, cloud, codegenerator, config, console-getopt, controller, crypt, currency, date, db, debug, dojo, dom, eventmanager, exception, feed, file, file-transfer, filter, form, gdata, http, json, layout, ldap, loader, locale, log, mail, markup, measure, memory, mime, mobile, navigation, oauth, openid, paginator, pdf, progressbar, queue, reflection, registry, rest, search, search-lucene, serializer, server, service, service-akismet, service-amazon, service-audioscrobbler, service-console, service-delicious, service-ebay, service-flickr, service-livedocx, service-rackspace, service-recaptcha, service-shorturl, service-slideshare, service-strikeiron, service-twitter, service-windowsazure, service-yahoo, session, soap, stdlib, tag, test, text, timesync, tool, translate, uri, validate, version, view, wildfire, xml, xmlrpc.

These packages will be maintained as long as we're using them, mainly just to keep it all working on new versions of PHP as they're released. Currently everything should be compatible with PHP 5.3-8.3. 5.2 support is dropped.

They may also contain some fixes, either for long-standing bugs, which haven't made their way into zf1 official repo before EOL, or newly found ones and (backwards compatible) adjustments (optimisations for composer autoloader mostly). Maybe even one or two new features.

Still, the main purpose is to allow working on legacy projects on more modern systems, while opening the possibility to migrate away from zf1 gradually, one component at a time.

Alternative Installation Method

You may also install the whole framework at once, using composer:

composer require zf1s/zf1

to easy up the transition period, but please keep in mind the recommended approach is to identify and install only the packages you need.

Changelog: here

Original README: click


How to Release

  1. Install symplify/monorepo-builder

    composer create-project symplify/monorepo-builder ../monorepo-builder
  2. Bump interdependencies of packages to the next version

    ../monorepo-builder/bin/monorepo-builder bump-interdependency "^1.15.6"
  3. Add git tag and push to this monorepo

  4. Push to the individual repos

    Note: you may need to cache your credentials otherwise git will ask for them on every operation (and there will be many)

    git config --global credential.helper store

    Split operation:

    ../monorepo-builder/bin/monorepo-builder split --max-processes=1 --tag=1.15.6

Note: I had no success splitting this repo on win os, so unix-based system is recommended. (or WSL) Please also note that monorepo-builder needs a LOT of disk space for the split operation. (I measured 15GB)

zf1's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zf1's Issues

zf1s/zend-ldap doesn't work with PHP8

PHP version: 8.0.14
Reproducible by:

  • Just make a simple search and iterate though the resultset:
//  code for context purposes only 
$options = [ ... ];
$filter = \Zend_Ldap_Filter::equals('objectclass', 'person');
$base = 'OU=test';
$ldap = new \Zend_Ldap();
$ldap->setOptions($options);
$ldap->bind();
$result = $ldap->search($filter, $base, \Zend_Ldap::SEARCH_SCOPE_SUB);
foreach($result as $item) {
...

The above will fail in the foreach with ldap_first_attribute() expects exactly 2 arguments, 3 given error due to https://github.com/zf1s/zend-ldap/blob/6eac2a55a31fe0d1994275c504a0f3de1a915280/library/Zend/Ldap/Collection/Iterator/Default.php#L203

Also, zf1s/zend-ldap uses @ operator in a few places, which won't suppress fatal errors anymore in PHP8: https://www.php.net/releases/8.0/en.php#:~:text=the%20%40%20operator%20no%20longer%20silences%20fatal%20errors.

Session Savehandler DbTable Warning

I am using zf1s 1.13.1 on PHP 7.4.8 and Zend_Session_SaveHandler_DbTable.

I get a warning:

"Warning: session_write_close(): Failed to write session data (user)."

The issue is described here i think:
zendframework/zf1#665

Warning happens if you have 2 requests within a second without change of session data. Then, the modified information is unchanged (same timestamp) and the update call has 0 rows changed, which is not an error in this case.

Possible patch for Zend_Session_SaveHandler_DbTable is:


    public function write($id, $data)
    {
        $data = array($this->_modifiedColumn => time(),
                      $this->_dataColumn     => (string) $data);

        $rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id));

        if (count($rows)) {
            $data[$this->_lifetimeColumn] = $this->_getLifetime($rows->current());
            $this->update($data, $this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE));
        } else {
            $data[$this->_lifetimeColumn] = $this->_lifetime;
            $this->insert(array_merge($this->_getPrimary($id, self::PRIMARY_TYPE_ASSOC), $data));
        }

        return true;
    }

Zend Session would throw an exception "The session has already been started. The session id must be set first." upon receiving an invalid session ID

Long story short,
We monitored a lot of exceptions this morning on our website, all stating "The session has already been started. The session id must be set first."

There are a lot of different reasons why this message can happen.

Our logs indicated that the user ID values were in fact all attempting to break things up, with PHPSESSID cookie having values like:

  • Thread.Sleep(4*1000);
  • C:/winnt/win.ini
  • ${T(java.lang.System).properties}

Etc.

Upon analysis I stumbled on this old issue zendframework/zend-session#119 which helped me to reproduce the issue on my dev. env. locally with a simple curl command like suggested,

curl -I 'http://your-local-website.com/' -H 'Cookie: PHPSESSID=_test_'

I then Xdebug-ed it to realize that Zend doesn't properly account for the situation when session_id is given a rejected ID. In that situation, the SID constant is defined BUT its value is an empty string (at least, on PHP 7.0.33),

session_id() returns the session id for the current session or the empty string ("") if there is no current session

Source: https://www.php.net/manual/en/function.session-id.php

iconv_substr behaves differently under PHP8

While testing out software with PHP8 (8.0.0~rc1-6+ubuntu18.04.1+deb.sury.org+1) I got a TypeError from mktime during basic usage of Zend_Date.

<?php

require_once 'vendor/autoload.php';

$date = new Zend_Date('2020-01-01');
$date->set(0, Zend_Date::TIMES);
echo $date.PHP_EOL;

Resulted in this with PHP8

PHP Fatal error:  Uncaught TypeError: gmmktime(): Argument #2 ($minute) must be of type ?int, string given in /somepath/vendor/zf1s/zend-date/library/Zend/Date/DateObject.php:156
Stack trace:
#0 /somepath/vendor/zf1s/zend-date/library/Zend/Date/DateObject.php(156): gmmktime()
#1 /somepath/vendor/zf1s/zend-date/library/Zend/Date.php(2277): Zend_Date_DateObject->mktime()
#2 /somepath/vendor/zf1s/zend-date/library/Zend/Date.php(1078): Zend_Date->_calculate()
#3 /somepath/zd.php(7): Zend_Date->set()
#4 {main}
  thrown in /somepath/vendor/zf1s/zend-date/library/Zend/Date/DateObject.php on line 156

mktime isn't the culprit in this case though. It turned out that Zend_Locale_Format was acting differently:

<?php

require_once 'vendor/autoload.php';

var_dump(Zend_Locale_Format::getTime(0));

7.4:

array(5) {
  'date_format' =>
  string(9) "h:mm:ss a"
  'locale' =>
  string(5) "en_US"
  'hour' =>
  string(1) "0"
  'minute' =>
  bool(false)
  'second' =>
  bool(false)
}

8.0:

array(5) {
  'date_format' =>
  string(9) "h:mm:ss a"
  'locale' =>
  string(2) "en"
  'hour' =>
  string(1) "0"
  'minute' =>
  string(0) ""
  'second' =>
  string(0) ""
}

As it turns oyt iconv_substr behaviour has been normalized and will now always return an empty string if the offset is out of bounds.

We have 73 usages of iconv_substr excluding tests? What's the best way to tackle this? Write a wrapper function that generates the output of iconv_substr <8.0 and replace all calls to iconv_substr with the wrapper function?

[zend-session] Testing with PhpUnit ini_set error

I am updating a ZF1 app from PHP 5.3 ZF 1.12.20 to PHP 7.4.

I'm using zf1s 1.13.1 on PHP 7.4.8 with PHPUnit 7.5.20 and a Zend_Test_PHPUnit_ControllerTestCase and I'm getting the error

ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

I've taken a closer look. My application is in testing ENV and is testing itself. I have a TestHelper that bootstraps my application in "testing" ENV and a ControllerTestCase class that bootstraps another instance of the application in the setUp method for testing. Bootstraping the second instance fails with the error above.

Here is my setup for the TestHelper which is included for all tests:

...

$application = new Zend_Application(
    'testing',
    APPLICATION_PATH . DIRECTORY_SEPARATOR.'configs'.DIRECTORY_SEPARATOR.'application.ini'
);

Zend_Session::$_unitTestEnabled = true;

$application->bootstrap(); 

The setUp() method in the ControllerTestCase class looks like this:

class ConfigurationTest extends Zend_Test_PHPUnit_ControllerTestCase
{
    public function setUp()
    {
        $this->bootstrap = new Zend_Application(
            'testing',
            APPLICATION_PATH . '/configs/application.ini'
        );

        $someSession = new Zend_Session_Namespace('someSession');
        $someSession->data =  ....

        //more code here

        parent::setUp();  // <-- this will bootstrap the test instance, error is here
    }

Problem is this code in Zend_Session, starting at line 212:


        // set the options the user has requested to set
        foreach ($userOptions as $userOptionName => $userOptionValue) {

            $userOptionName = strtolower($userOptionName);

            // set the ini based values
            if (array_key_exists($userOptionName, self::$_defaultOptions)) {
                ini_set("session.$userOptionName", $userOptionValue); // <-----  error is here
            }

As the session was initiated correctly the first time and is up and running, this here is a possible solution:

Shardj/zf1-future@82a4367#diff-dbc2d7706346875f0cbfb79798dfbfdd

What do you think?

Cross-package dependencies

Hi folks,

I'm working on a project where we're swapping out a copy of Zend Framework 1 on the filesystem for your decomposed packages, piece-by-piece.

A potential issue I've spotted is a few of the packages have references to other packages, which aren't listed as dependencies or suggestions in their respective composer.json.

I've done a bit of rough analysis on this by searching each package's directory for references to Zend_(something) where (something) excludes the package's own name. This does catch comments and instanceof checks, so it's not necessary representative of true dependencies. Some references are also within adapter classes, where it might be more appropriate to list a package as a suggested dependency rather than a direct dependency.

There are a lot of packages, so before digging in and reviewing any further I thought I'd raise an issue and ask your thoughts on this. Do we think this an issue, or are we confident the existing composer.json is suitably configured?

Rough analysis

Summary of search

Package Dependencies in composer Dependencies missing from composer Unknown packages
packages/zend-acl 1 0 0
packages/zend-amf 5 5 0
packages/zend-application 3 14 0
packages/zend-auth 5 2 0
packages/zend-barcode 4 1 2
packages/zend-cache 2 3 0
packages/zend-captcha 5 5 0
packages/zend-cloud 6 0 0
packages/zend-codegenerator 4 0 0
packages/zend-config 2 1 3
packages/zend-console-getopt 0 0 0
packages/zend-controller 10 4 0
packages/zend-crypt 1 0 0
packages/zend-currency 2 3 0
packages/zend-date 2 2 1
packages/zend-db 4 2 0
packages/zend-debug 0 0 0
packages/zend-dojo 6 2 0
packages/zend-dom 2 0 0
packages/zend-eventmanager 2 0 0
packages/zend-exception 0 0 0
packages/zend-feed 6 8 0
packages/zend-file 0 0 0
packages/zend-file-transfer 4 3 1
packages/zend-filter 5 4 1
packages/zend-form 9 5 1
packages/zend-gdata 5 2 3
packages/zend-http 3 3 1
packages/zend-json 3 0 0
packages/zend-layout 5 1 0
packages/zend-ldap 1 3 0
packages/zend-loader 1 1 2
packages/zend-locale 4 1 2
packages/zend-log 2 5 0
packages/zend-mail 4 2 1
packages/zend-markup 4 0 0
packages/zend-measure 3 0 0
packages/zend-memory 2 2 1
packages/zend-mime 1 0 0
packages/zend-mobile 4 0 0
packages/zend-navigation 5 1 0
packages/zend-oauth 5 0 0
packages/zend-openid 4 1 0
packages/zend-paginator 6 3 0
packages/zend-pdf 3 2 0
packages/zend-progressbar 4 1 0
packages/zend-queue 4 2 0
packages/zend-reflection 2 0 0
packages/zend-registry 2 0 0
packages/zend-rest 5 3 0
packages/zend-search 1 0 0
packages/zend-search-lucene 2 0 1
packages/zend-serializer 5 1 0
packages/zend-server 1 0 0
packages/zend-service 2 0 0
packages/zend-service-akismet 4 0 0
packages/zend-service-amazon 4 4 0
packages/zend-service-audioscrobbler 3 0 0
packages/zend-service-console 1 0 0
packages/zend-service-delicious 5 0 0
packages/zend-service-ebay 3 3 0
packages/zend-service-flickr 4 0 0
packages/zend-service-livedocx 4 0 0
packages/zend-service-rackspace 2 1 0
packages/zend-service-recaptcha 3 2 0
packages/zend-service-shorturl 3 1 0
packages/zend-service-slideshare 4 0 0
packages/zend-service-strikeiron 2 0 0
packages/zend-service-twitter 3 2 0
packages/zend-service-windowsazure 3 1 0
packages/zend-service-yahoo 4 1 0
packages/zend-session 4 0 0
packages/zend-soap 4 1 1
packages/zend-stdlib 0 0 0
packages/zend-tag 3 0 0
packages/zend-test 7 3 0
packages/zend-text 2 1 2
packages/zend-timesync 3 1 0
packages/zend-tool 1 2 0
packages/zend-translate 4 3 1
packages/zend-uri 4 1 0
packages/zend-validate 6 6 0
packages/zend-version 0 0 0
packages/zend-view 7 11 1
packages/zend-wildfire 4 0 0
packages/zend-xml 1 0 0
packages/zend-xmlrpc 4 3 1

Search script (bash)

Expand to show script
#!/usr/bin/env bash

# This script will check each Zend package for any references to packages other than itself, and make sure those
# packages are referenced via Composer.json

summary=()

for package in packages/*; do
    printf "| %-30s | %-30s |\n" "$package" "Referenced in composer.json"
    printf "| "
    printf -- "-%.0s" {0..29}
    printf " | "
    printf -- "-%.0s" {0..29}
    printf " |\n"

    unrecognised_packages=()
    listed_as_dependency=0
    not_listed_as_dependency=0
    unrecognised=0

    depends_on=($(ggrep -IroP 'Zend_(?!'"$package"')\w*' "$package" | cut -d':' -f 2 | awk -F'_' '{print tolower($1 FS $2)}' | sort -u | tr '_' '-'))

    for dependency in "${depends_on[@]}"; do
        #ย Make sure each resolved package actually exists
        if [ ! -d packages/"$dependency" ]; then

            # Manually correct zend-console references to zend-console-getopt
            if [ "$dependency" == "zend-console" ]; then
                dependency="zend-console-getopt"
                break
            fi

            unrecognised_packages+=("$dependency")
            continue
        fi

        # If we have found ourselves, skip it
        if [ "packages/$dependency" == "$package" ]; then
            continue
        fi

        # Make sure its included in composer.json
        if grep -q "$dependency" "$package/composer.json"; then
            printf "| %-30s | %-30s |\n" "$dependency" "Yes"
            listed_as_dependency=$((listed_as_dependency + 1))
        else
            printf "| %-30s | %-30s |\n" "$dependency" "**No**"
            not_listed_as_dependency=$((not_listed_as_dependency + 1))
        fi
    done

    for unknown_package in "${unrecognised_packages[@]}"; do
        printf "| %-30s | %-30s |\n" "$unknown_package" "(package does not exist)"
        unrecognised=$((unrecognised + 1))
    done

    summary+=("$(printf '| %-40s | %30d | %40d | %20d |' "$package" "$listed_as_dependency" "$not_listed_as_dependency" "$unrecognised")")

    printf "\n\n"
done

printf "| %-40s | %-30s | %-40s | %-20s |\n" "Package" "Dependencies in composer" "Dependencies missing from composer" "Unknown packages"
printf "| "
printf -- "-%.0s" {0..39}
printf " | "
printf -- "-%.0s" {0..29}
printf " | "
printf -- "-%.0s" {0..39}
printf " | "
printf -- "-%.0s" {0..19}
printf " |\n"

for item in "${summary[@]}"; do
    echo "$item"
done

Full output

Show full output
packages/zend-acl Referenced in composer.json
zend-exception Yes
packages/zend-amf Referenced in composer.json
zend-acl No
zend-auth No
zend-date Yes
zend-db No
zend-exception Yes
zend-loader Yes
zend-reflection No
zend-server Yes
zend-session No
zend-xml Yes
packages/zend-application Referenced in composer.json
zend-cache No
zend-config Yes
zend-controller Yes
zend-db No
zend-dojo No
zend-exception Yes
zend-http No
zend-layout No
zend-loader No
zend-locale No
zend-log No
zend-mail No
zend-navigation No
zend-registry No
zend-session No
zend-translate No
zend-view No
packages/zend-auth Referenced in composer.json
zend-controller No
zend-db Yes
zend-exception Yes
zend-http No
zend-ldap Yes
zend-openid Yes
zend-session Yes
packages/zend-barcode Referenced in composer.json
zend-config Yes
zend-exception Yes
zend-loader No
zend-pdf Yes
zend-validate Yes
zend-image (package does not exist)
zend-renderer (package does not exist)
packages/zend-cache Referenced in composer.json
zend-config No
zend-exception Yes
zend-file No
zend-loader No
zend-log Yes
packages/zend-captcha Referenced in composer.json
zend-config No
zend-crypt Yes
zend-exception Yes
zend-form No
zend-loader No
zend-service Yes
zend-session No
zend-text Yes
zend-validate Yes
zend-view No
packages/zend-cloud Referenced in composer.json
zend-config Yes
zend-exception Yes
zend-http Yes
zend-loader Yes
zend-queue Yes
zend-service Yes
packages/zend-codegenerator Referenced in composer.json
zend-config Yes
zend-exception Yes
zend-loader Yes
zend-reflection Yes
packages/zend-config Referenced in composer.json
zend-exception Yes
zend-json No
zend-xml Yes
zend-configs (package does not exist)
zend-package (package does not exist)
zend-yaml (package does not exist)
packages/zend-console-getopt Referenced in composer.json
packages/zend-controller Referenced in composer.json
zend-cache No
zend-config Yes
zend-dojo Yes
zend-exception Yes
zend-filter Yes
zend-json Yes
zend-layout Yes
zend-loader Yes
zend-locale No
zend-registry Yes
zend-session No
zend-translate No
zend-uri Yes
zend-view Yes
packages/zend-crypt Referenced in composer.json
zend-exception Yes
packages/zend-currency Referenced in composer.json
zend-cache No
zend-exception Yes
zend-loader No
zend-locale Yes
zend-service No
packages/zend-date Referenced in composer.json
zend-cache No
zend-exception Yes
zend-locale Yes
zend-timesync No
zend-dateobject (package does not exist)
packages/zend-db Referenced in composer.json
zend-cache No
zend-config No
zend-exception Yes
zend-loader Yes
zend-registry Yes
zend-wildfire Yes
packages/zend-debug Referenced in composer.json
packages/zend-dojo Referenced in composer.json
zend-config No
zend-exception Yes
zend-filter Yes
zend-form Yes
zend-json Yes
zend-loader No
zend-registry Yes
zend-view Yes
packages/zend-dom Referenced in composer.json
zend-exception Yes
zend-xml Yes
packages/zend-eventmanager Referenced in composer.json
zend-exception Yes
zend-stdlib Yes
packages/zend-exception Referenced in composer.json
packages/zend-feed Referenced in composer.json
zend-cache No
zend-config No
zend-controller No
zend-date No
zend-db No
zend-exception Yes
zend-http Yes
zend-loader Yes
zend-oauth No
zend-registry No
zend-uri Yes
zend-validate No
zend-version Yes
zend-xml Yes
packages/zend-file Referenced in composer.json
packages/zend-file-transfer Referenced in composer.json
zend-exception Yes
zend-file Yes
zend-filter No
zend-loader Yes
zend-progressbar No
zend-translate No
zend-validate Yes
zend- (package does not exist)
packages/zend-filter Referenced in composer.json
zend-config No
zend-crypt Yes
zend-date No
zend-exception Yes
zend-loader Yes
zend-locale Yes
zend-registry No
zend-translate No
zend-validate Yes
zend- (package does not exist)
packages/zend-form Referenced in composer.json
zend-captcha Yes
zend-config No
zend-controller Yes
zend-crypt No
zend-exception Yes
zend-file No
zend-filter Yes
zend-json Yes
zend-loader Yes
zend-registry Yes
zend-session Yes
zend-translate No
zend-validate Yes
zend-view No
zend- (package does not exist)
packages/zend-gdata Referenced in composer.json
zend-crypt No
zend-exception Yes
zend-http Yes
zend-loader Yes
zend-uri No
zend-version Yes
zend-xml Yes
zend-calendar (package does not exist)
zend-extension (package does not exist)
zend-framework (package does not exist)
packages/zend-http Referenced in composer.json
zend-config No
zend-date No
zend-exception Yes
zend-loader Yes
zend-session No
zend-uri Yes
zend-browser (package does not exist)
packages/zend-json Referenced in composer.json
zend-exception Yes
zend-server Yes
zend-xml Yes
packages/zend-layout Referenced in composer.json
zend-config No
zend-controller Yes
zend-exception Yes
zend-filter Yes
zend-loader Yes
zend-view Yes
packages/zend-ldap Referenced in composer.json
zend-config No
zend-crypt No
zend-date No
zend-exception Yes
packages/zend-loader Referenced in composer.json
zend-config No
zend-exception Yes
zend- (package does not exist)
zend-example (package does not exist)
packages/zend-locale Referenced in composer.json
zend-cache Yes
zend-date No
zend-exception Yes
zend-registry Yes
zend-xml Yes
zend-localec (package does not exist)
zend-localel (package does not exist)
packages/zend-log Referenced in composer.json
zend-config No
zend-db No
zend-exception Yes
zend-layout No
zend-loader No
zend-mail No
zend-wildfire Yes
packages/zend-mail Referenced in composer.json
zend-config No
zend-date No
zend-exception Yes
zend-loader Yes
zend-mime Yes
zend-validate Yes
zend-transport (package does not exist)
packages/zend-markup Referenced in composer.json
zend-config Yes
zend-exception Yes
zend-filter Yes
zend-loader Yes
packages/zend-measure Referenced in composer.json
zend-exception Yes
zend-locale Yes
zend-registry Yes
packages/zend-memory Referenced in composer.json
zend-cache Yes
zend-controller No
zend-exception Yes
zend-loader No
zend-memoryexception (package does not exist)
packages/zend-mime Referenced in composer.json
zend-exception Yes
packages/zend-mobile Referenced in composer.json
zend-exception Yes
zend-http Yes
zend-uri Yes
zend-xml Yes
packages/zend-navigation Referenced in composer.json
zend-acl Yes
zend-config Yes
zend-controller Yes
zend-exception Yes
zend-loader No
zend-view Yes
packages/zend-oauth Referenced in composer.json
zend-config Yes
zend-crypt Yes
zend-exception Yes
zend-http Yes
zend-uri Yes
packages/zend-openid Referenced in composer.json
zend-controller Yes
zend-crypt No
zend-exception Yes
zend-http Yes
zend-session Yes
packages/zend-paginator Referenced in composer.json
zend-cache No
zend-config No
zend-controller Yes
zend-db Yes
zend-exception Yes
zend-filter No
zend-json Yes
zend-loader Yes
zend-view Yes
packages/zend-pdf Referenced in composer.json
zend-config No
zend-exception Yes
zend-log Yes
zend-memory Yes
zend-mime No
packages/zend-progressbar Referenced in composer.json
zend-config Yes
zend-exception Yes
zend-json Yes
zend-session Yes
zend-text No
packages/zend-queue Referenced in composer.json
zend-cache No
zend-config Yes
zend-db Yes
zend-exception Yes
zend-loader Yes
zend-log No
packages/zend-reflection Referenced in composer.json
zend-exception Yes
zend-loader Yes
packages/zend-registry Referenced in composer.json
zend-exception Yes
zend-loader Yes
packages/zend-rest Referenced in composer.json
zend-config No
zend-controller No
zend-exception Yes
zend-http No
zend-server Yes
zend-service Yes
zend-uri Yes
zend-xml Yes
packages/zend-search Referenced in composer.json
zend-exception Yes
packages/zend-search-lucene Referenced in composer.json
zend-search Yes
zend-xml Yes
zend-environment (package does not exist)
packages/zend-serializer Referenced in composer.json
zend-amf Yes
zend-config No
zend-exception Yes
zend-json Yes
zend-loader Yes
zend-xml Yes
packages/zend-server Referenced in composer.json
zend-exception Yes
packages/zend-service Referenced in composer.json
zend-exception Yes
zend-http Yes
packages/zend-service-akismet Referenced in composer.json
zend-http Yes
zend-service Yes
zend-uri Yes
zend-version Yes
packages/zend-service-amazon Referenced in composer.json
zend-crypt No
zend-http Yes
zend-json No
zend-loader No
zend-rest Yes
zend-service Yes
zend-uri No
zend-xml Yes
packages/zend-service-audioscrobbler Referenced in composer.json
zend-http Yes
zend-service Yes
zend-xml Yes
packages/zend-service-console Referenced in composer.json
zend-service Yes
packages/zend-service-delicious Referenced in composer.json
zend-date Yes
zend-json Yes
zend-rest Yes
zend-service Yes
zend-xml Yes
packages/zend-service-ebay Referenced in composer.json
zend-config No
zend-date No
zend-http No
zend-rest Yes
zend-service Yes
zend-xml Yes
packages/zend-service-flickr Referenced in composer.json
zend-rest Yes
zend-service Yes
zend-validate Yes
zend-xml Yes
packages/zend-service-livedocx Referenced in composer.json
zend-config Yes
zend-date Yes
zend-service Yes
zend-soap Yes
packages/zend-service-rackspace Referenced in composer.json
zend-http No
zend-service Yes
zend-validate Yes
packages/zend-service-recaptcha Referenced in composer.json
zend-config No
zend-http Yes
zend-json Yes
zend-service Yes
zend-validate No
packages/zend-service-shorturl Referenced in composer.json
zend-dom Yes
zend-http No
zend-service Yes
zend-uri Yes
packages/zend-service-slideshare Referenced in composer.json
zend-cache Yes
zend-http Yes
zend-service Yes
zend-xml Yes
packages/zend-service-strikeiron Referenced in composer.json
zend-loader Yes
zend-service Yes
packages/zend-service-twitter Referenced in composer.json
zend-config No
zend-http Yes
zend-json Yes
zend-oauth No
zend-service Yes
packages/zend-service-windowsazure Referenced in composer.json
zend-http No
zend-log Yes
zend-service Yes
zend-xml Yes
packages/zend-service-yahoo Referenced in composer.json
zend-rest Yes
zend-service Yes
zend-uri No
zend-validate Yes
zend-xml Yes
packages/zend-session Referenced in composer.json
zend-config Yes
zend-db Yes
zend-exception Yes
zend-loader Yes
packages/zend-soap Referenced in composer.json
zend-config No
zend-exception Yes
zend-server Yes
zend-uri Yes
zend-xml Yes
zend-soapclient (package does not exist)
packages/zend-stdlib Referenced in composer.json
packages/zend-tag Referenced in composer.json
zend-config Yes
zend-exception Yes
zend-loader Yes
packages/zend-test Referenced in composer.json
zend-application No
zend-controller Yes
zend-db No
zend-dom Yes
zend-exception Yes
zend-filter No
zend-layout Yes
zend-loader Yes
zend-registry Yes
zend-session Yes
packages/zend-text Referenced in composer.json
zend-config No
zend-exception Yes
zend-loader Yes
zend-figlet (package does not exist)
zend-zext (package does not exist)
packages/zend-timesync Referenced in composer.json
zend-date Yes
zend-exception Yes
zend-loader Yes
zend-locale No
packages/zend-tool Referenced in composer.json
zend-application No
zend-codegenerator No
zend-config Yes
packages/zend-translate Referenced in composer.json
zend-cache No
zend-config No
zend-exception Yes
zend-loader Yes
zend-locale Yes
zend-log No
zend-xml Yes
zend-translation (package does not exist)
packages/zend-uri Referenced in composer.json
zend-config No
zend-exception Yes
zend-filter Yes
zend-loader Yes
zend-validate Yes
packages/zend-validate Referenced in composer.json
zend-config No
zend-date Yes
zend-db No
zend-exception Yes
zend-file No
zend-filter Yes
zend-ldap No
zend-loader Yes
zend-locale Yes
zend-registry Yes
zend-translate No
zend-uri No
packages/zend-version Referenced in composer.json
packages/zend-view Referenced in composer.json
zend-acl No
zend-config No
zend-controller Yes
zend-currency No
zend-exception Yes
zend-filter No
zend-form No
zend-http No
zend-json Yes
zend-layout Yes
zend-loader Yes
zend-locale Yes
zend-navigation No
zend-paginator No
zend-registry Yes
zend-translate No
zend-uri No
zend-validate No
zend-navigaiton (package does not exist)
packages/zend-wildfire Referenced in composer.json
zend-controller Yes
zend-exception Yes
zend-json Yes
zend-loader Yes
packages/zend-xml Referenced in composer.json
zend-exception Yes
packages/zend-xmlrpc Referenced in composer.json
zend-controller No
zend-crypt No
zend-date No
zend-exception Yes
zend-http Yes
zend-server Yes
zend-xml Yes
zend-xmlrpcserver (package does not exist)

Zend_Session_SaveHandler_DbTable causes a warning under PHP 7 when the row is unchanged

Source: zendframework/zf1#665

We are migrating a project from PHP 5.6 to 7.4 and we encountered this problem using zf1s.

The important part to understand is this,

The problem is, at least for the Mysqli driver, a row isn't "affected" by a statement if it's UPDATE'd with the exact same data already stored in that row. This doesn't happen too often because the save handler saves the modified time with the row, so that timestamp and thus the row changes every second.

So basically, we have a view with a couple of ajax calls and sometimes they generate a warning because the session didn't change (same second, same content).

Anyways, I saw that zf1-future implemented a simple fix for this, see Shardj/zf1-future@9175301

Basically the workaround proposed by virtually everyone in the community is to inherit the class and force a return true - see zendframework/zf1#654 (comment).

I think it would be handy for zf1s to support / fix this scenario instead.

Resolve or suppress PHP 8.1 deprecation notices

After upgrading to PHP 8.1, some deprecation notices are generated, for example:

PHP Deprecated: Return type of Zend_Controller_Action_Helper_FlashMessenger::count($namespace = null) should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../library/Zend/Controller/Action/Helper/FlashMessenger.php:290
PHP Deprecated: Return type of Zend_Controller_Action_Helper_FlashMessenger::getIterator($namespace = null) should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../library/Zend/Controller/Action/Helper/FlashMessenger.php:272
PHP Deprecated: Return type of Zend_Form::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../vendor/zf1s/zend-form/library/Zend/Form.php:3342
PHP Deprecated: Return type of Zend_Form::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../vendor/zf1s/zend-form/library/Zend/Form.php:3275
PHP Deprecated: Return type of Zend_Form::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../vendor/zf1s/zend-form/library/Zend/Form.php:3298
PHP Deprecated: Return type of Zend_Form::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../vendor/zf1s/zend-form/library/Zend/Form.php:3309
PHP Deprecated: Return type of Zend_Form::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../vendor/zf1s/zend-form/library/Zend/Form.php:3320
PHP Deprecated: Return type of Zend_Form::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../vendor/zf1s/zend-form/library/Zend/Form.php:3331
PHP Deprecated: Return type of Zend_Markup_TokenList::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zf1s/zend-markup/library/Zend/Markup/TokenList.php:48
PHP Deprecated: Return type of Zend_Markup_TokenList::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zf1s/zend-markup/library/Zend/Markup/TokenList.php:58
PHP Deprecated: Return type of Zend_Markup_TokenList::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zf1s/zend-markup/library/Zend/Markup/TokenList.php:80
PHP Deprecated: Return type of Zend_Markup_TokenList::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zf1s/zend-markup/library/Zend/Markup/TokenList.php:90
PHP Deprecated: Return type of Zend_Markup_TokenList::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zf1s/zend-markup/library/Zend/Markup/TokenList.php:100
PHP Deprecated: Return type of Zend_Markup_TokenList::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zf1s/zend-markup/library/Zend/Markup/TokenList.php:110
PHP Deprecated: Return type of Zend_Markup_TokenList::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zf1s/zend-markup/library/Zend/Markup/TokenList.php:120
PHP Deprecated: Return type of Zend_Navigation_Container::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zend-navigation/library/Zend/Navigation/Container.php:619
PHP Deprecated: Return type of Zend_Navigation_Container::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zend-navigation/library/Zend/Navigation/Container.php:512
PHP Deprecated: Return type of Zend_Navigation_Container::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zend-navigation/library/Zend/Navigation/Container.php:599
PHP Deprecated: Return type of Zend_Navigation_Container::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zend-navigation/library/Zend/Navigation/Container.php:587
PHP Deprecated: Return type of Zend_Navigation_Container::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zend-navigation/library/Zend/Navigation/Container.php:535
PHP Deprecated: Return type of Zend_Navigation_Container::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zend-navigation/library/Zend/Navigation/Container.php:548
PHP Deprecated: Return type of Zend_Navigation_Container::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zend-navigation/library/Zend/Navigation/Container.php:561
PHP Deprecated: Return type of Zend_Navigation_Container::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zend-navigation/library/Zend/Navigation/Container.php:574
PHP Deprecated: Return type of Zend_Session_Namespace::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../zf1s/zend-session/library/Zend/Session/Namespace.php:210

Such messages can be expected when running an old/ancient code-base like Zend Framework 1 on a new version of PHP and is not a problem.

It does however pollute the server logs a bit.

As suggested by the messages:

  1. we could make the function signatures compatible: this would require bumping the required PHP version in composer.json for all involved packages which might be a step to far
  2. the #[\ReturnTypeWillChange] attribute could be used to temporarily suppress the notice. On lower PHP versions this would be regarded as a comment, so this is quite safe to do, also see: https://php.watch/versions/8.1/ReturnTypeWillChange

Now my question: what would be the preferred approach? We could start with adding the #[\ReturnTypeWillChange] attribute, would a PR be accepted?

1.13.1 broken with --no-dev and plugin autoloader

The new Zend_Loader_PluginLoader fails to load as line

    'Zend_Loader' => array($vendorDir . '/zf1s/zend-loader/library'),

goes missing from vendor/composer/autoload_namespaces.php when composer install --no-dev

    /**
     * Retrieve PluginLoader
     *
     * @return Zend_Loader_PluginLoader
     */
    public static function getPluginLoader()
    {
        if (null === self::$_pluginLoader) {
            // require_once 'Zend/Loader/PluginLoader.php';
            self::$_pluginLoader = new Zend_Loader_PluginLoader(array(
                'Zend_Controller_Action_Helper' => 'Zend/Controller/Action/Helper/',
            ));
        }
        return self::$_pluginLoader;
    }

Zend_Translate issues 'failed to open stream' warning when using a custom adapter

Issue is on line 130 of class Zend_Translate, the 'class_exists' function is attempting to autoload a custom adapter as a 'Zend_Translate_Adapter_' and issues a warning when it is not found:

PHP Warning: include_once(Zend/Translate/Adapter/Custom/Translate/Adapter.php): failed to open stream: No such file or directory in /var/www/comm-os/vendor/zf1s/zend-loader/library/Zend/Loader.php on line 134

Requires the 'autoload' parameter of the class_exists function to be set to false.

Zend_Locale doesn't seem to be a necessary dep of Zend_View

Zend_Locale is listed as a dep of Zend_View, but that only applies when using either the Translate or Currency view helpers.

Maybe because of this, it would be ok to move it to suggest? It sound unlikely that projects which need these helpers don't install either Zend_Locale directly or Zend_Tranlate (which it is a dep of).

(FWIW: I'm trying to migrate a project of of ZF1 on dep at a time and these inter-dependencies make it a bit of a challenge)

During launch of a new version, composer can pull in dev-master

Just noticed this during the push out of 1.13.4.

If you have "minimum-stability": "dev", in an app composer.json, then when some of the zf1s/zend-* packages have been released but others haven't you can pull in dev-master.

I think this is a combination of the branch alias in each package (1.x-dev to dev-master) and the fact that when there is a release, all requirements get bumped to ^1.13.4.

As an example, https://github.com/zf1s/zend-xml/blob/master/composer.json requires "zf1s/zend-exception": "^1.13.4" but if only 1.13.3 is visible in packagist, it picks dev-master instead.

I know this is an edge case, but it isn't ideal. I can see a couple of potential solutions:

  1. Have interdependencies as "^1.13" unless there is a cascading bug that needs to be fixed in two places at once.
    or
  2. Only bump the versions on the packages that actually change.

I am assuming the second would be a pretty painful change to process.

[zend-loader] Class 'Zend_Loader_PluginLoader' not found

so, i've got another project which is broken with zf1s:

zf1s/zend-loader          1.12.22 Zend Framework 1 Loader package
PHP Stack trace:
PHP   1. {main}() bin/reports.php:0
...
PHP   6. Zend_View_Abstract->__construct() lib/Smarty.php:7
PHP   7. Zend_View_Abstract->setFilterPath() vendor/zf1s/zend-view/library/Zend/View/Abstract.php:153
PHP   8. Zend_View_Abstract->addFilterPath() vendor/zf1s/zend-view/library/Zend/View/Abstract.php:661
PHP   9. Zend_View_Abstract->_addPluginPath() vendor/zf1s/zend-view/library/Zend/View/Abstract.php:645
PHP  10. Zend_View_Abstract->getPluginLoader() vendor/zf1s/zend-view/library/Zend/View/Abstract.php:1133

but I think it worked with zf1/zend-loader.

may be related with these:

unnecessary Zend_Uri dependencies

Zend_Uri lists these deps which have no mention in the code:

  • Zend_Locale
  • Zend_Validate

Can I send a PR to remove those? Or, alternatively, put them in the suggest section?

PHP 8.0 porting status

List of documented backward-incompatible changes:

Tasks

  • PHP 8.0 compatibility patch: #32
    • Fix a bug in Zend_Date for PHP 8.0 #62
    • Missing default values caused errorHandlerIgnore to fail under PHP 8.0, #63
    • Guard file_exists call to prevent fatal error, #64
    • Remove libxml deprecations for php 8.0, #65
    • Do not pass &$parts as reference to resolvePharParentPath, #67
    • Ensure non-negative values for bcmath, #68
    • Add support for gd resource type change in php 8.0, #69
    • Add guard on fclose in Zend_Mail_Storage_Mbox, #70
    • Implement T_NAME_QUALIFIED token in ClassFileLocation for php 8.0, #71
    • Remove openssl deprecation for php 8.0, #73
    • php 8.0: Change call in ClassMapAutoloader to preserve original behaviour, #74
    • Make Zend_Validate_Date work as expected under PHP 8.0, #75
    • Fixed reflection deprecations for php 8.0, #76
    • Small fixes for tests in favor of PHP 8.0 compat, #77
    • Remove default values from method signatures, #78
    • Fix vsprintf TypeError for php 8.0, #79
    • Enforce types for PHP 8.0, #80
    • Fix Zend_Form_ElementTest, #81
    • Fix iterators usage, #82
    • DB2 constants are missing when setting up db factory, #83
    • Catch ValueError on PHP 8.0 for Pdo Statement #85
  • Remove usage of $php_errormsg: #35, #42
  • version_compare does not support gte: #51 (comment), #26
  • iconv_substr behaves differently under PHP 8: #31
  • Zend_Log: catch TypeError/ValueError for PHP 8.0, #88
  • Fix error handler for PHP8 usage #99
  • Fix Zend_Db issues with php8 #106
  • php8 Zend_Log compatibility fixes #107
  • [zend-paginator] prevent fatal error on php8 #109
  • [zend-queue] prevent TypeError on md5 of non-string message #110
  • [zend-loader] refactor broken resolvePharParentPath static method #111

[zend-file-transfer]: unable to load adapters

given code:

<?php
require __DIR__ . '/vendor/autoload.php';
$file = new Zend_File_Transfer();

with zf1s/zend-file-transfer installed, i get error:

PHP Fatal error:  Uncaught Error: Class 'Zend_Loader' not found in vendor/zf1s/zend-file-transfer/library/Zend/File/Transfer.php:67
Stack trace:
#0 vendor/zf1s/zend-file-transfer/library/Zend/File/Transfer.php(54): Zend_File_Transfer->setAdapter('Http', false, Array)
#1 test.php(5): Zend_File_Transfer->__construct()
#2 {main}
  thrown in vendor/zf1s/zend-file-transfer/library/Zend/File/Transfer.php on line 67

loading "zf1s/zend-loader", the error changes to:

PHP Warning:  include_once(Http.php): failed to open stream: No such file or directory in vendor/zf1s/zend-loader/library/Zend/Loader.php on line 134
PHP Stack trace:
PHP   1. {main}() test.php:0
PHP   2. Zend_File_Transfer->__construct() test.php:5
PHP   3. Zend_File_Transfer->setAdapter() vendor/zf1s/zend-file-transfer/library/Zend/File/Transfer.php:54
PHP   4. Zend_Loader::loadClass() vendor/zf1s/zend-file-transfer/library/Zend/File/Transfer.php:72
PHP   5. Zend_Loader::loadFile() vendor/zf1s/zend-loader/library/Zend/Loader.php:82

I've created gist to play around with:
https://gist.github.com/glensc/ce6a301ddc60a0d1dba8878ae32709c3

with git tags v1 and v2 respectively for the tests.

publish monorepo composer package

It seems that zf1s/zf1 is not registered on packagist.org:

$ composer require zf1s/zf1
  [InvalidArgumentException]
  Could not find a matching version of package zf1s/zf1. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).

This would help people installing "full zf1":

project readme must be also updated, when this installation method works.

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.