Login   Register  
PHP Classes
elePHPant
Icontem

File: src/eMacros/Package/PasswordPackage.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2014-01-13 05:17
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;
        }
    }
}
?>