php - Cant understand what's happening -


i'm trying zend framework, i've got 2 folders in e:\archivos de programa\zend\zendserver\share, une zendserver , other 1 zendserver2 can't recall if ever install 2 version dont think problem i'm using netbeans ide ando i'm trying make abm of users using blockcipher here code

<?php use zend\crypt\blockcipher; class application_model_dbtable_usuarios extends zend_db_table_abstract {      protected $_name = 'usuario';      public function getusuario($usuario)     {         $usuario = (string)$usuario;         $row = $this->fetchrow('usuario = ' . $usuario);         if (!$row) {             throw new exception("could not find row $usuario");         }         return $row->toarray();     }      public function addusuario($usuario, $clave)     {         $blockcipher = zend\crypt\blockcipher::factory('mcrypt',array('algo'=>'aes'));        $blockcipher->setkey('encryption key');        $result = $blockcipher->encrypt($clave);        echo "encrypted text: $result \n";        exit;        $data = array(             'usuario' => $usuario,             'clave' => $blockcipher,         );         $this->insert($data);      }      public function updateusuario($usuario, $clave)     {         $blockcipher =  blockcipher::factory($clave, array(                                 'algo' => 'blowfish',                                 'mode' => 'cfb',                                 'hash' => 'sha512'                         ));         $data = array(             'clave' => $blockcipher,         );         $this->update($data, 'usuario = ' . (string)$usuario);      }      public function deleteusuario($usuario)     {         $this->delete('usuario = ' . (string)$usuario);     }  } 

and in php.ini i've got include_path=".;e:\archivos de programa\zend\zendserver\share\zendframework2\library"

and error

fatal error: class 'zend\crypt\blockcipher' not found in e:\documents , settings\dvieira\mis documentos\netbeansprojects\justforgeeks\application\models\dbtable\usuarios.php on line 21

i dont understand why. can me please? in advance

you using namespaces in application, therefore need make sure autoloader can handle this. if it's zf1 app not. can try using require include class file instead? can ass amend autoloader work namespaces

secondly when using namespaces, if create alias class

use zend\crypt\blockcipher; 

you instantiate

$blockcipher = blockcipher::factory('mcrypt',array('algo'=>'aes')); 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -