PHP Classes

File: src/eMacros/Package/PasswordPackage.php

Recommend this page to a friend!
  Classes of Emmanuel Antico   eMacros   src/eMacros/Package/PasswordPackage.php   Download  
File: src/eMacros/Package/PasswordPackage.php
Role: Class source
Content type: text/plain
Description: Class source
Class: eMacros
PHP LISP language interpreter
Author: By
Last change:
Date: 10 years ago
Size: 860 bytes
 

Contents

Class file image Download
<?php
namespace eMacros\Package;

use
eMacros\Runtime\PHPFunction;

class
PasswordPackage extends Package {
    public function
__construct() {
       
parent::__construct('Password');
       
       
$this['crypt'] = new PHPFunction('crypt');
       
       
//password functions
       
if (function_exists('password_hash')) {
           
$this['hash'] = new PHPFunction('password_hash');
        }
       
        if (
function_exists('password_get_info')) {
           
$this['get-info'] = new PHPFunction('password_get_info');
        }
       
        if (
function_exists('password_needs_rehash')) {
           
$this['needs-rehash'] = new PHPFunction('password_needs_rehash');
        }
       
        if (
function_exists('password_verify')) {
           
$this['verify'] = new PHPFunction('password_verify');
        }
       
        if (
version_compare(phpversion(), '5.5', '>=')) {
           
$this['PASSWORD_DEFAULT'] = PASSWORD_DEFAULT;
           
$this['PASSWORD_BCRYPT'] = PASSWORD_BCRYPT;
        }
    }
}
?>