I am working on PHP Pthreads . I wrote a class that inherits the Thread class. This class does not recognize the context of the Yii structure (1.x). I cannot use any of the components or models of the Yii infrastructure. I made sure that the stream class must be in the accessible Yii structures defined in the import parameter.
Here is an example of how I wrote a stream class.
<?php
class MultiThreaded extends Thread {
public function __construct(){
}
public function run(){
echo Yii::app()->basePath;
}
}
Update:
Here is the array of importers in the Yii configuration.
'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
Harpine
source
share