phpmyadmin / phpmyadmin/shapefile
Add a max number of records to load
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 28
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
Hi!
We have a use case where we need to only load the first N records of a file.
It's currently not supported but the change could be minimal.
So in \PhpMyAdmin\ShapeFile\ShapeFile::loadRecords we would need to change
$this->records[] = $record;
to
$this->records[] = $record;
if (count($this->records) >= $this->maxRecords) {
break;
}
$maxRecords could be initialized to a large value or accept int or bool and code would be
$this->records[] = $record;
if ($this->maxRecords && count($this->records) >= $this->maxRecords) {
break;
}
Thoughts?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at \PhpMyAdmin\ShapeFile\ShapeFile::loadRecords and inspect how record loading is exposed and how the maximum should be configured. Define the intended behavior for an unset or disabled limit, then verify that loading stops after the requested number of records without changing unrestricted loading.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100