Safe
All PHP functions, rewritten to throw exceptions instead of returning false (by thecodingmachine)
Symfony Dotenv
Registers environment variables from a .env file (by symfony)
Our great sponsors
Safe | Symfony Dotenv | |
---|---|---|
7 | 5 | |
2,305 | 3,689 | |
0.8% | 0.4% | |
0.6 | 5.7 | |
1 day ago | about 1 hour ago | |
PHP | PHP | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Safe
Posts with mentions or reviews of Safe.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-10-18.
-
PHP libraries and tools
thecodingmachine/safe: All PHP functions, rewritten to throw exceptions instead of returning false
-
Oh boy here we go again…
There are workarounds with some third party libraries, but yeah, it's a pain.
- Which inconsistences of PHP annoy you the most?
-
Any ideas about why json_encode would return empty for a request on local dev, but not empty on server?
- try not to use the built-in json_encode, as it doesnt have proper error handling. Use instead this: https://github.com/thecodingmachine/safe and Safe\json_encode()
-
Native defer & errdefer
Not what you asked for, in modern codebases it's advised to use things like https://github.com/thecodingmachine/safe
-
Use namespaced functions to replace native functions - github.com/rezen/proxyz
The goal of https://github.com/thecodingmachine/safe is different than proxyz. My goal is a method proxy that allows you to override or watch the behaviour of a function from the "global namespace" effortlessly.
-
preg_last_error() and json_last_error()
Safe-PHP redeclares all core PHP functions (in a new namespace) to throw exceptions properly. I use this on almost every project now.
Symfony Dotenv
Posts with mentions or reviews of Symfony Dotenv.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-03-31.
-
How do you handle Api keys and tokens?
Keys and tokens in .env.local per environment (in .gitignore obviously), with a placeholder in the .env. I use https://github.com/symfony/dotenv
-
SMTP credentials exposed within GitHub account
Do check dotenv files and gitignore for all your secrets and environment-specific variables (server addresses, etc.) https://github.com/symfony/dotenv
-
Creating a DotEnv Loader in PHP
symfony/dotenv
-
🍾 GraphQL API for WordPress is now scoped, thanks to PHP-Scoper!
I believe that Mozart couldn't handle some of the dependencies in my plugin. I'm making use of several of Symfony's components, including DependencyInjection, Cache and Dotenv, with everything managed through Composer.
- How to read .env file outside served directory in vanilla php?
What are some alternatives?
When comparing Safe and Symfony Dotenv you can also consider the following projects:
PHP Dotenv - Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
Symfony VarDumper - Provides mechanisms for walking through any arbitrary PHP variable
Yo! Symfony TOML - A PHP parser for TOML
Expose - A beautiful, fully open-source, tunneling service - written in pure PHP
monorepo-builder - Composer tools to maintain a monorepo
phpstan-safe-rule - A PHPStan rule to be used with the thecodingmachine/safe package
wordpress-seo - Yoast SEO for WordPress
framework - :gem: Go! AOP PHP - modern aspect-oriented framework for the new level of software development
Rector - Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
Safe vs PHP Dotenv
Symfony Dotenv vs PHP Dotenv
Safe vs Symfony VarDumper
Symfony Dotenv vs Yo! Symfony TOML
Safe vs Expose
Symfony Dotenv vs monorepo-builder
Safe vs phpstan-safe-rule
Symfony Dotenv vs wordpress-seo
Safe vs Yo! Symfony TOML
Symfony Dotenv vs Expose
Safe vs framework
Symfony Dotenv vs Rector