Giter VIP home page Giter VIP logo

Comments (4)

lode avatar lode commented on September 17, 2024

I would say it is done to help people using require() instead of require_once(). It is done for all normal functions as well:

if (!function_exists('password_hash')) {
.

from password_compat.

DanielRuf avatar DanielRuf commented on September 17, 2024

@lode Ok, this would explain it and makes sense. Thanks for the hint.

Although I would just require once (we can at least check if the function exists). But it seems the library itself does not define a namespace to keep it simple so the functions are in the global namespace and can be directly used, is this correct?

So this was done to keep it as simple as possible so users can directly include / require and use the functions for passwor dhashing?

I think we can close this ticket, did not think about people who require the functions more than once.

from password_compat.

lode avatar lode commented on September 17, 2024

The functions are in global namespace as they are meant as a fallback for the native functions (http://php.net/password_hash) which are only available since php 5.5. Once you are working with php 5.5+ you should not need this library anymore.

from password_compat.

DanielRuf avatar DanielRuf commented on September 17, 2024

Right. Oversaw this fact (I am only including and using the file for configurations where PHP > 5.3.7 and < 5.5.0 runs).

from password_compat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.