I’m working on Pthreads. I have written a class which inherits the “Thread” class. This class does not recognize the Yii (1.x) framework context. I cannot use any of the Yii framework components or models. I have made sure the thread class should reside in the Yii framework’s accessible paths defined in the “import” in configuration.
Here is an example how I wrote the thread class.
<?php
class MultiThreaded extends Thread {
public function __construct(){
}
public function run(){
echo Yii::app()->basePath;
}
}
Sorry for the delayed reply, as I got engaged on some other project.
Actually I wanted to use PThreads in CLI applications. I just wanted to test the PThread so that I can use it in some usefull things but ended up in having problem of missing Yii context inside PThread class.