I'm working on PHP 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;
}
}
Update:
Here is the importer array in Yii config.
'import'=>array(
'application.models.*',
'application.components.*',
'application.components.multithreaded-operations.*',
'application.components.google_api_Lib.src.*',
'application.controllers.*',
'application.extensions.yii-mail.*',
'application.extensions.*',
'application.commands.*',
),
Am I doing something wrong ?
Thanks
Arfeen