Comments (10)
@PowerKiKi So. #75 May be closed?
from phpspreadsheet.
@MarkBaker as I am sure you are aware PSR-16 Simple Cache is about to be published. I was wondering if that would make sense for PhpSpreadsheet to rely on that standard, instead of re-implementing so many adapter ourselves. What do you think ?
Also I noticed that igbinary is implemented as a cache itself, whereas I would think it's only a required step for every kind of cache. I mean we should be able to use, eg, memcache+igbinary, or sqlite+igbinary.
from phpspreadsheet.
@PowerKiKi PSR-16 is not yet published as i know. If phpSpreadsheets 1.0 release is coming soon - it isn't nessesary to do this refactor right now. We can still use adapters.
from phpspreadsheet.
Actually PSR-16 was accepted 3 weeks ago. While it clearly still is a very young PSR, I feel it fits exactly our need. And PhpSpreadsheet is not quite ready for a release anyway. So I'd really like to consider this option.
from phpspreadsheet.
PSR-16 looks to young to me. InvalidArgumentException
is not an interface in SPL,, it is a class: http://php.net/manual/en/class.invalidargumentexception.php Well, I know, not the right place here. But you should reconsider taking it as it may break more things (because of naming conflicts with well-establisched code like the SPL is) as it solves.
from phpspreadsheet.
Are you saying you think \Psr\SimpleCache\InvalidArgumentException
from PSR-16 may conflict with \InvalidArgumentException
from SPL ? If that's so, I don't think there any issue since PSR-16 is properly namespaced.
Did you have other argument that would show why it's too early ? or what kind of improvement you would expect to make it a suitable choice ?
from phpspreadsheet.
Well, if PSR has never heard of well-established naming conventions (like the Java naming convention is), then have it their way. Think of, why PHP is getting finger-pointed, because not because of PHP itself is bad but the people doing stuff around it are bad.
Yes, and it conflicts, if you only see InvalidArgumentException
(the class name itself without namespace), you will mostly think about the SPL class as this name hints it But you will never think of that it is an interface. That is why well-established naming conventions exists like the Java naming convention.
That is why I was very happy with the naming scheme in PhpExcel
and not here in PhpSpreadsheet
. Currently, I keep aliasing them so in source code I can simply see that they are from PhpSpreadsheet
and not generic (SPL).
Causing lesser confusion is better for everyone. Newbies can get easily into the code. And don't think of ignoring use
(some kind of "import" as the other class/interface is being imported into the current namespace), it has it's reasons of not having everywhere a namespace around.
from phpspreadsheet.
You seem to be arguing against namespace as they exists in PHP. While it may be an interesting debate, it's a much bigger topic and out of place here.
So far I didn't see any practical argument in favor or against PSR-16.
from phpspreadsheet.
No, I recommend them in addition to better class names. :-) But okay, getting "a little" OT.
from phpspreadsheet.
So after a some analysis, here is my approximate plan for the refactoring:
Class | Plan |
---|---|
CacheBase | refactored as wrapper Cells around a PSR-16 instance, with PhpSpreadsheet specifics |
Memory | kept, the only implementation that actually lives in PhpSpreadsheet |
APC | PSR-16 via php-cache.com (and APCu) |
Memcache | PSR-16 via php-cache.com |
SQLite3 | PSR-16 via php-cache.com |
Wincache | PSR-16 via php-cache.com |
ICache | dropped, it's essentially PSR-16 |
DiscISAM | dropped, planned in php-cache.com |
PHPTemp | dropped, future implementation possible in php-cache.com |
Igbinary | dropped, PSR-16 works with objects directly and is responsible for serialization |
MemoryGZip | dropped, IMHO this is a half-baked solution, should use a real cache to really free up memory |
MemorySerialized | dropped, IMHO this is a half-baked solution, should use a real cache to really free up memory |
Classes marked as dropped do not mean that the feature will be gone forever. It just means that there will be no solution out of the box as far as I know. But it is possible for a third-party to re-implement those, either via php-cache project, or as a standalone PSR-16 implementation.
By adopting PSR-16 we automatically get new cache supported, such as memcached, redis, mongodb amongst others (~50 projects using PSR-16 so far). It will also drastically simplify our codebase. Making it easier to test and delegating cache implementation to third-parties so we can focus on our core features.
@MarkBaker, would you have any opinion to share about this plan ?
from phpspreadsheet.
Related Issues (20)
- Xml::loadSpreadsheetFromString() tries to open file when using falsy argument
- XML-Readers: Border Specification
- XML-Reader: support rich text HOT 1
- XML-Reader: interpret zoom
- PhpSpreadsheet can't retrieve images placed inside cell HOT 2
- Feature request: functionality to detect and read sheet tables and related styles HOT 6
- HTML export ignores setSize / getColor cell formats HOT 5
- v2.0.0 data corruption in non-UTF-8 apps as a result of dependency voku/portable-utf8 autoloader setting default_charset and mb_internal_encoding to "UTF-8" HOT 2
- Incorrect reader used for CSV files with BOM HOT 1
- The way to Protect only a particular cell is not working. How do i lock a particular row or column HOT 1
- Image can#t be inserted inside Cell, the same way as the newest Excel sheet or google sheet HOT 4
- Cannot read csv files that contain '<a href=' and do not have the extension ‘.csv’ ‘.tsv’.
- Textboxes, shape are not visible when using mergefields in file that contains image (Excel) HOT 1
- Conditional styles comming separates, even though two of them are one conditional style when you open the sheet HOT 1
- Conditional styles comming separates, even though two of them are one conditional style when you open the sheet HOT 2
- Assistance Needed with Editing XLSX Files Using PHPSpreadsheet
- Cannot open XLSX file HOT 1
- add custome sheet fonctions HOT 1
- Conditional styling doesnt support color scale with number or percentage HOT 1
- invalid range when save xlsx file php HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpspreadsheet.