Download the PHP
package symplify/smart-file-system without Composer
On this page you can find all versions of the php package
symplify/smart-file-system. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor symplify Package smart-file-system Short Description Sanitized FileInfo with safe getRealPath() and other handy methods License
MIT
FAQ
After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.
Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.
In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories.
In this case some credentials are needed to access such packages.
Please use the auth.json textarea to insert credentials, if a package is coming from a private repository.
You can look here for more information.
Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
To use Composer is sometimes complicated. Especially for beginners.
Composer needs much resources. Sometimes they are not available on a simple webspace.
If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
The SplFileInfo::getRealPath() method returns absolute path to the file... or FALSE, if the file doesn't exist. This default PHP behavior forces you to check all getRealPath() calls:
While this has a reason - e.g. to be sure the file was not deleted since the construction,
we actually have to call the method to find out the file was removed. Another annoyance is to tell this to static analyzers.
In reality, it's very rare to work with file that was existing a while ago, but now is gone, without us doing it on purpose. We usually use SplFileInfo to modify files or work with their paths.
What if:
we could remove this problem and make sure getRealPath() method always returns string?
get an exception of non-existing file on SplFileInfo creation?
Introducing SmartFileInfo
This class also bring new useful methods:
It also fixes WTF behavior of Symfony\Component\Finder\SplFileInfo. Which one? When you run e.g. vendor/bin/ecs check src and use Finder, the getRelativeFilePath() in Symfony now returns all the relative paths to src. Which is useless, mainly with multiple dirs like: vendor/bin/ecs check src tests both containing file Post.php.
File name Matching
Last but not least, matching a file comes useful in excluding files (typical for tools like ECS, PHPStan, Psalm, Rector, PHP CS Fixer or PHP_CodeSniffer):
Smart FileSystem - Just like Symfony, just Better
New method - readFile() (to read files):
Sanitizer various files to SmartFileInfo[]
Do you have multiple file inputs that can mix-up?
Later, you wan to actually work with the files:
Use sanitized files, that have united format you can rely on:
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command
The package symplify/smart-file-system contains the following files
Loading the files please wait ....
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.