idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
40,400 | static function Start ( $ level = null ) { if ( $ level == null ) { if ( defined ( "E_DEPRECATED" ) ) { $ level = E_ALL & ~ E_DEPRECATED ; } else { $ level = E_ALL ; self :: $ IGNORE_DEPRECATED = true ; } } set_error_handler ( array ( "ExceptionThrower" , "HandleError" ) , $ level ) ; } | Start redirecting PHP errors |
40,401 | function Log ( $ level , $ message , $ data = "" ) { $ data = $ data != "" ? ": $data" : "" ; switch ( $ level ) { case DBH_LOG_DEBUG : if ( $ this -> LogLevel & DBH_LOG_DEBUG ) print "<pre style='color: silver;'>$message</pre>\r\n" ; break ; case DBH_LOG_INFO : if ( $ this -> LogLevel & DBH_LOG_INFO ) print "<pre styl... | Called by DB objects to report logging information |
40,402 | public static function ConvertEncoding ( $ value , $ to , $ from ) { if ( self :: getIsIconvEnabled ( ) ) { return iconv ( $ from , $ to , $ value ) ; } if ( self :: getIsMbstringEnabled ( ) ) { return mb_convert_encoding ( $ value , $ to , $ from ) ; } if ( $ from == 'UTF-16LE' ) { return self :: utf16_decode ( $ valu... | Convert string from one encoding to another . First try mbstring then iconv finally strlen |
40,403 | public static function utf16_decode ( $ str , $ bom_be = TRUE ) { if ( strlen ( $ str ) < 2 ) return $ str ; $ c0 = ord ( $ str { 0 } ) ; $ c1 = ord ( $ str { 1 } ) ; if ( $ c0 == 0xfe && $ c1 == 0xff ) { $ str = substr ( $ str , 2 ) ; } elseif ( $ c0 == 0xff && $ c1 == 0xfe ) { $ str = substr ( $ str , 2 ) ; $ bom_be ... | Decode UTF - 16 encoded strings . |
40,404 | public static function SYLKtoUTF8 ( $ pValue = '' ) { if ( strpos ( $ pValue , '' ) === false ) { return $ pValue ; } foreach ( self :: $ _SYLKCharacters as $ k => $ v ) { $ pValue = str_replace ( $ k , $ v , $ pValue ) ; } return $ pValue ; } | Convert SYLK encoded string to UTF - 8 |
40,405 | public function writeFont ( ) { $ font_outline = 0 ; $ font_shadow = 0 ; $ icv = $ this -> _colorIndex ; if ( $ this -> _font -> getSuperScript ( ) ) { $ sss = 1 ; } else if ( $ this -> _font -> getSubScript ( ) ) { $ sss = 2 ; } else { $ sss = 0 ; } $ bFamily = 0 ; $ bCharSet = PHPExcel_Shared_Font :: getCharsetFromFo... | Get font record data |
40,406 | private static function cellAddressInDeleteRange ( $ cellAddress , $ beforeRow , $ pNumRows , $ beforeColumnIndex , $ pNumCols ) { list ( $ cellColumn , $ cellRow ) = PHPExcel_Cell :: coordinateFromString ( $ cellAddress ) ; $ cellColumnIndex = PHPExcel_Cell :: columnIndexFromString ( $ cellColumn ) ; if ( $ pNumRows <... | Test whether a cell address falls within a defined range of cells |
40,407 | private function _updateCellRange ( $ pCellRange = 'A1:A1' , $ pBefore = 'A1' , $ pNumCols = 0 , $ pNumRows = 0 ) { if ( strpos ( $ pCellRange , ':' ) !== false || strpos ( $ pCellRange , ',' ) !== false ) { $ range = PHPExcel_Cell :: splitRange ( $ pCellRange ) ; $ ic = count ( $ range ) ; for ( $ i = 0 ; $ i < $ ic ;... | Update cell range |
40,408 | function _addContinue ( $ data ) { $ limit = $ this -> _limit ; $ record = 0x003C ; $ tmp = substr ( $ data , 0 , 2 ) . pack ( "v" , $ limit - 4 ) . substr ( $ data , 4 , $ limit - 4 ) ; $ header = pack ( "vv" , $ record , $ limit ) ; $ data_length = strlen ( $ data ) ; for ( $ i = $ limit ; $ i < ( $ data_length - $ l... | Excel limits the size of BIFF records . In Excel 5 the limit is 2084 bytes . In Excel 97 the limit is 8228 bytes . Records that are longer than these limits must be split up into CONTINUE blocks . |
40,409 | public function Login ( ) { $ user = new ExampleUser ( ) ; if ( $ user -> Login ( RequestUtil :: Get ( 'username' ) , RequestUtil :: Get ( 'password' ) ) ) { $ this -> SetCurrentUser ( $ user ) ; $ this -> Redirect ( 'SecureExample.UserPage' ) ; } else { $ this -> Redirect ( 'SecureExample.LoginForm' , 'Unknown usernam... | Process the login create the user session and then redirect to the appropriate page |
40,410 | private function _createCSSStyle ( PHPExcel_Style $ pStyle ) { $ css = '' ; $ css = array_merge ( $ this -> _createCSSStyleAlignment ( $ pStyle -> getAlignment ( ) ) , $ this -> _createCSSStyleBorders ( $ pStyle -> getBorders ( ) ) , $ this -> _createCSSStyleFont ( $ pStyle -> getFont ( ) ) , $ this -> _createCSSStyleF... | Create CSS style |
40,411 | public static function register ( $ bundle , $ config = array ( ) ) { $ defaults = array ( 'handles' => null , 'auto' => false ) ; if ( is_string ( $ config ) ) { $ bundle = $ config ; $ config = array ( 'location' => $ bundle ) ; } if ( ! isset ( $ config [ 'location' ] ) ) { $ config [ 'location' ] = $ bundle ; } sta... | Register the bundle for the application . |
40,412 | protected static function autoloads ( $ bundle , $ config ) { $ path = rtrim ( Bundle :: path ( $ bundle ) , DS ) ; foreach ( $ config [ 'autoloads' ] as $ type => $ mappings ) { $ mappings = array_map ( function ( $ mapping ) use ( $ path ) { return str_replace ( '(:bundle)' , $ path , $ mapping ) ; } , $ mappings ) ;... | Register the auto - loading configuration for a bundle . |
40,413 | public static function handles ( $ uri ) { $ uri = rtrim ( $ uri , '/' ) . '/' ; foreach ( static :: $ bundles as $ key => $ value ) { if ( isset ( $ value [ 'handles' ] ) and starts_with ( $ uri , $ value [ 'handles' ] . '/' ) or $ value [ 'handles' ] == '/' ) { return $ key ; } } return DEFAULT_BUNDLE ; } | Determine which bundle handles the given URI . |
40,414 | public static function identifier ( $ bundle , $ element ) { return ( is_null ( $ bundle ) or $ bundle == DEFAULT_BUNDLE ) ? $ element : $ bundle . '::' . $ element ; } | Reconstruct an identifier from a given bundle and element . |
40,415 | function append ( $ data ) { if ( $ this -> _PPS_FILE ) { fwrite ( $ this -> _PPS_FILE , $ data ) ; } else { $ this -> _data .= $ data ; } } | Append data to PPS |
40,416 | public function receive ( ) { $ nFeedbackTupleLen = self :: TIME_BINARY_SIZE + self :: TOKEN_LENGTH_BINARY_SIZE + self :: DEVICE_BINARY_SIZE ; $ this -> _aFeedback = array ( ) ; $ sBuffer = '' ; while ( ! feof ( $ this -> _hSocket ) ) { $ this -> _log ( 'INFO: Reading...' ) ; $ sBuffer .= $ sCurrBuffer = fread ( $ this... | Receives feedback tuples from Apple Push Notification Service feedback . |
40,417 | public function getPlotLabelByIndex ( $ index ) { $ keys = array_keys ( $ this -> _plotLabel ) ; if ( in_array ( $ index , $ keys ) ) { return $ this -> _plotLabel [ $ index ] ; } elseif ( isset ( $ keys [ $ index ] ) ) { return $ this -> _plotLabel [ $ keys [ $ index ] ] ; } return false ; } | Get Plot Label by Index |
40,418 | public function getPlotCategoryByIndex ( $ index ) { $ keys = array_keys ( $ this -> _plotCategory ) ; if ( in_array ( $ index , $ keys ) ) { return $ this -> _plotCategory [ $ index ] ; } elseif ( isset ( $ keys [ $ index ] ) ) { return $ this -> _plotCategory [ $ keys [ $ index ] ] ; } return false ; } | Get Plot Category by Index |
40,419 | public function getPlotValuesByIndex ( $ index ) { $ keys = array_keys ( $ this -> _plotValues ) ; if ( in_array ( $ index , $ keys ) ) { return $ this -> _plotValues [ $ index ] ; } elseif ( isset ( $ keys [ $ index ] ) ) { return $ this -> _plotValues [ $ keys [ $ index ] ] ; } return false ; } | Get Plot Values by Index |
40,420 | public function getPluginFromDefaultHandler ( $ tag , $ plugin_type ) { $ callback = null ; $ script = null ; $ cacheable = true ; $ result = call_user_func_array ( $ this -> smarty -> default_plugin_handler_func , array ( $ tag , $ plugin_type , $ this -> template , & $ callback , & $ script , & $ cacheable ) ) ; if (... | Check for plugins by default plugin handler |
40,421 | public function processNocacheCode ( $ content , $ is_code ) { if ( $ is_code && ! empty ( $ content ) ) { if ( ( ! ( $ this -> template -> source -> recompiled ) || $ this -> forceNocache ) && $ this -> template -> caching && ! $ this -> suppressNocacheProcessing && ( $ this -> nocache || $ this -> tag_nocache ) ) { $... | Inject inline code for nocache template sections |
40,422 | public function popTrace ( ) { if ( $ this -> smarty -> debugging ) { Smarty_Internal_Debug :: end_compile ( $ this -> template ) ; } $ r = array_pop ( $ this -> trace_stack ) ; $ this -> smarty -> _current_file = $ r [ 0 ] ; $ this -> trace_filepath = $ r [ 1 ] ; $ this -> trace_uid = $ r [ 2 ] ; $ this -> trace_line_... | restore file and line offset |
40,423 | public function compile ( $ args , $ compiler , $ parameter , $ tag ) { $ compiler -> has_output = true ; $ _attr = $ this -> getAttributes ( $ compiler , $ args ) ; if ( $ _attr [ 'nocache' ] ) { $ compiler -> tag_nocache = true ; } unset ( $ _attr [ 'nocache' ] ) ; if ( isset ( $ compiler -> smarty -> registered_plug... | Compiles code for the execution of a registered function |
40,424 | function _convertError ( $ errorCode ) { switch ( $ errorCode ) { case '#NULL!' : return pack ( "C" , 0x00 ) ; case '#DIV/0!' : return pack ( "C" , 0x07 ) ; case '#VALUE!' : return pack ( "C" , 0x0F ) ; case '#REF!' : return pack ( "C" , 0x17 ) ; case '#NAME?' : return pack ( "C" , 0x1D ) ; case '#NUM!' : return pack (... | Convert an error code to a ptgErr |
40,425 | function _advance ( ) { $ i = $ this -> _current_char ; $ formula_length = strlen ( $ this -> _formula ) ; if ( $ i < $ formula_length ) { while ( $ this -> _formula { $ i } == " " ) { ++ $ i ; } if ( $ i < ( $ formula_length - 1 ) ) { $ this -> _lookahead = $ this -> _formula { $ i + 1 } ; } $ token = '' ; } while ( $... | Advance to the next valid token . |
40,426 | static function Get ( $ url , $ data = "" , $ verify_cert = false , $ timeout = 30 ) { if ( function_exists ( "curl_init" ) ) { return HttpRequest :: CurlPost ( $ url , $ data , $ verify_cert , $ timeout ) ; } else { return HttpRequest :: FilePost ( $ url , $ data , $ verify_cert , $ timeout ) ; } } | Make an HTTP GET request using the best method available on the server |
40,427 | static function Put ( $ url , $ data = "" , $ verify_cert = false , $ timeout = 30 ) { if ( function_exists ( "curl_init" ) ) { return HttpRequest :: CurlPut ( $ url , $ data , $ verify_cert , $ timeout ) ; } else { throw new Exception ( 'PUT request is not supported on systems without curl installed' ) ; } } | Make an HTTP PUT reequest using the best method available on the server |
40,428 | static function FileGet ( $ url , $ data = "" , $ verify_cert = false , $ timeout = 30 ) { $ qs = HttpRequest :: ArrayToQueryString ( $ data ) ; $ full_url = $ url . ( $ qs ? "?" . $ qs : "" ) ; return file_get_contents ( $ full_url ) ; } | Make an HTTP GET request using file_get_contents |
40,429 | static function FilePost ( $ url , $ data = "" , $ verify_cert = false , $ timeout = 30 ) { $ qs = HttpRequest :: ArrayToQueryString ( $ data ) ; $ url = $ url . ( $ qs ? "?" . $ qs : "" ) ; $ show_headers = false ; $ url = parse_url ( $ url ) ; if ( ! isset ( $ url [ 'port' ] ) ) { if ( $ url [ 'scheme' ] == 'http' ) ... | Make an HTTP POST request using file_get_contents |
40,430 | static function CurlGet ( $ url , $ data = "" , $ verify_cert = false , $ timeout = 30 ) { return HttpRequest :: CurlRequest ( "GET" , $ url , $ data , $ verify_cert , $ timeout ) ; } | Make an HTTP GET request using CURL |
40,431 | static function CurlPost ( $ url , $ data , $ verify_cert = false , $ timeout = 30 ) { return HttpRequest :: CurlRequest ( "POST" , $ url , $ data , $ verify_cert , $ timeout ) ; } | Make an HTTP POST request using CURL |
40,432 | static function CurlPut ( $ url , $ data , $ verify_cert = false , $ timeout = 30 ) { return HttpRequest :: CurlRequest ( "PUT" , $ url , $ data , $ verify_cert , $ timeout ) ; } | Make an HTTP PUT request using CURL |
40,433 | static function CurlRequest ( $ method , $ url , $ data , $ verify_cert = false , $ timeout = 30 ) { $ qs = HttpRequest :: ArrayToQueryString ( $ data ) ; $ agent = "verysimple::HttpRequest" ; $ fp = null ; if ( $ method == "POST" ) { $ ch = curl_init ( $ url ) ; curl_setopt ( $ ch , CURLOPT_POST , 1 ) ; curl_setopt ( ... | Make an HTTP request using CURL |
40,434 | static function ArrayToQueryString ( $ arr ) { $ qs = $ arr ; if ( is_array ( $ arr ) ) { $ qs = "" ; $ delim = "" ; foreach ( array_keys ( $ arr ) as $ key ) { $ qs .= $ delim . $ key . "=" . $ arr [ $ key ] ; $ delim = "&" ; } } return $ qs ; } | Converts an array into a URL querystring |
40,435 | static function Decrypt ( $ data , $ key , $ decode = true , $ strip_nulls = true ) { McryptUtil :: Init ( ) ; if ( $ decode ) $ data = base64_decode ( $ data ) ; $ decrypted = mcrypt_decrypt ( McryptUtil :: $ CIPHER , $ key , $ data , McryptUtil :: $ MODE , McryptUtil :: $ IV ) ; return $ strip_nulls ? rtrim ( $ decry... | Decrypts data that was previously encrypted |
40,436 | public function getCompiledFilepath ( ) { return $ this -> compiled_filepath === null ? ( $ this -> compiled_filepath = $ this -> buildCompiledFilepath ( ) ) : $ this -> compiled_filepath ; } | Returns the compiled filepath |
40,437 | public function getCompiledTimestamp ( ) { return $ this -> compiled_timestamp === null ? ( $ this -> compiled_timestamp = ( file_exists ( $ this -> getCompiledFilepath ( ) ) ) ? filemtime ( $ this -> getCompiledFilepath ( ) ) : false ) : $ this -> compiled_timestamp ; } | Returns the timpestamp of the compiled file |
40,438 | public function mustCompile ( ) { return $ this -> mustCompile === null ? $ this -> mustCompile = ( $ this -> smarty -> force_compile || $ this -> getCompiledTimestamp ( ) === false || $ this -> smarty -> compile_check && $ this -> getCompiledTimestamp ( ) < $ this -> source -> timestamp ) : $ this -> mustCompile ; } | Returns if the current config file must be compiled |
40,439 | public function getCompiledConfig ( ) { if ( $ this -> compiled_config === null ) { if ( $ this -> mustCompile ( ) ) { $ this -> compileConfigSource ( ) ; } else { $ this -> compiled_config = file_get_contents ( $ this -> getCompiledFilepath ( ) ) ; } } return $ this -> compiled_config ; } | Returns the compiled config file |
40,440 | public function compileConfigSource ( ) { if ( ! is_object ( $ this -> compiler_object ) ) { $ this -> compiler_object = new Smarty_Internal_Config_File_Compiler ( $ this -> smarty ) ; } if ( $ this -> smarty -> compile_locking ) { if ( $ saved_timestamp = $ this -> getCompiledTimestamp ( ) ) { touch ( $ this -> getCom... | Compiles the config files |
40,441 | public function loadConfigVars ( $ sections = null , $ scope = 'local' ) { if ( $ this -> data instanceof Smarty_Internal_Template ) { $ this -> data -> properties [ 'file_dependency' ] [ sha1 ( $ this -> source -> filepath ) ] = array ( $ this -> source -> filepath , $ this -> source -> timestamp , 'file' ) ; } if ( $... | load config variables |
40,442 | public function Get ( $ var , $ default = null ) { return ( isset ( $ _SESSION [ $ this -> GUID . "_" . $ var ] ) ) ? unserialize ( $ _SESSION [ $ this -> GUID . "_" . $ var ] ) : null ; } | Returns a persisted object or value |
40,443 | public function traverse ( Twig_NodeInterface $ node ) { ksort ( $ this -> visitors ) ; foreach ( $ this -> visitors as $ visitors ) { foreach ( $ visitors as $ visitor ) { $ node = $ this -> traverseForVisitor ( $ visitor , $ node ) ; } } return $ node ; } | Traverses a node and calls the registered visitors . |
40,444 | protected function GetFullYear ( $ year ) { if ( strlen ( $ year ) < 4 ) { $ century = substr ( date ( "Y" ) , 0 , 2 ) ; $ year = $ century . $ year ; } return $ year ; } | Given a 2 - digit year return the full 4 - digit year |
40,445 | static function discover ( $ uri ) { $ xrds_file = self :: discoverXRDS ( $ uri ) ; if ( ! empty ( $ xrds_file ) ) { $ xrds = xrds_parse ( $ xrds_file ) ; if ( empty ( $ xrds ) ) { throw new OAuthException2 ( 'Could not discover OAuth information for ' . $ uri ) ; } } else { throw new OAuthException2 ( 'Could not disco... | Return a description how we can do a consumer allocation . Prefers static allocation if possible . If static allocation is possible |
40,446 | static protected function discoverXRDS ( $ uri , $ recur = 0 ) { if ( $ recur > 10 ) { return false ; } $ data = self :: curl ( $ uri ) ; if ( is_string ( $ data ) && ! empty ( $ data ) ) { list ( $ head , $ body ) = explode ( "\r\n\r\n" , $ data ) ; $ body = trim ( $ body ) ; $ m = false ; if ( preg_match ( '/^Content... | Discover the XRDS file at the uri . This is a bit primitive you should overrule this function so that the XRDS file can be cached for later referral . |
40,447 | static protected function curl ( $ uri ) { $ ch = curl_init ( ) ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , array ( 'Accept: application/xrds+xml, */*;q=0.1' ) ) ; curl_setopt ( $ ch , CURLOPT_USERAGENT , 'anyMeta/OAuth 1.0 - (OAuth Discovery $LastChangedRevision: 45 $)' ) ; curl_setopt ( $ ch , CURLOPT_URL , $ uri ) ;... | Try to fetch an XRDS file at the given location . Sends an accept header preferring the xrds file . |
40,448 | public function refreshRowDimensions ( ) { $ currentRowDimensions = $ this -> getRowDimensions ( ) ; $ newRowDimensions = array ( ) ; foreach ( $ currentRowDimensions as $ objRowDimension ) { $ newRowDimensions [ $ objRowDimension -> getRowIndex ( ) ] = $ objRowDimension ; } $ this -> _rowDimensions = $ newRowDimension... | Refresh row dimensions |
40,449 | public function calculateColumnWidths ( $ calculateMergeCells = false ) { $ autoSizes = array ( ) ; foreach ( $ this -> getColumnDimensions ( ) as $ colDimension ) { if ( $ colDimension -> getAutoSize ( ) ) { $ autoSizes [ $ colDimension -> getColumnIndex ( ) ] = - 1 ; } } if ( ! empty ( $ autoSizes ) ) { $ isMergeCell... | Calculate widths for auto - size columns |
40,450 | public function setBreak ( $ pCell = 'A1' , $ pBreak = PHPExcel_Worksheet :: BREAK_NONE ) { $ pCell = strtoupper ( $ pCell ) ; if ( $ pCell != '' ) { if ( $ pBreak == PHPExcel_Worksheet :: BREAK_NONE ) { if ( isset ( $ this -> _breaks [ $ pCell ] ) ) { unset ( $ this -> _breaks [ $ pCell ] ) ; } } else { $ this -> _bre... | Set break on a cell |
40,451 | public function mergeCells ( $ pRange = 'A1:A1' ) { $ pRange = strtoupper ( $ pRange ) ; if ( strpos ( $ pRange , ':' ) !== false ) { $ this -> _mergeCells [ $ pRange ] = $ pRange ; $ aReferences = PHPExcel_Cell :: extractAllCellReferencesInRange ( $ pRange ) ; $ upperLeft = $ aReferences [ 0 ] ; if ( ! $ this -> cellE... | Set merge on a cell range |
40,452 | function _DataLen ( ) { if ( ! isset ( $ this -> _data ) ) { return 0 ; } if ( isset ( $ this -> _PPS_FILE ) ) { fseek ( $ this -> _PPS_FILE , 0 ) ; $ stats = fstat ( $ this -> _PPS_FILE ) ; return $ stats [ 7 ] ; } else { return strlen ( $ this -> _data ) ; } } | Returns the amount of data saved for this PPS |
40,453 | public static function instance ( $ store = 'SESSION' , $ options = array ( ) ) { if ( ! OAuthSession :: $ instance ) { if ( strpos ( $ store , '/' ) === false ) { $ class = 'OAuthSession' . $ store ; $ file = dirname ( __FILE__ ) . '/session/' . $ class . '.php' ; } else { $ file = $ store ; $ store = basename ( $ fil... | Request an instance of the OAuthSession |
40,454 | public function getParent ( array $ context ) { if ( null !== $ this -> parent ) { return $ this -> parent ; } $ parent = $ this -> doGetParent ( $ context ) ; if ( false === $ parent ) { return false ; } elseif ( $ parent instanceof Twig_Template ) { $ name = $ parent -> getTemplateName ( ) ; $ this -> parents [ $ nam... | Returns the parent template . |
40,455 | public function displayParentBlock ( $ name , array $ context , array $ blocks = array ( ) ) { $ name = ( string ) $ name ; if ( isset ( $ this -> traits [ $ name ] ) ) { $ this -> traits [ $ name ] [ 0 ] -> displayBlock ( $ name , $ context , $ blocks ) ; } elseif ( false !== $ parent = $ this -> getParent ( $ context... | Displays a parent block . |
40,456 | public function displayBlock ( $ name , array $ context , array $ blocks = array ( ) ) { $ name = ( string ) $ name ; if ( isset ( $ blocks [ $ name ] ) ) { $ template = $ blocks [ $ name ] [ 0 ] ; $ block = $ blocks [ $ name ] [ 1 ] ; unset ( $ blocks [ $ name ] ) ; } elseif ( isset ( $ this -> blocks [ $ name ] ) ) {... | Displays a block . |
40,457 | public function renderParentBlock ( $ name , array $ context , array $ blocks = array ( ) ) { ob_start ( ) ; $ this -> displayParentBlock ( $ name , $ context , $ blocks ) ; return ob_get_clean ( ) ; } | Renders a parent block . |
40,458 | final protected function getContext ( $ context , $ item , $ ignoreStrictCheck = false ) { if ( ! array_key_exists ( $ item , $ context ) ) { if ( $ ignoreStrictCheck || ! $ this -> env -> isStrictVariables ( ) ) { return null ; } throw new Twig_Error_Runtime ( sprintf ( 'Variable "%s" does not exist' , $ item ) , - 1 ... | Returns a variable from the context . |
40,459 | function getFont ( ) { $ dyHeight = $ this -> _size * 20 ; $ icv = $ this -> _color ; $ bls = $ this -> _bold ; $ sss = $ this -> _font_script ; $ uls = $ this -> _underline ; $ bFamily = $ this -> _font_family ; $ bCharSet = $ this -> _font_charset ; $ encoding = 0 ; $ cch = strlen ( $ this -> _font_name ) ; $ record ... | Generate an Excel BIFF FONT record . |
40,460 | function _getColor ( $ name_color = '' ) { $ colors = array ( 'aqua' => 0x0F , 'cyan' => 0x0F , 'black' => 0x08 , 'blue' => 0x0C , 'brown' => 0x10 , 'magenta' => 0x0E , 'fuchsia' => 0x0E , 'gray' => 0x17 , 'grey' => 0x17 , 'green' => 0x11 , 'lime' => 0x0B , 'navy' => 0x12 , 'orange' => 0x35 , 'purple' => 0x14 , 'red' =... | Used in conjunction with the set_xxx_color methods to convert a color string into a number . Color range is 0 .. 63 but we will restrict it to 8 .. 63 to comply with Gnumeric . Colors 0 .. 7 are repeated in 8 .. 15 . |
40,461 | function setAlign ( $ location ) { if ( preg_match ( "/\d/" , $ location ) ) { return ; } $ location = strtolower ( $ location ) ; if ( $ location == 'left' ) { $ this -> _text_h_align = 1 ; } if ( $ location == 'centre' ) { $ this -> _text_h_align = 2 ; } if ( $ location == 'center' ) { $ this -> _text_h_align = 2 ; }... | Set cell alignment . |
40,462 | function setHAlign ( $ location ) { if ( preg_match ( "/\d/" , $ location ) ) { return ; } $ location = strtolower ( $ location ) ; if ( $ location == 'left' ) { $ this -> _text_h_align = 1 ; } if ( $ location == 'centre' ) { $ this -> _text_h_align = 2 ; } if ( $ location == 'center' ) { $ this -> _text_h_align = 2 ; ... | Set cell horizontal alignment . |
40,463 | function setVAlign ( $ location ) { if ( preg_match ( "/\d/" , $ location ) ) { return ; } $ location = strtolower ( $ location ) ; if ( $ location == 'top' ) { $ this -> _text_v_align = 0 ; } if ( $ location == 'vcentre' ) { $ this -> _text_v_align = 1 ; } if ( $ location == 'vcenter' ) { $ this -> _text_v_align = 1 ;... | Set cell vertical alignment . |
40,464 | function setBorderColor ( $ color ) { $ this -> setBottomColor ( $ color ) ; $ this -> setTopColor ( $ color ) ; $ this -> setLeftColor ( $ color ) ; $ this -> setRightColor ( $ color ) ; } | Sets all the cell s borders to the same color |
40,465 | function setFgColor ( $ color ) { $ value = $ this -> _getColor ( $ color ) ; $ this -> _fg_color = $ value ; if ( $ this -> _pattern == 0 ) { $ this -> _pattern = 1 ; } } | Sets the cell s foreground color |
40,466 | function setBgColor ( $ color ) { $ value = $ this -> _getColor ( $ color ) ; $ this -> _bg_color = $ value ; if ( $ this -> _pattern == 0 ) { $ this -> _pattern = 1 ; } } | Sets the cell s background color |
40,467 | function setTextRotation ( $ angle ) { switch ( $ angle ) { case 0 : $ this -> _rotation = 0 ; break ; case 90 : if ( $ this -> _BIFF_version == 0x0500 ) { $ this -> _rotation = 3 ; } elseif ( $ this -> _BIFF_version == 0x0600 ) { $ this -> _rotation = 180 ; } break ; case 270 : if ( $ this -> _BIFF_version == 0x0500 )... | Sets the orientation of the text |
40,468 | static function Dispatch ( $ phreezer , $ renderEngine , $ action = '' , $ context = null , $ router = null ) { if ( $ router == null ) { require_once ( 'GenericRouter.php' ) ; $ router = new GenericRouter ( ) ; } list ( $ controller_param , $ method_param ) = $ router -> GetRoute ( $ action ) ; $ controller_class = $ ... | Processes user input and executes the specified controller method ensuring that the controller dependencies are all injected properly |
40,469 | function Connect ( ) { $ this -> handler -> Log ( DBH_LOG_INFO , "Opening Connection..." ) ; if ( $ this -> dbopen ) { $ this -> handler -> Log ( DBH_LOG_WARNING , "Connection Already Open" ) ; } else { $ this -> adapter = new DataAdapter ( $ this -> csetting ) ; try { $ this -> adapter -> Open ( ) ; } catch ( Exceptio... | Opens a connection to the MySQL Server and selects the specified database |
40,470 | function Disconnect ( ) { $ this -> handler -> Log ( DBH_LOG_INFO , "Closing Connection..." ) ; if ( $ this -> dbopen ) { $ this -> adapter -> Close ( ) ; $ this -> dbopen = false ; $ this -> handler -> Log ( DBH_LOG_INFO , "Connection closed" ) ; } else { $ this -> handler -> Log ( DBH_LOG_WARNING , "Connection Alread... | Closing the connection to the MySQL Server |
40,471 | function Select ( $ sql ) { $ this -> RequireConnection ( true ) ; $ this -> handler -> Log ( DBH_LOG_QUERY , "Executing Query" , $ sql ) ; return $ this -> adapter -> Select ( $ sql ) ; } | Executes a SQL select statement and returns a MySQL resultset |
40,472 | function Next ( $ rs ) { $ this -> RequireConnection ( ) ; $ this -> handler -> Log ( DBH_LOG_DEBUG , "Fetching next result as array" ) ; return $ this -> adapter -> Fetch ( $ rs ) ; } | Moves the database curser forward and returns the current row as an associative array |
40,473 | function Release ( $ rs ) { $ this -> RequireConnection ( ) ; $ this -> handler -> Log ( DBH_LOG_DEBUG , "Releasing result resources" ) ; return $ this -> adapter -> Release ( $ rs ) ; } | Releases the resources for the given resultset |
40,474 | public static function runFilter ( $ type , $ content , Smarty_Internal_Template $ template ) { $ output = $ content ; if ( ! empty ( $ template -> smarty -> autoload_filters [ $ type ] ) ) { foreach ( ( array ) $ template -> smarty -> autoload_filters [ $ type ] as $ name ) { $ plugin_name = "Smarty_{$type}filter_{$na... | Run filters over content |
40,475 | public function setFormatCode ( $ pValue = PHPExcel_Style_NumberFormat :: FORMAT_GENERAL ) { if ( $ pValue == '' ) { $ pValue = PHPExcel_Style_NumberFormat :: FORMAT_GENERAL ; } if ( $ this -> _isSupervisor ) { $ styleArray = $ this -> getStyleArray ( array ( 'code' => $ pValue ) ) ; $ this -> getActiveSheet ( ) -> get... | Set Format Code |
40,476 | public function setBuiltInFormatCode ( $ pValue = 0 ) { if ( $ this -> _isSupervisor ) { $ styleArray = $ this -> getStyleArray ( array ( 'code' => self :: builtInFormatCode ( $ pValue ) ) ) ; $ this -> getActiveSheet ( ) -> getStyle ( $ this -> getSelectedCells ( ) ) -> applyFromArray ( $ styleArray ) ; } else { $ thi... | Set Built - In Format Code |
40,477 | public function writeDebugLog ( ) { if ( $ this -> _writeDebugLog ) { $ message = implode ( func_get_args ( ) ) ; $ cellReference = implode ( ' -> ' , $ this -> _cellStack -> showStack ( ) ) ; if ( $ this -> _echoDebugLog ) { echo $ cellReference , ( $ this -> _cellStack -> count ( ) > 0 ? ' => ' : '' ) , $ message , P... | Write an entry to the calculation engine debug log |
40,478 | public function AddFilter ( CriteriaFilter $ filter ) { if ( ! $ this -> Filters ) $ this -> Filters = array ( ) ; $ this -> Filters [ ] = $ filter ; } | Add a CriteriaFilter to the criteria for custom filtering of results |
40,479 | public function Reset ( ) { $ this -> _is_prepared = false ; $ this -> _where = $ this -> _constructor_where ; $ this -> _order = $ this -> _constructor_order ; } | Reset the Criteria for re - use . This is called by querybuilder after the criteria has been used to generate SQL . It can be called manually as well . |
40,480 | public function SetOrder ( $ property , $ desc = false ) { if ( ! $ property ) { return ; } $ this -> _order_delim = ( $ this -> _set_order ) ? "," : "" ; if ( $ property == '?' ) { $ this -> _set_order = "RAND()" . $ this -> _order_delim . $ this -> _set_order ; } else { $ colname = $ this -> GetFieldFromProp ( $ prop... | Adds an object property to the order by clause . If any sorting needs to be done on foreign tables then for the moment you need to override this method and handle it manually . You can call this method repeatedly to add more than one property for sorting . |
40,481 | public function IncludeMap ( $ objectclass ) { try { Includer :: RequireClass ( $ objectclass , "Model/DAO/" ) ; } catch ( IncludeException $ ex ) { throw new Exception ( $ ex -> getMessage ( ) . '. If a map file does not exist then ' . get_class ( $ this ) . ' can implement GetFieldFromProp instead.' ) ; } } | If the map class is not already defined attempts to require_once the definition . If the Map file cannot be located an exception is thrown |
40,482 | public static function _wrapResult ( $ value ) { if ( is_string ( $ value ) ) { if ( preg_match ( '/^' . self :: CALCULATION_REGEXP_ERROR . '$/i' , $ value , $ match ) ) { return $ value ; } return '"' . $ value . '"' ; } else if ( ( is_float ( $ value ) ) && ( ( is_nan ( $ value ) ) || ( is_infinite ( $ value ) ) ) ) ... | Wrap string values in quotes |
40,483 | public static function _unwrapResult ( $ value ) { if ( is_string ( $ value ) ) { if ( ( isset ( $ value { 0 } ) ) && ( $ value { 0 } == '"' ) && ( substr ( $ value , - 1 ) == '"' ) ) { return substr ( $ value , 1 , - 1 ) ; } } else if ( ( is_float ( $ value ) ) && ( ( is_nan ( $ value ) ) || ( is_infinite ( $ value ) ... | Remove quotes used as a wrapper to identify string values |
40,484 | public function parseFormula ( $ formula ) { $ formula = trim ( $ formula ) ; if ( ( ! isset ( $ formula { 0 } ) ) || ( $ formula { 0 } != '=' ) ) return array ( ) ; $ formula = ltrim ( substr ( $ formula , 1 ) ) ; if ( ! isset ( $ formula { 0 } ) ) return array ( ) ; return $ this -> _parseFormula ( $ formula ) ; } | Validate and parse a formula string |
40,485 | public function GetFiles ( $ pattern = "" ) { $ files = Array ( ) ; $ dh = opendir ( $ this -> Path ) ; while ( $ fname = readdir ( $ dh ) ) { if ( is_file ( $ this -> Path . $ fname ) ) { if ( $ pattern == "" || preg_match ( $ pattern , $ fname ) > 0 ) { $ files [ ] = new FileHelper ( $ this -> Path . $ fname ) ; } } ... | Returns an array of FileHelper objects |
40,486 | public function push ( $ type , $ value , $ reference = NULL ) { $ this -> _stack [ $ this -> _count ++ ] = array ( 'type' => $ type , 'value' => $ value , 'reference' => $ reference ) ; if ( $ type == 'Function' ) { $ localeFunction = PHPExcel_Calculation :: _localeFunc ( $ value ) ; if ( $ localeFunction != $ value )... | Push a new entry onto the stack |
40,487 | public function last ( $ n = 1 ) { if ( $ this -> _count - $ n < 0 ) { return NULL ; } return $ this -> _stack [ $ this -> _count - $ n ] ; } | Return an entry from the stack without removing it |
40,488 | public function LoadDefaults ( ) { $ fms = $ this -> _phreezer -> GetFieldMaps ( get_class ( $ this ) ) ; foreach ( $ fms as $ fm ) { $ prop = $ fm -> PropertyName ; $ this -> $ prop = $ fm -> DefaultValue ; } } | LoadDefaults is called during construction if this object is not instantiated with a DB row . The default values as specified in the fieldmap are loaded |
40,489 | public function LoadFromObject ( $ src ) { $ this -> IsLoaded ( true ) ; $ src_cls = get_class ( $ src ) ; foreach ( get_object_vars ( $ this ) as $ key => $ val ) { if ( substr ( $ key , 0 , 1 ) != "_" ) { if ( property_exists ( $ src_cls , $ key ) ) { $ this -> $ key = $ src -> $ key ; $ this -> IsPartiallyLoaded ( t... | LoadFromObject allows this class to be populated from another class so long as the properties are compatible . This is useful when using reporters so that you can easily convert them to phreezable objects . Be sure to check that IsLoaded is true before attempting to save this object . |
40,490 | public function Validate ( ) { $ this -> ResetValidationErrors ( ) ; $ is_valid = ( ! $ this -> HasValidationErrors ( ) ) ; if ( ! $ is_valid ) { $ this -> _phreezer -> DeleteCache ( get_class ( $ this ) , $ this -> GetPrimaryKeyValue ( ) ) ; } return $ is_valid ; } | Validate returns true if the properties all contain valid values . If not use GetValidationErrors to see which fields have invalid values . |
40,491 | final function Refresh ( & $ phreezer , $ row = null ) { $ this -> _phreezer = $ phreezer ; foreach ( $ this -> _cache as $ child ) { if ( in_array ( "Phreezable" , class_parents ( $ child ) ) ) { $ child -> Refresh ( $ phreezer , $ row ) ; } } if ( $ row ) { $ this -> Load ( $ row ) ; } $ this -> OnRefresh ( ) ; } | Refresh the object in the event that it has been saved to the session or serialized |
40,492 | public function GetCache ( $ key ) { return ( array_key_exists ( $ key , $ this -> _cache ) ? $ this -> _cache [ $ key ] : null ) ; } | Returns a value from the local cache |
40,493 | public function getBasename ( Smarty_Template_Source $ source ) { $ _file = $ source -> name ; if ( ( $ _pos = strpos ( $ _file , ']' ) ) !== false ) { $ _file = substr ( $ _file , $ _pos + 1 ) ; } return basename ( $ _file ) ; } | Determine basename for compiled filename |
40,494 | public function install ( ) { parent :: install ( ) ; any_db_query ( "ALTER TABLE oauth_consumer_registry MODIFY ocr_usa_id_ref int(11) unsigned" ) ; any_db_query ( "ALTER TABLE oauth_consumer_token MODIFY oct_usa_id_ref int(11) unsigned not null" ) ; any_db_query ( "ALTER TABLE oauth_server_registry MODIFY osr_us... | Initialise the database |
40,495 | public function getFormattedValue ( ) { return ( string ) PHPExcel_Style_NumberFormat :: toFormattedString ( $ this -> getCalculatedValue ( ) , $ this -> getWorksheet ( ) -> getParent ( ) -> getCellXfByIndex ( $ this -> getXfIndex ( ) ) -> getNumberFormat ( ) -> getFormatCode ( ) ) ; } | Get cell value with formatting |
40,496 | public static function absoluteReference ( $ pCoordinateString = 'A1' ) { if ( strpos ( $ pCoordinateString , ':' ) === FALSE && strpos ( $ pCoordinateString , ',' ) === FALSE ) { $ worksheet = '' ; $ cellAddress = explode ( '!' , $ pCoordinateString ) ; if ( count ( $ cellAddress ) > 1 ) { list ( $ worksheet , $ pCoor... | Make string row column or cell coordinate absolute |
40,497 | public static function absoluteCoordinate ( $ pCoordinateString = 'A1' ) { if ( strpos ( $ pCoordinateString , ':' ) === FALSE && strpos ( $ pCoordinateString , ',' ) === FALSE ) { $ worksheet = '' ; $ cellAddress = explode ( '!' , $ pCoordinateString ) ; if ( count ( $ cellAddress ) > 1 ) { list ( $ worksheet , $ pCoo... | Make string coordinate absolute |
40,498 | public static function columnIndexFromString ( $ pString = 'A' ) { static $ _indexCache = array ( ) ; if ( isset ( $ _indexCache [ $ pString ] ) ) return $ _indexCache [ $ pString ] ; static $ _columnLookup = array ( 'A' => 1 , 'B' => 2 , 'C' => 3 , 'D' => 4 , 'E' => 5 , 'F' => 6 , 'G' => 7 , 'H' => 8 , 'I' => 9 , 'J' ... | Column index from string |
40,499 | public static function stringFromColumnIndex ( $ pColumnIndex = 0 ) { static $ _indexCache = array ( ) ; if ( ! isset ( $ _indexCache [ $ pColumnIndex ] ) ) { if ( $ pColumnIndex < 26 ) { $ _indexCache [ $ pColumnIndex ] = chr ( 65 + $ pColumnIndex ) ; } elseif ( $ pColumnIndex < 702 ) { $ _indexCache [ $ pColumnIndex ... | String from columnindex |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.