idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
40,000 | function setRelatedTo ( $ relid , $ params = FALSE ) { $ relation = array ( ) ; if ( ( '<' == substr ( $ relid , 0 , 1 ) ) && ( '>' == substr ( $ relid , - 1 ) ) ) $ relid = substr ( $ relid , 1 , ( strlen ( $ relid ) - 2 ) ) ; $ relation [ 'value' ] = $ relid ; $ relation [ 'params' ] = $ this -> _setParams ( $ params... | set calendar component property related - to |
40,001 | function createRepeat ( ) { $ cnt = count ( $ this -> repeat ) ; if ( 0 >= $ cnt ) return ; $ attributes = $ this -> _createParams ( $ this -> repeat [ 'params' ] ) ; return $ this -> _createElement ( 'REPEAT' , $ attributes , $ this -> repeat [ 'value' ] ) ; } | creates formatted output for calendar component property repeat |
40,002 | function createRequestStatus ( ) { $ cnt = count ( $ this -> requeststatus ) ; if ( 0 >= $ cnt ) return ; $ output = null ; foreach ( $ this -> requeststatus as $ rstat ) { $ attributes = $ this -> _createParams ( $ rstat [ 'params' ] , array ( 'LANGUAGE' ) ) ; $ content = number_format ( ( float ) $ rstat [ 'value' ] ... | creates formatted output for calendar component property request - status |
40,003 | function setRequestStatus ( $ statcode , $ text , $ extdata = FALSE , $ params = FALSE ) { $ input = array ( ) ; $ input [ 'value' ] [ 'statcode' ] = $ statcode ; $ input [ 'value' ] [ 'text' ] = $ text ; if ( $ extdata ) $ input [ 'value' ] [ 'extdata' ] = $ extdata ; $ input [ 'params' ] = $ this -> _setParams ( $ pa... | set calendar component property request - status |
40,004 | function createResources ( ) { if ( 0 >= count ( $ this -> resources ) ) return ; $ output = null ; foreach ( $ this -> resources as $ resource ) { $ attributes = $ this -> _createParams ( $ resource [ 'params' ] , array ( 'ALTREP' , 'LANGUAGE' ) ) ; if ( is_array ( $ resource [ 'value' ] ) ) { foreach ( $ resource [ '... | creates formatted output for calendar component property resources |
40,005 | function setResources ( $ value , $ params = FALSE ) { $ input = array ( ) ; $ input [ 'value' ] = $ value ; $ input [ 'params' ] = $ this -> _setParams ( $ params ) ; $ this -> resources [ ] = $ input ; } | set calendar component property recources |
40,006 | function createRrule ( ) { $ cnt = count ( $ this -> rrule ) ; if ( 0 >= $ cnt ) return ; return $ this -> _format_recur ( 'RRULE' , $ this -> rrule ) ; } | creates formatted output for calendar component property rrule |
40,007 | function setRrule ( $ rruleset , $ params = FALSE ) { $ exrule = array ( ) ; foreach ( $ rruleset as $ rrulelabel => $ rrulevalue ) { $ rrulelabel = strtoupper ( $ rrulelabel ) ; if ( 'UNTIL' != $ rrulelabel ) $ rrule [ 'value' ] [ $ rrulelabel ] = $ rrulevalue ; elseif ( is_array ( $ rrulevalue ) && ( ( 3 == count ( $... | set calendar component property rrule |
40,008 | function createSequence ( ) { $ cnt = count ( $ this -> sequence ) ; if ( 0 >= $ cnt ) return ; $ attributes = $ this -> _createParams ( $ this -> sequence [ 'params' ] ) ; return $ this -> _createElement ( 'SEQUENCE' , $ attributes , $ this -> sequence [ 'value' ] ) ; } | creates formatted output for calendar component property sequence |
40,009 | function setSequence ( $ value = FALSE , $ params = FALSE ) { if ( ! $ value ) $ value = $ this -> getProperty ( 'sequence' ) + 1 ; $ this -> sequence [ 'value' ] = $ value ; $ this -> sequence [ 'params' ] = $ this -> _setParams ( $ params ) ; } | set calendar component property sequence |
40,010 | function createStatus ( ) { $ cnt = count ( $ this -> status ) ; if ( 0 >= $ cnt ) return ; $ attributes = $ this -> _createParams ( $ this -> status [ 'params' ] ) ; return $ this -> _createElement ( 'STATUS' , $ attributes , $ this -> status [ 'value' ] ) ; } | creates formatted output for calendar component property status |
40,011 | function setStatus ( $ value , $ params = FALSE ) { $ this -> status [ 'value' ] = $ value ; $ this -> status [ 'params' ] = $ this -> _setParams ( $ params ) ; } | set calendar component property status |
40,012 | function createSummary ( ) { $ cnt = count ( $ this -> summary ) ; if ( 0 >= $ cnt ) return ; $ attributes = $ this -> _createParams ( $ this -> summary [ 'params' ] , array ( 'ALTREP' , 'LANGUAGE' ) ) ; $ content = $ this -> _strrep ( $ this -> summary [ 'value' ] ) ; return $ this -> _createElement ( 'SUMMARY' , $ at... | creates formatted output for calendar component property summary |
40,013 | function setSummary ( $ value , $ params = FALSE ) { $ this -> summary [ 'value' ] = $ value ; $ this -> summary [ 'params' ] = $ this -> _setParams ( $ params ) ; } | set calendar component property summary |
40,014 | function createTransp ( ) { $ cnt = count ( $ this -> transp ) ; if ( 0 >= $ cnt ) return ; $ attributes = $ this -> _createParams ( $ this -> transp [ 'params' ] ) ; return $ this -> _createElement ( 'TRANSP' , $ attributes , $ this -> transp [ 'value' ] ) ; } | creates formatted output for calendar component property transp |
40,015 | function createTrigger ( ) { $ cnt = count ( $ this -> trigger ) ; if ( 0 >= $ cnt ) return ; $ content = $ attributes = null ; if ( isset ( $ this -> trigger [ 'value' ] [ 'year' ] ) && isset ( $ this -> trigger [ 'value' ] [ 'month' ] ) && isset ( $ this -> trigger [ 'value' ] [ 'day' ] ) ) $ content .= $ this -> _fo... | creates formatted output for calendar component property trigger |
40,016 | function createTzid ( ) { $ cnt = count ( $ this -> tzid ) ; if ( 0 >= $ cnt ) return ; $ attributes = $ this -> _createParams ( $ this -> tzid [ 'params' ] ) ; return $ this -> _createElement ( 'TZID' , $ attributes , $ this -> _strrep ( $ this -> tzid [ 'value' ] ) ) ; } | creates formatted output for calendar component property tzid |
40,017 | function setTzid ( $ value , $ params = FALSE ) { if ( empty ( $ value ) ) return ; $ this -> tzid [ 'value' ] = $ value ; $ this -> tzid [ 'params' ] = $ this -> _setParams ( $ params ) ; } | set calendar component property tzid |
40,018 | function createTzname ( ) { $ cnt = count ( $ this -> tzname ) ; if ( 0 >= $ cnt ) return ; $ output = null ; foreach ( $ this -> tzname as $ theName ) { $ attributes = $ this -> _createParams ( $ theName [ 'params' ] , array ( 'LANGUAGE' ) ) ; $ output .= $ this -> _createElement ( 'TZNAME' , $ attributes , $ this -> ... | creates formatted output for calendar component property tzname |
40,019 | function setTzname ( $ value , $ params = FALSE ) { if ( empty ( $ value ) ) return ; $ input [ 'value' ] = $ value ; $ input [ 'params' ] = $ this -> _setParams ( $ params ) ; $ this -> tzname [ ] = $ input ; } | set calendar component property tzname |
40,020 | function createTzoffsetfrom ( ) { $ cnt = count ( $ this -> tzoffsetfrom ) ; if ( 0 >= $ cnt ) return ; $ attributes = $ this -> _createParams ( $ this -> tzoffsetfrom [ 'params' ] ) ; return $ this -> _createElement ( 'TZOFFSETFROM' , $ attributes , $ this -> tzoffsetfrom [ 'value' ] ) ; } | creates formatted output for calendar component property tzoffsetfrom |
40,021 | function setTzoffsetfrom ( $ value , $ params = FALSE ) { $ this -> tzoffsetfrom [ 'value' ] = $ value ; if ( empty ( $ this -> tzoffsetfrom [ 'value' ] ) ) return ; $ this -> tzoffsetfrom [ 'params' ] = $ this -> _setParams ( $ params ) ; } | set calendar component property tzoffsetfrom |
40,022 | function createTzoffsetto ( ) { $ cnt = count ( $ this -> tzoffsetto ) ; if ( 0 >= $ cnt ) return ; $ attributes = $ this -> _createParams ( $ this -> tzoffsetto [ 'params' ] ) ; return $ this -> _createElement ( 'TZOFFSETTO' , $ attributes , $ this -> tzoffsetto [ 'value' ] ) ; } | creates formatted output for calendar component property tzoffsetto |
40,023 | function setTzoffsetto ( $ value , $ params = FALSE ) { $ this -> tzoffsetto [ 'value' ] = $ value ; if ( empty ( $ this -> tzoffsetto [ 'value' ] ) ) return ; $ this -> tzoffsetto [ 'params' ] = $ this -> _setParams ( $ params ) ; } | set calendar component property tzoffsetto |
40,024 | function createTzurl ( ) { $ cnt = count ( $ this -> tzurl ) ; if ( 0 >= $ cnt ) return ; $ attributes = $ this -> _createParams ( $ this -> tzurl [ 'params' ] ) ; return $ this -> _createElement ( 'TZURL' , $ attributes , $ this -> tzurl [ 'value' ] ) ; } | creates formatted output for calendar component property tzurl |
40,025 | function setTzurl ( $ value , $ params = FALSE ) { $ this -> tzurl [ 'value' ] = $ value ; if ( empty ( $ this -> tzurl [ 'value' ] ) ) return ; $ this -> tzurl [ 'params' ] = $ this -> _setParams ( $ params ) ; } | set calendar component property tzurl |
40,026 | function createUid ( ) { $ cnt = count ( $ this -> uid ) ; if ( 0 >= $ cnt ) { $ this -> _makeuid ( ) ; } $ attributes = $ this -> _createParams ( $ this -> uid [ 'params' ] ) ; return $ this -> _createElement ( 'UID' , $ attributes , $ this -> uid [ 'value' ] ) ; } | creates formatted output for calendar component property uid |
40,027 | function _makeUid ( ) { $ date = date ( 'Ymd\THisT' ) ; $ unique = substr ( microtime ( ) , 2 , 4 ) ; $ base = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPrRsStTuUvVxXuUvVwWzZ1234567890' ; $ start = 0 ; $ end = strlen ( $ base ) - 1 ; $ length = 6 ; $ str = null ; for ( $ p = 0 ; $ p < $ length ; $ p ++ ) $ unique .= $ base { mt_... | create an unique id for this calendar component object instance |
40,028 | function setUid ( $ value , $ params = FALSE ) { $ this -> uid [ 'value' ] = $ value ; if ( empty ( $ this -> uid [ 'value' ] ) ) return ; $ this -> uid [ 'params' ] = $ this -> _setParams ( $ params ) ; } | set calendar component property uid |
40,029 | function createUrl ( ) { $ cnt = count ( $ this -> url ) ; if ( 0 >= $ cnt ) return ; $ attributes = $ this -> _createParams ( $ this -> url [ 'params' ] ) ; return $ this -> _createElement ( 'URL' , $ attributes , $ this -> url [ 'value' ] ) ; } | creates formatted output for calendar component property url |
40,030 | function setUrl ( $ value , $ params = FALSE ) { $ this -> url [ 'value' ] = $ value ; if ( empty ( $ this -> url [ 'value' ] ) ) return ; $ this -> url [ 'params' ] = $ this -> _setParams ( $ params ) ; } | set calendar component property url |
40,031 | function createXprop ( ) { if ( 0 >= count ( $ this -> xprop ) ) return ; $ xprop = null ; foreach ( $ this -> xprop as $ label => $ xpropPart ) { $ attributes = $ this -> _createParams ( $ xpropPart [ 'params' ] , array ( 'LANGUAGE' ) ) ; if ( is_array ( $ xpropPart [ 'value' ] ) ) { foreach ( $ xpropPart [ 'value' ] ... | creates formatted output for calendar component property x - prop |
40,032 | function _createFormat ( ) { $ objectname = null ; switch ( $ this -> format ) { case 'xcal' : $ objectname = ( isset ( $ this -> timezonetype ) ) ? strtolower ( $ this -> timezonetype ) : strtolower ( $ this -> objName ) ; $ this -> componentStart1 = $ this -> elementStart1 = '<' ; $ this -> componentStart2 = $ this -... | create element format parts |
40,033 | function _createParams ( $ params = array ( ) , $ ctrKeys = array ( ) ) { $ attrLANG = $ attr1 = $ attr2 = null ; $ CNattrKey = ( in_array ( 'CN' , $ ctrKeys ) ) ? TRUE : FALSE ; $ LANGattrKey = ( in_array ( 'LANGUAGE' , $ ctrKeys ) ) ? TRUE : FALSE ; $ CNattrExist = $ LANGattrExist = FALSE ; if ( is_array ( $ params )... | creates formatted output for calendar component property parameters |
40,034 | function _duration_array ( $ duration ) { $ output = array ( ) ; if ( is_array ( $ duration ) && ( 1 == count ( $ duration ) ) && isset ( $ duration [ 'sec' ] ) && ( 60 < $ duration [ 'sec' ] ) ) { $ durseconds = $ duration [ 'sec' ] ; $ output [ 'week' ] = floor ( $ durseconds / ( 60 * 60 * 24 * 7 ) ) ; $ durseconds =... | ensures internal duration format for input in array format |
40,035 | function _duration_string ( $ duration ) { $ duration = ( string ) trim ( $ duration ) ; while ( 'P' != strtoupper ( substr ( $ duration , 0 , 1 ) ) ) { if ( 0 < strlen ( $ duration ) ) $ duration = substr ( $ duration , 1 ) ; else return false ; } $ duration = substr ( $ duration , 1 ) ; $ duration = str_replace ( 't'... | ensures internal duration format for input in string format |
40,036 | function _existRem ( & $ array , $ expkey , $ expval = FALSE , $ hitval = null ) { if ( ! is_array ( $ array ) || ( 0 == count ( $ array ) ) ) return null ; if ( ! isset ( $ array [ $ expkey ] ) ) return null ; if ( ! $ expval ) return $ hitval ; if ( $ expval != $ array [ $ expkey ] ) return null ; unset ( $ array [ $... | if exist remove key with expected value from array and return spec . value |
40,037 | function _format_duration ( $ duration ) { if ( ! isset ( $ duration [ 'week' ] ) && ! isset ( $ duration [ 'day' ] ) && ! isset ( $ duration [ 'hour' ] ) && ! isset ( $ duration [ 'min' ] ) && ! isset ( $ duration [ 'sec' ] ) ) return ; $ output = 'P' ; if ( isset ( $ duration [ 'week' ] ) && ( 0 < $ duration [ 'week'... | creates formatted output for calendar component property data value type duration |
40,038 | function _format_recur ( $ recurlabel , $ recurdata ) { $ recur = null ; foreach ( $ recurdata as $ therule ) { $ attributes = ( isset ( $ therule [ 'params' ] ) ) ? $ this -> _createParams ( $ therule [ 'params' ] ) : null ; $ content1 = $ content2 = null ; foreach ( $ therule [ 'value' ] as $ rulelabel => $ rulevalue... | creates formatted output for calendar component property data value type recur |
40,039 | function _stepdate ( & $ date , & $ timestamp , $ step = array ( 'day' => 1 ) ) { foreach ( $ step as $ stepix => $ stepvalue ) $ date [ $ stepix ] += $ stepvalue ; $ timestamp = $ this -> _date2timestamp ( $ date ) ; $ date = $ this -> _date_time_string ( date ( 'Y-m-d H:i:s' , $ timestamp ) , 6 ) ; foreach ( $ date a... | step date return updated date array and timpstamp |
40,040 | function setConfig ( $ config , $ value ) { switch ( strtoupper ( $ config ) ) { case 'ALLOWEMPTY' : $ this -> allowEmpty = $ value ; break ; case 'FORMAT' : $ value = trim ( $ value ) ; $ this -> format = $ value ; break ; case 'LANGUAGE' : $ value = trim ( $ value ) ; $ this -> language = $ value ; break ; case 'NL' ... | general component config setting |
40,041 | function copy ( ) { $ serialized_contents = serialize ( $ this ) ; $ copy = unserialize ( $ serialized_contents ) ; unset ( $ copy -> propix ) ; return $ copy ; } | return a copy of this component |
40,042 | function setComponent ( $ component , $ arg1 = FALSE , $ arg2 = FALSE ) { if ( '' >= $ component -> getConfig ( 'language' ) ) $ component -> setConfig ( 'language' , $ this -> getConfig ( 'language' ) ) ; $ component -> setConfig ( 'allowEmpty' , $ this -> getConfig ( 'allowEmpty' ) ) ; $ component -> setConfig ( 'nl'... | add calendar component as subcomponent to container for subcomponents |
40,043 | function createSubComponent ( ) { $ output = null ; foreach ( $ this -> components as $ component ) { if ( '' >= $ component -> getConfig ( 'language' ) ) $ component -> setConfig ( 'language' , $ this -> getConfig ( 'language' ) ) ; $ component -> setConfig ( 'allowEmpty' , $ this -> getConfig ( 'allowEmpty' ) ) ; $ c... | creates formatted output for subcomponents |
40,044 | function _size75 ( $ string ) { $ strlen = strlen ( $ string ) ; $ tmp = $ string ; $ string = null ; while ( $ strlen > 75 ) { $ breakAtChar = 75 ; if ( substr ( $ tmp , ( $ breakAtChar - 1 ) , strlen ( '\n' ) ) == '\n' ) $ breakAtChar = $ breakAtChar - 1 ; $ string .= substr ( $ tmp , 0 , $ breakAtChar ) ; $ string .... | break lines at pos 75 |
40,045 | function _strrep ( $ string ) { switch ( $ this -> format ) { case 'xcal' : $ string = str_replace ( '\n' , $ this -> nl , $ string ) ; $ string = htmlspecialchars ( strip_tags ( stripslashes ( urldecode ( $ string ) ) ) ) ; break ; default : $ pos = 0 ; while ( $ pos <= strlen ( $ string ) ) { $ pos = strpos ( $ strin... | special characters management output |
40,046 | function createComponent ( & $ xcaldecl ) { $ objectname = $ this -> _createFormat ( ) ; $ component = $ this -> componentStart1 . $ objectname . $ this -> componentStart2 . $ this -> nl ; $ component .= $ this -> createUid ( ) ; $ component .= $ this -> createDtstamp ( ) ; $ component .= $ this -> createAttendee ( ) ;... | create formatted output for calendar component VFREEBUSY object instance |
40,047 | function createComponent ( & $ xcaldecl ) { $ objectname = $ this -> _createFormat ( ) ; $ component = $ this -> componentStart1 . $ objectname . $ this -> componentStart2 . $ this -> nl ; $ component .= $ this -> createAction ( ) ; $ component .= $ this -> createAttach ( ) ; $ component .= $ this -> createAttendee ( )... | create formatted output for calendar component VALARM object instance |
40,048 | function vtimezone ( $ timezonetype = FALSE ) { if ( ! $ timezonetype ) $ this -> timezonetype = 'VTIMEZONE' ; else $ this -> timezonetype = strtoupper ( $ timezonetype ) ; $ this -> calendarComponent ( ) ; } | constructor for calendar component VTIMEZONE object |
40,049 | function createComponent ( & $ xcaldecl ) { $ objectname = $ this -> _createFormat ( ) ; $ component = $ this -> componentStart1 . $ objectname . $ this -> componentStart2 . $ this -> nl ; $ component .= $ this -> createTzid ( ) ; $ component .= $ this -> createLastModified ( ) ; $ component .= $ this -> createTzurl ( ... | create formatted output for calendar component VTIMEZONE object instance |
40,050 | public function assign_to_var ( ) { $ var = sprintf ( '$_tmp%d' , ++ Smarty_Internal_Templateparser :: $ prefix_number ) ; $ this -> parser -> compiler -> prefix_code [ ] = sprintf ( '<?php ob_start();?>%s<?php %s=ob_get_clean();?>' , $ this -> data , $ var ) ; return $ var ; } | Return complied code that loads the evaluated outout of buffer content into a temporary variable |
40,051 | public function GetConfigFileContents ( ) { if ( ! $ this -> configFileContents ) { $ this -> configFileContents = str_replace ( "\r\n" , "\n" , file_get_contents ( $ this -> configFilePath ) ) ; } return $ this -> configFileContents ; } | Return the text of the config file |
40,052 | private function GetProperty ( $ name ) { $ lines = explode ( "\n" , $ this -> GetConfigFileContents ( ) ) ; foreach ( $ lines as $ line ) { $ pair = explode ( "=" , trim ( $ line ) , 2 ) ; if ( $ pair [ 0 ] == $ name ) return isset ( $ pair [ 1 ] ) ? $ pair [ 1 ] : "" ; } throw new Exception ( "UNKNOWN PROPERTY $name"... | Return a property from the config file with the given name |
40,053 | public function GetTemplateFiles ( ) { $ files = array ( ) ; list ( $ nothing , $ data ) = explode ( "[files]" , $ this -> GetConfigFileContents ( ) , 2 ) ; if ( $ data ) { $ lines = explode ( "\n" , $ data ) ; foreach ( $ lines as $ line ) { if ( $ line ) $ files [ ] = new TemplateFile ( $ line ) ; } } return $ files ... | Returns an array of TemplateFile objects that will be used when generating an application |
40,054 | public function Analyze ( ) { $ cstring = $ this -> GetConnectionString ( ) ; $ handler = new DBEventHandler ( ) ; $ connection = new DBConnection ( $ cstring , $ handler ) ; $ server = new DBServer ( $ connection ) ; $ folder = new FolderHelper ( GlobalConfig :: $ APP_ROOT . '/code/' ) ; $ files = $ folder -> GetFiles... | Analyze the database schema and display a listing of tables and options |
40,055 | public static function VLOOKUP ( $ lookup_value , $ lookup_array , $ index_number , $ not_exact_match = true ) { $ lookup_value = PHPExcel_Calculation_Functions :: flattenSingleValue ( $ lookup_value ) ; $ index_number = PHPExcel_Calculation_Functions :: flattenSingleValue ( $ index_number ) ; $ not_exact_match = PHPEx... | VLOOKUP The VLOOKUP function searches for value in the left - most column of lookup_array and returns the value in the same row based on the index_number . |
40,056 | public function getAttribute ( $ name ) { if ( ! array_key_exists ( $ name , $ this -> attributes ) ) { throw new LogicException ( sprintf ( 'Attribute "%s" does not exist for Node "%s".' , $ name , get_class ( $ this ) ) ) ; } return $ this -> attributes [ $ name ] ; } | Gets an attribute . |
40,057 | public function getNode ( $ name ) { if ( ! array_key_exists ( $ name , $ this -> nodes ) ) { throw new LogicException ( sprintf ( 'Node "%s" does not exist for Node "%s".' , $ name , get_class ( $ this ) ) ) ; } return $ this -> nodes [ $ name ] ; } | Gets a node by name . |
40,058 | protected function fetch ( $ cid , $ resource_name = null , $ cache_id = null , $ compile_id = null , & $ content = null , & $ timestamp = null , $ resource_uid = null ) { $ t = $ this -> read ( array ( $ cid ) ) ; $ content = ! empty ( $ t [ $ cid ] ) ? $ t [ $ cid ] : null ; $ timestamp = null ; if ( $ content && ( $... | Fetch and prepare a cache object . |
40,059 | function _initialize ( ) { if ( $ this -> _using_tmpfile == false ) { return ; } if ( $ this -> _tmp_dir === '' && ini_get ( 'open_basedir' ) === false ) { $ this -> _using_tmpfile = false ; return new PEAR_Error ( 'Temp file could not be opened since open_basedir restriction in effect - please use setTmpDir() - using ... | Open a tmp file to store the majority of the Worksheet data . If this fails for example due to write permissions store the data in memory . This can be slow for large files . |
40,060 | function setMerge ( $ first_row , $ first_col , $ last_row , $ last_col ) { if ( ( $ last_row < $ first_row ) || ( $ last_col < $ first_col ) ) { return ; } $ this -> _merged_ranges [ ] = array ( $ first_row , $ first_col , $ last_row , $ last_col ) ; } | Sets a merged cell range |
40,061 | function setColumn ( $ firstcol , $ lastcol , $ width , $ format = null , $ hidden = 0 , $ level = 0 ) { $ this -> _colinfo [ ] = array ( $ firstcol , $ lastcol , $ width , $ format , $ hidden , $ level ) ; $ width = ( $ hidden ) ? 0 : $ width ; for ( $ col = $ firstcol ; $ col <= $ lastcol ; $ col ++ ) { $ this -> col... | Set the width of a single column or a range of columns . |
40,062 | function setSelection ( $ first_row , $ first_column , $ last_row , $ last_column ) { $ this -> _selection = array ( $ first_row , $ first_column , $ last_row , $ last_column ) ; } | Set which cell or cells are selected in a worksheet |
40,063 | function setHeader ( $ string , $ margin = 0.50 ) { if ( strlen ( $ string ) >= 255 ) { return ; } $ this -> _header = $ string ; $ this -> _margin_head = $ margin ; } | Set the page header caption and optional margin . |
40,064 | function setFooter ( $ string , $ margin = 0.50 ) { if ( strlen ( $ string ) >= 255 ) { return ; } $ this -> _footer = $ string ; $ this -> _margin_foot = $ margin ; } | Set the page footer caption and optional margin . |
40,065 | function setMargins ( $ margin ) { $ this -> setMarginLeft ( $ margin ) ; $ this -> setMarginRight ( $ margin ) ; $ this -> setMarginTop ( $ margin ) ; $ this -> setMarginBottom ( $ margin ) ; } | Set all the page margins to the same value in inches . |
40,066 | function repeatRows ( $ first_row , $ last_row = null ) { $ this -> title_rowmin = $ first_row ; if ( isset ( $ last_row ) ) { $ this -> title_rowmax = $ last_row ; } else { $ this -> title_rowmax = $ first_row ; } } | Set the rows to repeat at the top of each printed page . |
40,067 | function repeatColumns ( $ first_col , $ last_col = null ) { $ this -> title_colmin = $ first_col ; if ( isset ( $ last_col ) ) { $ this -> title_colmax = $ last_col ; } else { $ this -> title_colmax = $ first_col ; } } | Set the columns to repeat at the left hand side of each printed page . |
40,068 | function printArea ( $ first_row , $ first_col , $ last_row , $ last_col ) { $ this -> print_rowmin = $ first_row ; $ this -> print_colmin = $ first_col ; $ this -> print_rowmax = $ last_row ; $ this -> print_colmax = $ last_col ; } | Set the area of each worksheet that will be printed . |
40,069 | function fitToPages ( $ width , $ height ) { $ this -> _fit_page = 1 ; $ this -> _fit_width = $ width ; $ this -> _fit_height = $ height ; } | Set the vertical and horizontal number of pages that will define the maximum area printed . It doesn t seem to work with OpenOffice . |
40,070 | function setZoom ( $ scale = 100 ) { if ( $ scale < 10 || $ scale > 400 ) { $ this -> raiseError ( "Zoom factor $scale outside range: 10 <= zoom <= 400" ) ; $ scale = 100 ; } $ this -> _zoom = floor ( $ scale ) ; } | Set the worksheet zoom factor . |
40,071 | function setPrintScale ( $ scale = 100 ) { if ( $ scale < 10 || $ scale > 400 ) { $ this -> raiseError ( "Print scale $scale outside range: 10 <= zoom <= 400" ) ; $ scale = 100 ; } $ this -> _fit_page = 0 ; $ this -> _print_scale = floor ( $ scale ) ; } | Set the scale factor for the printed page . It turns off the fit to page option |
40,072 | function write ( $ row , $ col , $ token , $ format = null ) { if ( preg_match ( "/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/" , $ token ) ) { return $ this -> writeNumber ( $ row , $ col , $ token , $ format ) ; } elseif ( preg_match ( "/^[fh]tt?p:\/\//" , $ token ) ) { return $ this -> writeUrl ( $ row , $ col... | Map to the appropriate write method acording to the token recieved . |
40,073 | function writeRow ( $ row , $ col , $ val , $ format = null ) { $ retval = '' ; if ( is_array ( $ val ) ) { foreach ( $ val as $ v ) { if ( is_array ( $ v ) ) { $ this -> writeCol ( $ row , $ col , $ v , $ format ) ; } else { $ this -> write ( $ row , $ col , $ v , $ format ) ; } $ col ++ ; } } else { $ retval = new PE... | Write an array of values as a row |
40,074 | function _substituteCellref ( $ cell ) { $ cell = strtoupper ( $ cell ) ; if ( preg_match ( "/([A-I]?[A-Z]):([A-I]?[A-Z])/" , $ cell , $ match ) ) { list ( $ no_use , $ col1 ) = $ this -> _cellToRowcol ( $ match [ 1 ] . '1' ) ; list ( $ no_use , $ col2 ) = $ this -> _cellToRowcol ( $ match [ 2 ] . '1' ) ; return ( arra... | Substitute an Excel cell reference in A1 notation for zero based row and column values in an argument list . |
40,075 | function _encodePassword ( $ plaintext ) { $ password = 0x0000 ; $ i = 1 ; $ chars = preg_split ( '//' , $ plaintext , - 1 , PREG_SPLIT_NO_EMPTY ) ; foreach ( $ chars as $ char ) { $ value = ord ( $ char ) << $ i ; $ rotated_bits = $ value >> 15 ; $ value &= 0x7fff ; $ password ^= ( $ value | $ rotated_bits ) ; $ i ++ ... | Based on the algorithm provided by Daniel Rentz of OpenOffice . |
40,076 | function _checkRowCol ( $ row , $ col ) { if ( $ row >= $ this -> _xls_rowmax ) { return false ; } if ( $ col >= $ this -> _xls_colmax ) { return false ; } if ( $ row < $ this -> _dim_rowmin ) { $ this -> _dim_rowmin = $ row ; } if ( $ row > $ this -> _dim_rowmax ) { $ this -> _dim_rowmax = $ row ; } if ( $ col < $ thi... | Check row and col before writing to a cell and update the sheet s dimensions accordingly |
40,077 | function _storeColinfo ( $ col_array ) { if ( isset ( $ col_array [ 0 ] ) ) { $ colFirst = $ col_array [ 0 ] ; } if ( isset ( $ col_array [ 1 ] ) ) { $ colLast = $ col_array [ 1 ] ; } if ( isset ( $ col_array [ 2 ] ) ) { $ coldx = $ col_array [ 2 ] ; } else { $ coldx = 8.43 ; } if ( isset ( $ col_array [ 3 ] ) ) { $ fo... | Write BIFF record COLINFO to define column widths |
40,078 | function _storeMergedCells ( ) { if ( count ( $ this -> _merged_ranges ) == 0 ) { return ; } $ record = 0x00E5 ; $ length = 2 + count ( $ this -> _merged_ranges ) * 8 ; $ header = pack ( 'vv' , $ record , $ length ) ; $ data = pack ( 'v' , count ( $ this -> _merged_ranges ) ) ; foreach ( $ this -> _merged_ranges as $ r... | Store the MERGEDCELLS record for all ranges of merged cells |
40,079 | function _storeExterncount ( $ count ) { $ record = 0x0016 ; $ length = 0x0002 ; $ header = pack ( "vv" , $ record , $ length ) ; $ data = pack ( "v" , $ count ) ; $ this -> _prepend ( $ header . $ data ) ; } | Write BIFF record EXTERNCOUNT to indicate the number of external sheet references in a worksheet . |
40,080 | function _storeExternsheet ( $ sheetname ) { $ record = 0x0017 ; if ( $ this -> name == $ sheetname ) { $ sheetname = '' ; $ length = 0x02 ; $ cch = 1 ; $ rgch = 0x02 ; } else { $ length = 0x02 + strlen ( $ sheetname ) ; $ cch = strlen ( $ sheetname ) ; $ rgch = 0x03 ; } $ header = pack ( "vv" , $ record , $ length ) ;... | Writes the Excel BIFF EXTERNSHEET record . These references are used by formulas . A formula references a sheet name via an index . Since we store a reference to all of the external worksheets the EXTERNSHEET index is the same as the worksheet index . |
40,081 | function _storeSetup ( ) { $ record = 0x00A1 ; $ length = 0x0022 ; $ iPaperSize = $ this -> _paper_size ; $ iScale = $ this -> _print_scale ; $ iPageStart = 0x01 ; $ iFitWidth = $ this -> _fit_width ; $ iFitHeight = $ this -> _fit_height ; $ grbit = 0x00 ; $ iRes = 0x0258 ; $ iVRes = 0x0258 ; $ numHdr = $ this -> _marg... | Store the page setup SETUP BIFF record . |
40,082 | function _storeHbreak ( ) { if ( empty ( $ this -> _hbreaks ) ) { return ; } $ breaks = $ this -> _hbreaks ; sort ( $ breaks , SORT_NUMERIC ) ; if ( $ breaks [ 0 ] == 0 ) { array_shift ( $ breaks ) ; } $ record = 0x001b ; $ cbrk = count ( $ breaks ) ; if ( $ this -> _BIFF_version == 0x0600 ) { $ length = 2 + 6 * $ cbrk... | Write the HORIZONTALPAGEBREAKS BIFF record . |
40,083 | function _storeVbreak ( ) { if ( empty ( $ this -> _vbreaks ) ) { return ; } $ breaks = array_slice ( $ this -> _vbreaks , 0 , 1000 ) ; sort ( $ breaks , SORT_NUMERIC ) ; if ( $ breaks [ 0 ] == 0 ) { array_shift ( $ breaks ) ; } $ record = 0x001a ; $ cbrk = count ( $ breaks ) ; if ( $ this -> _BIFF_version == 0x0600 ) ... | Write the VERTICALPAGEBREAKS BIFF record . |
40,084 | function _storeObjPicture ( $ colL , $ dxL , $ rwT , $ dyT , $ colR , $ dxR , $ rwB , $ dyB ) { $ record = 0x005d ; $ length = 0x003c ; $ cObj = 0x0001 ; $ OT = 0x0008 ; $ id = 0x0001 ; $ grbit = 0x0614 ; $ cbMacro = 0x0000 ; $ Reserved1 = 0x0000 ; $ Reserved2 = 0x0000 ; $ icvBack = 0x09 ; $ icvFore = 0x09 ; $ fls = 0x... | Store the OBJ record that precedes an IMDATA record . This could be generalise to support other Excel objects . |
40,085 | function _processBitmap ( $ bitmap ) { $ bmp_fd = @ fopen ( $ bitmap , "rb" ) ; if ( ! $ bmp_fd ) { $ this -> raiseError ( "Couldn't import $bitmap" ) ; } $ data = fread ( $ bmp_fd , filesize ( $ bitmap ) ) ; if ( strlen ( $ data ) <= 0x36 ) { $ this -> raiseError ( "$bitmap doesn't contain enough data.\n" ) ; } $ iden... | Convert a 24 bit bitmap into the modified internal format used by Windows . This is described in BITMAPCOREHEADER and BITMAPCOREINFO structures in the MSDN library . |
40,086 | function _storeDataValidity ( ) { $ record = 0x01b2 ; $ length = 0x0012 ; $ grbit = 0x0002 ; $ horPos = 0x00000000 ; $ verPos = 0x00000000 ; $ objId = 0xffffffff ; $ header = pack ( 'vv' , $ record , $ length ) ; $ data = pack ( 'vVVVV' , $ grbit , $ horPos , $ verPos , $ objId , count ( $ this -> _dv ) ) ; $ this -> _... | Store the DVAL and DV records . |
40,087 | function Unserialize ( & $ serialized ) { $ tmp = unserialize ( base64_decode ( $ serialized ) ) ; $ this -> Type = $ tmp -> Type ; $ this -> Username = $ tmp -> Username ; $ this -> Password = $ tmp -> Password ; $ this -> ConnectionString = $ tmp -> ConnectionString ; $ this -> DBName = $ tmp -> DBName ; $ this -> Ty... | Populate info from serialized string |
40,088 | public function getRecipient ( $ nRecipient = 0 ) { if ( ! isset ( $ this -> _aDeviceTokens [ $ nRecipient ] ) ) { throw new ApnsPHP_Message_Exception ( "No recipient at index '{$nRecipient}'" ) ; } return $ this -> _aDeviceTokens [ $ nRecipient ] ; } | Get a recipient . |
40,089 | public function setCustomProperty ( $ sName , $ mValue ) { if ( trim ( $ sName ) == self :: APPLE_RESERVED_NAMESPACE ) { throw new ApnsPHP_Message_Exception ( "Property name '" . self :: APPLE_RESERVED_NAMESPACE . "' can not be used for custom property." ) ; } $ this -> _aCustomProperties [ trim ( $ sName ) ] = $ mValu... | Set a custom property . |
40,090 | public function getCustomPropertyValue ( ) { if ( ! is_array ( $ this -> _aCustomProperties ) ) { return ; } $ aKeys = array_keys ( $ this -> _aCustomProperties ) ; return $ this -> _aCustomProperties [ $ aKeys [ 0 ] ] ; } | Get the first custom property value . |
40,091 | public function getCustomProperty ( $ sName ) { if ( ! array_key_exists ( $ sName , $ this -> _aCustomProperties ) ) { throw new ApnsPHP_Message_Exception ( "No property exists with the specified name '{$sName}'." ) ; } return $ this -> _aCustomProperties [ $ sName ] ; } | Get the custom property value . |
40,092 | public function getPayload ( ) { $ sJSON = json_encode ( $ this -> _getPayload ( ) , defined ( 'JSON_UNESCAPED_UNICODE' ) ? JSON_UNESCAPED_UNICODE : 0 ) ; if ( ! defined ( 'JSON_UNESCAPED_UNICODE' ) && function_exists ( 'mb_convert_encoding' ) ) { $ sJSON = preg_replace_callback ( '~\\\\u([0-9a-f]{4})~i' , create_funct... | Convert the message in a JSON - encoded payload . |
40,093 | private function GetErrorMessage ( $ httpParsedResponseAr ) { $ errmsg = $ this -> GetArrayVal ( $ httpParsedResponseAr , "L_SHORTMESSAGE0" ) . ": " ; $ longmessage = $ this -> GetArrayVal ( $ httpParsedResponseAr , "L_LONGMESSAGE0" ) ; $ longmessage = str_replace ( "This%20transaction%20cannot%20be%20processed%2e" , "... | Given a response array attempt to return the most sensible error message . |
40,094 | private function GetArrayVal ( $ arr , $ key , $ not_defined_val = "" ) { return array_key_exists ( $ key , $ arr ) ? $ arr [ $ key ] : $ not_defined_val ; } | Util to return array values without throwing an undefined error |
40,095 | private function PPHttpPost ( $ methodName_ , $ nvpStr_ ) { $ API_UserName = urlencode ( $ this -> Username ) ; $ API_Password = urlencode ( $ this -> Password ) ; $ API_Signature = urlencode ( $ this -> Signature ) ; $ API_Endpoint = "https://api-3t.paypal.com/nvp" ; if ( "sandbox" === $ this -> environment || "beta-s... | Send HTTP POST Request . Throws an Exception if the server communication failed |
40,096 | static function Parse ( $ lines , $ delim = "=" , $ nameonly = false ) { $ return = array ( ) ; $ lines = str_replace ( "\r\n" , "\n" , $ lines ) ; $ lines = str_replace ( "\r" , "\n" , $ lines ) ; $ arr = explode ( "\n" , $ lines ) ; if ( $ lines == "" ) return $ return ; foreach ( $ arr as $ line ) { $ return [ ] = n... | Parses a string into an array of NameValue objects . |
40,097 | public function SendWithSocket ( $ deviceToken , $ message , $ alertSound = 'default' , $ unlockText = '' , $ badgeCount = 0 ) { $ gatewayUrl = $ this -> sandboxMode ? "ssl://gateway.sandbox.push.apple.com:2195" : "ssl://gateway.push.apple.com:2195" ; $ ctx = stream_context_create ( ) ; stream_context_set_option ( $ ct... | Send a push notification directly using a socket |
40,098 | private function getResponse ( $ fh , $ timeout = 5 , $ index = 0 ) { $ read = array ( $ fh ) ; $ write = NULL ; $ except = NULL ; $ num_changed_streams = stream_select ( $ read , $ write , $ except , 0 ) ; if ( $ num_changed_streams > 0 ) { $ errorResponse = fread ( $ fh , 6 ) ; $ reason = '' ; if ( $ errorResponse ) ... | Recursive function to check if there is anything in the stream to read . Will wait for up to |
40,099 | public function SendWithApns ( $ deviceToken , $ messageText , $ alertSound = 'default' , $ unlockText = '' , $ badgeCount = 0 ) { $ output = new stdClass ( ) ; $ output -> date = date ( 'Y-m-d H:i:s' ) ; $ output -> success = false ; $ output -> message = '' ; $ push = new ApnsPHP_Push ( $ this -> sandboxMode ? ApnsPH... | Send a push notification using ApnsPHP Library |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.