Skip to content

Composer: Which dependencies should be required? #151

@jkuchar

Description

@jkuchar

Description

Currently in there are dependencies on php extensions with are marked as suggested. This makes sense as not everyone what to use everything from utils package (as it is collection of independent tools).

"suggest": {
	"ext-iconv": "to use Strings::webalize() and toAscii()",
	"ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
	"ext-mbstring": "to use Strings::lower() etc...",
	"ext-xml": "to use Strings::length() etc. when mbstring is not available",

	"ext-json": "to use Nette\\Utils\\Json",

	"ext-gd": "to use Image"
}

I have identified 3 groups of dependencies:

  • Strings related
  • Json related
  • Image related

It happened to me for few times that I have deployed something it passed and then I realized that I forgot to enable json extension. I these extensions are required I would be stopped in installation process, before deploy.

Another thing using Strings class is complex due to 4 extensions that need to properly selected each time someone uses utils. This is so complex that in most my projects there aren't these extensions named in requires as I thought that I'm using nette\utils, they provide Strings class so they will care about dependencies. But they don't.

Goal:

  • I would like to share my confusion
  • I would like to identify "core" functionality and move it's dependencies into requires
  • Or find alternative solution to omit surprises at deploy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions