Example #1
0
 public static function setCallback($callback)
 {
     if (preg_match('/\\W/', $callback)) {
         // if $callback contains a non-word character this could be an XSS attack.
         self::error('Invalid callback', true);
     } else {
         self::$_callback = $callback;
     }
 }
Example #2
0
function error($msg)
{
    OutputManager::error($msg);
}
Example #3
0
 /**
  * Save all the loaded classes to the configured output dir
  *
  * @throws Exception If no service is loaded
  *
  * @access private
  */
 private function savePhp()
 {
     $service = $this->service->getClass();
     if ($service == null) {
         throw new Exception('No service loaded');
     }
     $output = new OutputManager($this->config);
     // Generate all type classes
     $types = array();
     foreach ($this->types as $type) {
         $class = $type->getClass();
         if ($class != null) {
             $types[] = $class;
             if ($this->config->getOneFile() == false) {
                 $service->addDependency($class->getIdentifier() . '.php');
             }
         }
     }
     $output->save($service, $types);
 }