Ejemplo n.º 1
0
 /**
  * This actually files the job. This is prevented if the configuration of SMW
  * disables jobs.
  * @note Any method that inserts jobs with Job::batchInsert or otherwise must
  * implement this check individually. The below is not called in these cases.
  */
 function insert()
 {
     global $smwgEnableUpdateJobs;
     if ($smwgEnableUpdateJobs) {
         parent::insert();
     }
 }
Ejemplo n.º 2
0
 /**
  * Add an array of refreshLinks jobs to the queue
  * @param array $titles Array of title objects.
  * @static
  */
 function queueLinksJobs($titles)
 {
     $fname = 'Job::queueLinksJobs';
     wfProfileIn($fname);
     foreach ($titles as $title) {
         $job = new Job('refreshLinks', $title);
         $job->insert();
     }
     wfProfileOut($fname);
 }
Ejemplo n.º 3
0
 public function percentSign()
 {
     $observer = $this->getConnection()->addObserver(newinstance('rdbms.DBObserver', array(create('new Vector<lang.types.String>')), '{
     public $statements;
     public function __construct($statements) {
       $this->statements= $statements;
     }
     public static function instanceFor($arg) { }
     public function update($observable, $event= NULL) {
       if ($event instanceof DBEvent && "query" == $event->getName()) {
         $this->statements[]= new String($event->getArgument());
       }
     }
   }'));
     $j = new Job();
     $j->setTitle('Percent%20Sign');
     $j->insert();
     $this->assertEquals(new String('insert into JOBS.job (title) values ("Percent%20Sign")'), $observer->statements[0]);
 }