Severity: 8192
Message: Function create_function() is deprecated
Filename: geshi/geshi.php
Line Number: 4698
Backtrace:
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste
File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once
<?php /** * Project: PHP WSDL generator * File: PHPParser.php * Purpose Parse PHP files to get an array of the classes with details * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * For questions, help, comments, discussion, etc., please send * e-mail to dragos@protung.ro * * @link http://www.protung.ro/ * @copyright 2009 Dragos Protung * @author Dragos Protung <dragos@protung.ro> * @package PHP WSDL generator * @version 1.2.2 */ class PHPParser { /** * Array with all the files to be parsed * * @var array */ /** * Classes to be ignored on parsing * * @var array */ /** * Methods to be ignored on parsing * * @var array */ /** * Auto ignore all public methods * * @var boolean */ private $ignorePublic = false; /** * Auto ignore all protected methods * * @var boolean */ private $ignoreProtected = true; /** * Auto ignore all private methods * * @var boolean */ private $ignorePrivate = true; /** * Auto ignore all static methods * * @var boolean */ private $ignoreStatic = false; /** * Array holding all the classes * * @var array */ /** * Array holding found classes but with errors (only classes withoutmethods for now) * * @var array */ /** * Array holding all the classes variables * * @var array */ /** * Array holding all the data * * @var array */ /** * Current class that is parsed * * @var string */ private $currentClass; /** * The latest comment found for a method * * @var string */ private $currentMethodComment; /** * The latest type found for a method * * @var string */ private $currentMethodType; /** * The latest method found for a class * * @var string */ private $currentMethod; /** * Latest parameters found for a method * * @var array */ /** * The variable that holds the XML * * @var XMLCreator */ private $WSDL; /** * Messages for the WSDL * * @var array */ /** * Bindings for the WSDL * * @var array */ /** * PortTypes for the WSDL * * @var array */ /** * Services for the WSDL * * @var array */ /** * Constructor * */ public function __construct () { } /** * Unignore all. * All ignored items will be removed (including method types) * */ public function ignoreNone () { } /** * Ignore or not all public methods * * @param boolean $ignore */ public function ignorePublic ($ignore = false) { if ($ignore === true) { $this->ignorePublic = true; } elseif ($ignore === false) { $this->ignorePublic = false; } } /** * Ignore or not all protected methods * * @param boolean $ignore */ public function ignoreProtected ($ignore = false) { if ($ignore === true) { $this->ignoreProtected = true; } elseif ($ignore === false) { $this->ignoreProtected = false; } } /** * Ignore or not all private methods * * @param boolean $ignore */ public function ignorePrivate ($ignore = false) { if ($ignore === true) { $this->ignorePrivate = true; } elseif ($ignore === false) { $this->ignorePrivate = false; } } /** * Ignore or not all static methods * * @param boolean $ignore */ public function ignoreStatic ($ignore = false) { if ($ignore === true) { $this->ignoreStatic = true; } elseif ($ignore === false) { $this->ignoreStatic = false; } } /** * Add a class name to ignore on parsing * * @param string $class */ public function ignoreClass ($class) { $this->ignoredClasses[] = $class; } /** * Add classes to ignor on parsing * * @param array $classes */ public function ignoreClasses ($classes) { foreach ($classes as $class) { $this->ignoreClass($class); } } } /** * Add a method of a class to ignore on parsing * * @param array $method */ public function ignoreMethod ($method) { } } /** * Add methods of classes to ignore on parsing * * @param array $methods */ public function ignoreMethods ($methods) { foreach ($methods as $class=>$method) { if ($class != "" && $method != "") $this->ignoredMethods[$class][] = $method; } } } /** * Add a file to parse * * @param string $file */ public function addFile ($file) { $this->files[] = $file; } else { } } /** * Return the next token resulted alfter token_get_all() * * @return array */ private function getNextToken () { continue; } break; } } return false; } /** * Return the previous token exept white space * * @return array */ private function getPrevToken () { continue; } break; } } return false; } /** * Get next token with a type * * @param integer $type * @return array */ private function getNextTokenWithType ($type) { while (($current = $this->getNextToken())) { if($current[0] == $type) { } } } /** * Parse a file * It gets the data from $this->all_data * */ private function parseFile () { $lookForClassVariables = true; // When this will be set as false we will not look for class variables because a function was defined while (($token = $this->getNextToken())) { // print_r($this->allData);exit; if ($token[0] == T_CLASS) { // T_CLASS $className = $this->getNextTokenWithType(T_STRING); $this->currentClass = $className[1]; $this->currentMethodComment = $this->currentMethodType = $this->currentMethod = $this->currentParams = null; continue; } if ($lookForClassVariables === true && $token[0] == T_VARIABLE && $this->currentClass != null) { $this->classesVars[$this->currentClass][$varName] = ""; continue; } if ($token[0] == T_DOC_COMMENT) { // T_DOC_COMMENT $nt = $this->getNextToken(); if ($nt[0] == T_FUNCTION || $nt[0] == T_STATIC || $nt[0] == T_ABSTRACT || $nt[0] == T_FINAL || $nt[0] == T_PRIVATE || $nt[0] == T_PROTECTED || $nt[0] == T_PUBLIC) { // public | protected | private | final | abstract | static | function $nnt = $this->getNextToken(); if ($nnt[0] == T_VARIABLE) { $this->getPrevToken(); $varType = $this->getPrevToken(); if ($varType[0] == T_DOC_COMMENT) { $varType = $this->parseComment($varType[1]); $varType = $varType['params']['type']; $this->classesVars[$this->currentClass][$varName] = $varType; } continue; } else { $this->getPrevToken(); } $this->currentMethodComment = $token[1]; $this->currentMethod = null; $this->currentParams = null; $this->getPrevToken(); continue; } } $nt[0] == T_PRIVATE || $nt[0] == T_PROTECTED || $nt[0] == T_PUBLIC)) { // public | protected | private | final | abstract | static $this->currentMethodType = $token[1] ? $token[1] : "public"; $this->currentMethod = $this->currentParams = null; $token = $this->getNextToken(); } else { $this->currentMethodType = "public"; } if ($token[0] == T_FUNCTION) { // T_FUNCTION $lookForClassVariables = false; $f = $this->getNextTokenWithType(T_STRING); $this->currentMethod = $f[1]; $this->currentParams = null; if ($p[0] == T_VARIABLE) { // T_VARIABLE $this->currentParams[] = $p[1]; } } } } $this->foundClasses[$this->currentClass] = $this->currentClass; } if ($this->currentClass && $this->currentMethod) { $this->classes[$this->currentClass][$this->currentMethod]["comment"] = $this->currentMethodComment; if ($this->currentMethod == null) $this->currentMethod = "public"; $this->classes[$this->currentClass][$this->currentMethod]["type"] = $this->currentMethodType; $this->classes[$this->currentClass][$this->currentMethod]["params"] = $this->currentParams; $this->currentMethodComment = $this->currentMethodType = $this->currentMethod = $this->currentParams = null; } } } /** * Filter classes * Extracts all the ignored classes and methods and methods types * */ private function filterClasses () { foreach ($this->classes as $class=>$methods) { continue; } foreach ($methods as $method=>$attrs) { if (($attrs["type"] == "public" && $this->ignorePublic === true) || ($attrs["type"] == "protected" && $this->ignoreProtected === true) || ($attrs["type"] == "private" && $this->ignorePrivate === true) || ($attrs["type"] == "static" && $this->ignoreStatic === true)) { } } } } } } /** * Parse a comment * Extracts description, parameters type and return type * * @param string $comment * @return array */ private function parseComment ($comment) { if ($comment == "") return ""; $description = ""; $returntype = ""; if ($parts[0] == "@return") { $returntype = $parts[1]; } elseif ($parts[0] == "@param") { $params[$parts[2]] = $parts[1]; } elseif ($parts[0] == "@var") { $params['type'] = $parts[1]; } } else { } } return $comment; } else { return ""; } } /** * Parse the classes * */ private function parseClasses () { $classes = $this->classes; foreach ($classes as $class=>$methods) { foreach ($methods as $method=>$attributes) { $this->classes[$class][$method]["type"] = $attributes["type"]; $commentParsed = $this->parseComment($attributes["comment"]); $this->classes[$class][$method]["returnType"] = !isset($commentParsed["return"]) ? false : $commentParsed["return"]; $this->classes[$class][$method]["description"] = isset($commentParsed["description"]) ? $commentParsed["description"] : ""; foreach ($attributes["params"] as $param) { $this->classes[$class][$method]["params"][$paramName]["varName"] = $param; $this->classes[$class][$method]["params"][$paramName]["varType"] = $commentParsed["params"][$param]; } } } } } /** * Get all the parsed classes from the files (filtered) * * @return array */ public function getClasses () { foreach ($this->files as $file) { } $this->filterClasses(); $this->parseClasses(); return $this->classes; } /** * Get all found classes (after parsing) * * @return array */ public function getFoundClasses () { return $this->foundClasses; } /** * Get all the variables of the classes defined in the files * * @return array */ public function getClassesVars () { return $this->classesVars; } } ?>