示例#1
0
 /**
  * Create the module globals c header file fragment
  *
  * @access private
  * @return string  module globals code fragment
  */
 function generateGlobalsH()
 {
     if (empty($this->globals)) {
         return "";
     }
     $code = CodeGen_PECL_Element_Global::hCodeHeader($this->name);
     foreach ($this->globals as $global) {
         $code .= $global->hCode($this->name);
     }
     $code .= CodeGen_PECL_Element_Global::hCodeFooter($this->name);
     return $code;
 }
 function tagend_globals_phpini($attr, $data)
 {
     $ini = new CodeGen_PECL_Element_Ini();
     if (isset($attr["name"])) {
         $err = $ini->setName($attr["name"]);
         if (PEAR::isError($err)) {
             return $err;
         }
     } else {
         return PEAR::raiseError("name attribut for php.ini directive missing");
     }
     if (isset($attr["type"])) {
         $err = $ini->setType($attr["type"]);
         if (PEAR::isError($err)) {
             return $err;
         }
     }
     if (isset($attr["value"])) {
         $err = $ini->setValue($attr["value"]);
         if (PEAR::isError($err)) {
             return $err;
         }
     }
     if (isset($attr["access"])) {
         $err = $ini->setAccess($attr["access"]);
         if (PEAR::isError($err)) {
             return $err;
         }
     }
     if (isset($attr["onupdate"])) {
         $err = $ini->setOnUpdate($attr["onupdate"]);
         if (PEAR::isError($err)) {
             return $err;
         }
     }
     $ini->setDesc(CodeGen_Tools_IndentC::linetrim($data));
     $err = $this->extension->addPhpini($ini);
     if (PEAR::isError($err)) {
         return $err;
     }
     // php.ini settings are stored in modul-global variables
     $global = new CodeGen_PECL_Element_Global();
     $err = $global->setName($ini->getName());
     if (PEAR::isError($err)) {
         return $err;
     }
     $err = $global->setType($ini->getType());
     if (PEAR::isError($err)) {
         return $err;
     }
     $err = $this->extension->addGlobal($global);
     return $err;
 }