Bonjour à tous,
je voudrais utiliser les threads sous PHP. j'ai ajouter les fichiers :
pthreadVC2.dll dans le repertoire "C:\wamp\bin\php\php5.4.3"
et php_pthreads.dll dans "C:\wamp\bin\php\php5.4.3\ext"
puis j'ai ajouter cette ligne "extension=php_pthreads.dll" dans le fichier php.ini
et voilà mon code php :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
class Thread1 extends Thread{
    public function process($pParams=null){
        sleep ($pParams->time);
        return "Fin après".$pParams->time ."secondes";
    }
}
$manager = _class("thread|threadmanager");
$manager->add("monmodule|thread1",_ppo(array('time'=>2)));
$manager->add("monmodule|thread1",_ppo(array('time'=>3)));
$manager->add("monmodule|thread1",_ppo(array('time'=>1)));
$reponses = $manager->execute();
ça me donne l'erreur suivant :
Fatal error: Class 'Thread' not found in..
merci d'avance