idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
18,000 | private function renderRowHtml ( ) { $ data = $ this -> getTable ( ) -> getData ( ) ; $ headers = $ this -> getTable ( ) -> getHeaders ( ) ; $ render = '' ; foreach ( $ data as $ rowData ) { $ this -> setActualRow ( $ rowData ) ; $ rowRender = '' ; foreach ( $ headers as $ name => $ options ) { $ rowRender .= $ this ->... | rendering row as a html |
18,001 | public function create ( $ user , $ repo , $ tagName , $ targetCommitish = '' , $ name = '' , $ body = '' , $ draft = false , $ preRelease = false ) { $ path = '/repos/' . $ user . '/' . $ repo . '/releases' ; $ data = json_encode ( array ( 'tag_name' => $ tagName , 'target_commitish' => $ targetCommitish , 'name' => $... | Method to create a release . |
18,002 | public function edit ( $ user , $ repo , $ releaseId , $ tagName , $ targetCommitish = null , $ name = null , $ body = null , $ draft = null , $ preRelease = null ) { $ path = '/repos/' . $ user . '/' . $ repo . '/releases/' . ( int ) $ releaseId ; $ data = new \ stdClass ; $ data -> tag_name = $ tagName ; if ( isset (... | Method to update a release . |
18,003 | public function getList ( $ user , $ repo , $ page = 0 , $ limit = 0 ) { $ path = '/repos/' . $ user . '/' . $ repo . '/releases' ; $ response = $ this -> processResponse ( $ this -> client -> get ( $ this -> fetchUrl ( $ path , $ page , $ limit ) ) ) ; $ releases = array ( ) ; if ( is_array ( $ response ) ) { foreach ... | Method to list all releases . |
18,004 | public function create ( $ owner , $ repo , $ tree , $ base_tree = '' ) { $ path = '/repos/' . $ owner . '/' . $ repo . '/git/trees' ; $ data = array ( ) ; $ data [ 'tree' ] = $ tree ; if ( $ base_tree ) { $ data [ 'base_tree' ] = $ base_tree ; } return $ this -> processResponse ( $ this -> client -> post ( $ this -> f... | Create a Tree . |
18,005 | public function createComment ( $ comment , $ message ) { $ data = array ( ) ; $ data [ 'message' ] = $ message ; return $ this -> createConnection ( $ comment , 'comments' , $ data ) ; } | Method to comment on a comment . Requires authentication with publish_stream permission . |
18,006 | public static function getHttp ( $ options = array ( ) , $ adapters = null ) { if ( ! $ driver = self :: getAvailableDriver ( $ options , $ adapters ) ) { throw new \ RuntimeException ( 'No transport driver available.' ) ; } return new Http ( $ options , $ driver ) ; } | Method to receive Http instance . |
18,007 | public static function getAvailableDriver ( $ options , $ default = null ) { if ( is_null ( $ default ) ) { $ availableAdapters = self :: getHttpTransports ( ) ; } else { settype ( $ default , 'array' ) ; $ availableAdapters = $ default ; } if ( ! count ( $ availableAdapters ) ) { return false ; } foreach ( $ available... | Finds an available http transport object for communication |
18,008 | public static function getHttpTransports ( ) { $ names = array ( ) ; $ iterator = new \ DirectoryIterator ( __DIR__ . '/Transport' ) ; foreach ( $ iterator as $ file ) { $ fileName = $ file -> getFilename ( ) ; if ( $ file -> isFile ( ) && $ file -> getExtension ( ) == 'php' ) { $ names [ ] = substr ( $ fileName , 0 , ... | Get the http transport handlers |
18,009 | public static function toInteger ( $ array , $ default = null ) { if ( is_array ( $ array ) ) { $ array = array_map ( 'intval' , $ array ) ; } else { if ( $ default === null ) { $ array = array ( ) ; } elseif ( is_array ( $ default ) ) { $ array = self :: toInteger ( $ default , null ) ; } else { $ array = array ( ( in... | Function to convert array to integer values |
18,010 | public function setDebug ( $ debug ) { $ previous = $ this -> debug ; $ this -> debug = ( boolean ) $ debug ; return $ previous ; } | Set the Debug property . |
18,011 | public static function sprintf ( $ string ) { $ lang = static :: getLanguage ( ) ; $ args = func_get_args ( ) ; $ count = count ( $ args ) ; if ( $ count > 0 ) { if ( is_array ( $ args [ $ count - 1 ] ) ) { $ args [ 0 ] = $ lang -> _ ( $ string , array_key_exists ( 'jsSafe' , $ args [ $ count - 1 ] ) ? $ args [ $ count... | Passes a string thru a sprintf . |
18,012 | public static function printf ( $ string ) { $ lang = static :: getLanguage ( ) ; $ args = func_get_args ( ) ; $ count = count ( $ args ) ; if ( $ count > 0 ) { if ( is_array ( $ args [ $ count - 1 ] ) ) { $ args [ 0 ] = $ lang -> _ ( $ string , array_key_exists ( 'jsSafe' , $ args [ $ count - 1 ] ) ? $ args [ $ count ... | Passes a string thru an printf . |
18,013 | public function blockUser ( $ user , $ entities = null , $ skip_status = null ) { $ this -> checkRateLimit ( 'blocks' , 'create' ) ; if ( is_numeric ( $ user ) ) { $ data [ 'user_id' ] = $ user ; } elseif ( is_string ( $ user ) ) { $ data [ 'screen_name' ] = $ user ; } else { throw new \ RuntimeException ( 'The specifi... | Method to block the specified user from following the authenticating user . |
18,014 | public static function files ( $ path , $ filter = '.' , $ recurse = false , $ full = false , $ exclude = array ( '.svn' , 'CVS' , '.DS_Store' , '__MACOSX' ) , $ excludefilter = array ( '^\..*' , '.*~' ) ) { $ path = Path :: clean ( $ path ) ; if ( ! is_dir ( $ path ) ) { Log :: add ( sprintf ( '%1$s: Path is not a fol... | Utility function to read the files in a folder . |
18,015 | public function setOptions ( $ options ) { if ( ! $ options instanceof ModuleOptions ) { $ options = new ModuleOptions ( $ options ) ; } $ this -> options = $ options ; return $ this ; } | Set module options |
18,016 | protected function initializable ( ) { if ( ! $ this -> getParamAdapter ( ) ) { throw new Exception \ LogicException ( 'Param Adapter is required' ) ; } if ( ! $ this -> getSource ( ) ) { throw new Exception \ LogicException ( 'Source data is required' ) ; } $ this -> init = true ; if ( count ( $ this -> headers ) ) { ... | Init configuration like setting header decorators filters and others |
18,017 | public function addHeader ( $ name , $ options ) { $ header = new Header ( $ name , $ options ) ; $ header -> setTable ( $ this ) ; $ this -> headersObjects [ $ name ] = $ header ; } | Add new header |
18,018 | public function remove ( $ dn , $ attribute ) { $ resource = $ this -> resource ; return @ ldap_mod_del ( $ resource , $ dn , $ attribute ) ; } | Removes attribute value from given dn and return a true or false result |
18,019 | public function compare ( $ dn , $ attribute , $ value ) { return @ ldap_compare ( $ this -> resource , $ dn , $ attribute , $ value ) ; } | Compare an entry and return a true or false result |
18,020 | public function read ( $ dn ) { $ base = substr ( $ dn , strpos ( $ dn , ',' ) + 1 ) ; $ cn = substr ( $ dn , 0 , strpos ( $ dn , ',' ) ) ; $ result = @ ldap_read ( $ this -> resource , $ base , $ cn ) ; if ( $ result ) { return @ ldap_get_entries ( $ this -> resource , $ result ) ; } else { return $ result ; } } | Read all or specified attributes of given dn |
18,021 | public function rename ( $ dn , $ newdn , $ newparent , $ deleteolddn ) { return @ ldap_rename ( $ this -> resource , $ dn , $ newdn , $ newparent , $ deleteolddn ) ; } | Rename the entry |
18,022 | public static function LDAPNetAddr ( $ networkaddress ) { $ addr = "" ; $ addrtype = ( int ) substr ( $ networkaddress , 0 , 1 ) ; $ networkaddress = substr ( $ networkaddress , 2 ) ; if ( ( $ addrtype == 8 ) || ( $ addrtype = 9 ) ) { $ networkaddress = substr ( $ networkaddress , ( strlen ( $ networkaddress ) - 4 ) ) ... | Extract readable network address from the LDAP encoded networkAddress attribute . |
18,023 | public static function generatePassword ( $ password , $ type = 'md5' ) { switch ( strtolower ( $ type ) ) { case 'sha' : $ userpassword = '{SHA}' . base64_encode ( pack ( 'H*' , sha1 ( $ password ) ) ) ; break ; case 'md5' : default : $ userpassword = '{MD5}' . base64_encode ( pack ( 'H*' , md5 ( $ password ) ) ) ; br... | Generates a LDAP compatible password |
18,024 | protected function getChangeSequenceSQL ( \ SimpleXMLElement $ field ) { if ( version_compare ( $ this -> db -> getVersion ( ) , '9.1.0' ) < 0 ) { $ field [ 'Min_Value' ] = '1' ; $ field [ 'Max_Value' ] = '9223372036854775807' ; $ field [ 'Increment' ] = '1' ; $ field [ 'Cycle_option' ] = 'NO' ; $ field [ 'Start_Value'... | Get the syntax to alter a sequence . |
18,025 | public function edit ( $ owner , $ repo , $ name , $ description = '' , $ homepage = '' , $ private = false , $ has_issues = false , $ has_wiki = false , $ has_downloads = false , $ default_branch = '' ) { $ path = '/repos/' . $ owner . '/' . $ repo ; $ data = array ( 'name' => $ name , 'description' => $ description ,... | Edit a repository . |
18,026 | public function createComment ( $ checkin , $ message ) { $ data = array ( ) ; $ data [ 'message' ] = $ message ; return $ this -> createConnection ( $ checkin , 'comments' , $ data ) ; } | Method to post a comment to the checkin . Requires authentication and publish_stream and user_checkins or friends_checkins permission . |
18,027 | protected function detectBrowser ( $ userAgent ) { if ( ( stripos ( $ userAgent , 'MSIE' ) !== false ) && ( stripos ( $ userAgent , 'Opera' ) === false ) ) { $ this -> browser = self :: IE ; $ patternBrowser = 'MSIE' ; } elseif ( ( stripos ( $ userAgent , 'Firefox' ) !== false ) && ( stripos ( $ userAgent , 'like Firef... | Detects the client browser and version in a user agent string . |
18,028 | public function getDriver ( $ name = 'mysqli' , $ options = array ( ) ) { $ options [ 'driver' ] = preg_replace ( '/[^A-Z0-9_\.-]/i' , '' , $ name ) ; $ options [ 'database' ] = ( isset ( $ options [ 'database' ] ) ) ? $ options [ 'database' ] : null ; $ options [ 'select' ] = ( isset ( $ options [ 'select' ] ) ) ? $ o... | Method to return a Driver instance based on the given options . There are three global options and then the rest are specific to the database driver . The database option determines which database is to be used for the connection . The select option determines whether the connector should automatically select the chose... |
18,029 | public function setSubscription ( $ owner , $ repo , $ subscribed , $ ignored ) { $ path = '/repos/' . $ owner . '/' . $ repo . '/subscription' ; $ data = array ( 'subscribed' => $ subscribed , 'ignored' => $ ignored ) ; return $ this -> processResponse ( $ this -> client -> put ( $ this -> fetchUrl ( $ path ) , json_e... | Set a Repository Subscription . |
18,030 | protected function connect ( UriInterface $ uri , $ timeout = null ) { $ errno = null ; $ err = null ; $ host = ( $ uri -> isSSL ( ) ) ? 'ssl://' . $ uri -> getHost ( ) : $ uri -> getHost ( ) ; if ( ! $ uri -> getPort ( ) ) { $ port = ( $ uri -> getScheme ( ) == 'https' ) ? 443 : 80 ; } else { $ port = $ uri -> getPort... | Method to connect to a server and get the resource . |
18,031 | public function verify ( $ password , $ hash ) { if ( substr ( $ hash , 0 , 4 ) == '$2a$' || substr ( $ hash , 0 , 4 ) == '$2y$' ) { if ( version_compare ( PHP_VERSION , '5.3.7' ) >= 0 ) { $ type = '$2y$' ; } else { $ type = '$2a$' ; } $ hash = $ type . substr ( $ hash , 4 ) ; return ( crypt ( $ password , $ hash ) ===... | Verifies a password hash |
18,032 | public function render ( $ text , $ mode = 'gfm' , $ context = null ) { $ validModes = array ( 'gfm' , 'markdown' ) ; if ( ! in_array ( $ mode , $ validModes ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The %s mode is not valid. Valid modes are "gfm" or "markdown".' , $ mode ) ) ; } $ path = '/markdown' ; $ ... | Method to render a markdown document . |
18,033 | public function count ( ) { if ( ! empty ( $ this -> cursor ) && $ this -> cursor instanceof \ PDOStatement ) { return $ this -> cursor -> rowCount ( ) ; } else { return 0 ; } } | Get the number of rows in the result set for the executed SQL given by the cursor . |
18,034 | public function add ( $ udiff , $ root = JPATH_ROOT , $ strip = 0 ) { $ this -> patches [ ] = array ( 'udiff' => $ udiff , 'root' => isset ( $ root ) ? rtrim ( $ root , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR : '' , 'strip' => $ strip ) ; return $ this ; } | Add a unified diff string to the patcher |
18,035 | protected static function findHeader ( & $ lines , & $ src , & $ dst ) { $ line = current ( $ lines ) ; while ( $ line !== false && ! preg_match ( self :: SRC_FILE , $ line , $ m ) ) { $ line = next ( $ lines ) ; } if ( $ line === false ) { return false ; } else { $ src = $ m [ 1 ] ; $ line = next ( $ lines ) ; if ( $ ... | Find the diff header |
18,036 | public function listPhotos ( ) { if ( $ this -> isAuthenticated ( ) ) { $ url = $ this -> getLink ( 'http://schemas.google.com/g/2005#feed' ) ; $ jdata = $ this -> query ( $ url , null , array ( 'GData-Version' => 2 ) ) ; $ xml = $ this -> safeXML ( $ jdata -> body ) ; if ( isset ( $ xml -> children ( ) -> entry ) ) { ... | Method to retrieve a list of Picasa Photos |
18,037 | public function getPublic ( ) { $ path = '/events' ; return $ this -> processResponse ( $ this -> client -> get ( $ this -> fetchUrl ( $ path ) ) ) ; } | List public events . |
18,038 | public function getUserOrg ( $ user , $ org ) { $ path = '/users/' . $ user . '/events/orgs/' . $ org ; return $ this -> processResponse ( $ this -> client -> get ( $ this -> fetchUrl ( $ path ) ) ) ; } | List events for an organization . |
18,039 | public function getAuthenticatedUser ( ) { $ path = '/user' ; return $ this -> processResponse ( $ this -> client -> get ( $ this -> fetchUrl ( $ path ) ) ) ; } | Get the current authenticated user . |
18,040 | public function createLink ( $ event , $ link , $ message = null ) { $ data = array ( ) ; $ data [ 'link' ] = $ link ; $ data [ 'message' ] = $ message ; return $ this -> createConnection ( $ event , 'feed' , $ data ) ; } | Method to post a link on event s feed which the current_user is or maybe attending . Requires authentication and publish_stream permission . |
18,041 | public function createStatus ( $ event , $ message ) { $ data = array ( ) ; $ data [ 'message' ] = $ message ; return $ this -> createConnection ( $ event , 'feed' , $ data ) ; } | Method to post a status message on behalf of the user on the event s wall . Requires authentication and publish_stream permission . |
18,042 | public function createInvite ( $ event , $ users ) { $ data = array ( ) ; $ data [ 'users' ] = $ users ; return $ this -> createConnection ( $ event , 'invited' , $ data ) ; } | Method to invite users to the event . Requires authentication and create_event permission . |
18,043 | public function createPhoto ( $ event , $ source , $ message = null ) { $ data = array ( ) ; $ data [ basename ( $ source ) ] = '@' . realpath ( $ source ) ; if ( $ message ) { $ data [ 'message' ] = $ message ; } return $ this -> createConnection ( $ event , 'photos' , $ data , array ( 'Content-Type' => 'multipart/for... | Method to post a photo on event s wall . Requires authentication and publish_stream permission . |
18,044 | public function createVideo ( $ event , $ source , $ title = null , $ description = null ) { $ data = array ( ) ; $ data [ basename ( $ source ) ] = '@' . realpath ( $ source ) ; if ( $ title ) { $ data [ 'title' ] = $ title ; } if ( $ description ) { $ data [ 'description' ] = $ description ; } return $ this -> create... | Method to post a video on event s wall . Requires authentication and publish_stream permission . |
18,045 | public function getPeople ( $ id , $ fields = null ) { if ( $ this -> isAuthenticated ( ) ) { $ url = $ this -> getOption ( 'api.url' ) . 'people/' . $ id ; if ( $ fields ) { $ url .= '?fields=' . $ fields ; } $ jdata = $ this -> auth -> query ( $ url ) ; return json_decode ( $ jdata -> body , true ) ; } else { return ... | Get a person s profile . |
18,046 | public function search ( $ query , $ fields = null , $ language = null , $ max = 10 , $ token = null ) { if ( $ this -> isAuthenticated ( ) ) { $ url = $ this -> getOption ( 'api.url' ) . 'people?query=' . urlencode ( $ query ) ; if ( $ fields ) { $ url .= '&fields=' . $ fields ; } if ( $ language ) { $ url .= '&langua... | Search all public profiles . |
18,047 | public function listByActivity ( $ activityId , $ collection , $ fields = null , $ max = 10 , $ token = null ) { if ( $ this -> isAuthenticated ( ) ) { $ url = $ this -> getOption ( 'api.url' ) . 'activities/' . $ activityId . '/people/' . $ collection ; if ( $ fields ) { $ url .= '?fields=' . $ fields ; } if ( $ max !... | List all of the people in the specified collection for a particular activity . |
18,048 | public function create ( $ user , $ repo , $ title , $ state = null , $ description = null , $ due_on = null ) { $ path = '/repos/' . $ user . '/' . $ repo . '/milestones' ; $ data = array ( 'title' => $ title ) ; if ( ! is_null ( $ state ) ) { $ data [ 'state' ] = $ state ; } if ( ! is_null ( $ description ) ) { $ dat... | Method to create a milestone for a repository . |
18,049 | public function edit ( $ user , $ repo , $ milestoneId , $ title = null , $ state = null , $ description = null , $ due_on = null ) { $ path = '/repos/' . $ user . '/' . $ repo . '/milestones/' . ( int ) $ milestoneId ; $ data = array ( ) ; if ( ! is_null ( $ title ) ) { $ data [ 'title' ] = $ title ; } if ( ! is_null ... | Method to update a milestone . |
18,050 | public function delete ( $ user , $ repo , $ milestoneId ) { $ path = '/repos/' . $ user . '/' . $ repo . '/milestones/' . ( int ) $ milestoneId ; $ response = $ this -> client -> delete ( $ this -> fetchUrl ( $ path ) ) ; if ( $ response -> code != 204 ) { $ error = json_decode ( $ response -> body ) ; throw new \ Dom... | Method to delete a milestone . |
18,051 | public function getAdapter ( $ type ) { $ type = strtolower ( $ type ) ; if ( ! isset ( $ this -> adapters [ $ type ] ) ) { $ class = 'Joomla\\Archive\\' . ucfirst ( $ type ) ; if ( ! class_exists ( $ class ) || ! $ class :: isSupported ( ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Archive adapter "%s" (cla... | Get a file compression adapter . |
18,052 | public function create ( $ owner , $ repo , $ message , $ tree , array $ parents = array ( ) ) { $ path = '/repos/' . $ owner . '/' . $ repo . '/git/commits' ; $ data = json_encode ( array ( 'message' => $ message , 'tree' => $ tree , 'parents' => $ parents ) ) ; return $ this -> processResponse ( $ response = $ this -... | Method to create a commit . |
18,053 | public function createComment ( $ link , $ message ) { $ data = array ( ) ; $ data [ 'message' ] = $ message ; return $ this -> createConnection ( $ link , 'comments' , $ data ) ; } | Method to comment on a link . Requires authentication and publish_stream permission . |
18,054 | public function getGeocode ( $ lat , $ long , $ accuracy = null , $ granularity = null , $ max_results = 0 , $ callback = null ) { $ this -> checkRateLimit ( 'geo' , 'reverse_geocode' ) ; $ path = '/geo/reverse_geocode.json' ; $ data [ 'lat' ] = $ lat ; $ data [ 'long' ] = $ long ; if ( $ accuracy ) { $ data [ 'accurac... | Method to get up to 20 places that can be used as a place_id when updating a status . |
18,055 | public function createComment ( $ video , $ message ) { $ data = array ( ) ; $ data [ 'message' ] = $ message ; return $ this -> createConnection ( $ video , 'comments' , $ data ) ; } | Method to comment on a video . Requires authentication and publish_stream permission user_videos or friends_videos permission for private videos . |
18,056 | protected function addLogEntry ( LogEntry $ entry ) { $ loggers = $ this -> findLoggers ( $ entry -> priority , $ entry -> category ) ; foreach ( ( array ) $ loggers as $ signature ) { if ( empty ( $ this -> loggers [ $ signature ] ) ) { $ class = '\\Joomla\\Log\\Logger\\' . ucfirst ( $ this -> configurations [ $ signa... | Method to add an entry to the appropriate loggers . |
18,057 | protected function findLoggers ( $ priority , $ category ) { $ loggers = array ( ) ; $ priority = ( int ) $ priority ; $ category = strtolower ( $ category ) ; foreach ( ( array ) $ this -> lookup as $ signature => $ rules ) { if ( $ priority & $ rules -> priorities ) { if ( $ rules -> exclude ) { if ( empty ( $ rules ... | Method to find the loggers to use based on priority and category values . |
18,058 | public function getImporter ( ) { $ class = '\\Joomla\\Database\\' . ucfirst ( $ this -> name ) . '\\' . ucfirst ( $ this -> name ) . 'Importer' ; if ( ! class_exists ( $ class ) ) { throw new \ RuntimeException ( 'Database Importer not found' ) ; } $ o = new $ class ; $ o -> setDbo ( $ this ) ; return $ o ; } | Gets an importer class object . |
18,059 | public function loadObject ( $ class = 'stdClass' ) { $ this -> connect ( ) ; $ ret = null ; if ( ! ( $ cursor = $ this -> execute ( ) ) ) { return null ; } $ object = $ this -> fetchObject ( $ cursor , $ class ) ; if ( $ object ) { $ ret = $ object ; } $ this -> freeResult ( $ cursor ) ; return $ ret ; } | Method to get the first row of the result set from the database query as an object . |
18,060 | public function setBounds ( $ southwestLatitude , $ southwestLongitude , $ northeastLatitude , $ northeastLongitude ) { $ this -> setBoundsSouthwest ( $ southwestLatitude , $ southwestLongitude ) -> setBoundsNortheast ( $ northeastLatitude , $ northeastLongitude ) ; return $ this ; } | Set the bounding box coordinates within which to bias geocode results . |
18,061 | public function getBounds ( ) { $ southwest = $ this -> getBoundsSouthwest ( ) ; $ northeast = $ this -> getBoundsNortheast ( ) ; if ( $ southwest && $ northeast ) { return $ southwest . "|" . $ northeast ; } else { return false ; } } | Get the bounding box coordinates within which to bias geocode results in comma - separated pipe - delimited format . |
18,062 | public function setBoundsSouthwest ( $ latitude , $ longitude ) { $ this -> boundsSouthwestLatitude = $ latitude ; $ this -> boundsSouthwestLongitude = $ longitude ; return $ this ; } | Set the southwest coordinates of the bounding box within which to bias geocode results . |
18,063 | public function getBoundsSouthwest ( ) { $ latitude = $ this -> getBoundsSouthwestLatitude ( ) ; $ longitude = $ this -> getBoundsSouthwestLongitude ( ) ; if ( $ latitude && $ longitude ) { return $ latitude . "," . $ longitude ; } else { return false ; } } | Get the southwest coordinates of the bounding box within which to bias geocode results in comma - separated format . |
18,064 | public function setBoundsNortheast ( $ latitude , $ longitude ) { $ this -> boundsNortheastLatitude = $ latitude ; $ this -> boundsNortheastLongitude = $ longitude ; return $ this ; } | Set the northeast coordinates of the bounding box within which to bias geocode results . |
18,065 | public function getBoundsNortheast ( ) { $ latitude = $ this -> getBoundsNortheastLatitude ( ) ; $ longitude = $ this -> getBoundsNortheastLongitude ( ) ; if ( $ latitude && $ longitude ) { return $ latitude . "," . $ longitude ; } else { return false ; } } | Get the northeast coordinates of the bounding box within which to bias geocode results in comma - separated format . |
18,066 | public function setSensor ( $ sensor ) { if ( $ sensor == 'true' || $ sensor == 'false' ) { $ this -> sensor = $ sensor ; } elseif ( $ sensor ) { $ this -> sensor = "true" ; } else { $ this -> sensor = "false" ; } return $ this ; } | Set whether the request is from a device with a location sensor . |
18,067 | private function generateSignature ( $ pathQueryString ) { $ decodedSigningKey = self :: base64DecodeUrlSafe ( $ this -> getSigningKey ( ) ) ; $ signature = hash_hmac ( 'sha1' , $ pathQueryString , $ decodedSigningKey , true ) ; $ signature = self :: base64EncodeUrlSafe ( $ signature ) ; return $ signature ; } | Generate the signature for a Business client geocode request . |
18,068 | private function geocodeQueryString ( ) { $ queryString = array ( ) ; $ address = $ this -> getAddress ( ) ; $ latitudeLongitude = $ this -> getLatitudeLongitude ( ) ; if ( $ address ) { $ queryString [ 'address' ] = $ address ; } elseif ( $ latitudeLongitude ) { $ queryString [ 'latlng' ] = $ latitudeLongitude ; } $ q... | Build the query string with all set parameters of the geocode request . |
18,069 | public static function boundingBox ( $ latitude , $ longitude , $ mileRange ) { $ maxLatitude = $ latitude + $ mileRange / self :: EQUATOR_LAT_DEGREE_IN_MILES ; $ minLatitude = $ latitude - ( $ maxLatitude - $ latitude ) ; $ maxLongitude = $ longitude + $ mileRange / ( cos ( $ minLatitude * M_PI / 180 ) * self :: EQUAT... | Computes a four point bounding box around the specified location . This can then be used to find all locations within an X - mile range of a central location . A bounding box is much easier and faster to compute than a bounding radius . |
18,070 | public function authenticate ( ) { if ( $ data [ 'code' ] = $ this -> input -> get ( 'code' , false , 'raw' ) ) { $ data [ 'grant_type' ] = 'authorization_code' ; $ data [ 'redirect_uri' ] = $ this -> getOption ( 'redirecturi' ) ; $ data [ 'client_id' ] = $ this -> getOption ( 'clientid' ) ; $ data [ 'client_secret' ] ... | Get the access token or redict to the authentication URL . |
18,071 | public function isAuthenticated ( ) { $ token = $ this -> getToken ( ) ; if ( ! $ token || ! array_key_exists ( 'access_token' , $ token ) ) { return false ; } elseif ( array_key_exists ( 'expires_in' , $ token ) && $ token [ 'created' ] + $ token [ 'expires_in' ] < time ( ) + 20 ) { return false ; } else { return true... | Verify if the client has been authenticated |
18,072 | public function createUrl ( ) { if ( ! $ this -> getOption ( 'authurl' ) || ! $ this -> getOption ( 'clientid' ) ) { throw new \ InvalidArgumentException ( 'Authorization URL and client_id are required' ) ; } $ url = $ this -> getOption ( 'authurl' ) ; if ( strpos ( $ url , '?' ) ) { $ url .= '&' ; } else { $ url .= '?... | Create the URL for authentication . |
18,073 | public function refreshToken ( $ token = null ) { if ( ! $ this -> getOption ( 'userefresh' ) ) { throw new \ RuntimeException ( 'Refresh token is not supported for this OAuth instance.' ) ; } if ( ! $ token ) { $ token = $ this -> getToken ( ) ; if ( ! array_key_exists ( 'refresh_token' , $ token ) ) { throw new \ Run... | Refresh the access token instance . |
18,074 | public function createPassphraseFile ( $ passphrase , $ passphraseFile , $ privateKeyFile , $ privateKeyPassphrase ) { $ privateKey = openssl_get_privatekey ( file_get_contents ( $ privateKeyFile ) , $ privateKeyPassphrase ) ; if ( ! $ privateKey ) { throw new \ RuntimeException ( "Failed to load private key." ) ; } $ ... | Create a passphrase file |
18,075 | public function loadKeychain ( $ keychainFile , $ passphraseFile , $ publicKeyFile ) { if ( ! file_exists ( $ keychainFile ) ) { throw new \ RuntimeException ( 'Attempting to load non-existent keychain file' ) ; } $ passphrase = $ this -> getPassphraseFromFile ( $ passphraseFile , $ publicKeyFile ) ; $ cleartext = open... | Load a keychain file into this object . |
18,076 | public function saveKeychain ( $ keychainFile , $ passphraseFile , $ publicKeyFile ) { $ passphrase = $ this -> getPassphraseFromFile ( $ passphraseFile , $ publicKeyFile ) ; $ data = $ this -> toString ( 'JSON' ) ; $ encrypted = @ openssl_encrypt ( $ data , $ this -> method , $ passphrase , true , $ this -> iv ) ; if ... | Save this keychain to a file . |
18,077 | protected function getPassphraseFromFile ( $ passphraseFile , $ publicKeyFile ) { if ( ! file_exists ( $ publicKeyFile ) ) { throw new \ RuntimeException ( 'Missing public key file' ) ; } $ publicKey = openssl_get_publickey ( file_get_contents ( $ publicKeyFile ) ) ; if ( ! $ publicKey ) { throw new \ RuntimeException ... | Get the passphrase for this keychain |
18,078 | public function bookmark ( $ id ) { $ token = $ this -> oauth -> getToken ( ) ; $ parameters = array ( 'oauth_token' => $ token [ 'key' ] ) ; $ this -> oauth -> setOption ( 'success_code' , 201 ) ; $ base = '/v1/people/~/job-bookmarks' ; $ xml = '<job-bookmark><job><id>' . $ id . '</id></job></job-bookmark>' ; $ path =... | Method to bookmark a job to the current user s account . |
18,079 | public function deleteBookmark ( $ id ) { $ token = $ this -> oauth -> getToken ( ) ; $ parameters = array ( 'oauth_token' => $ token [ 'key' ] ) ; $ this -> oauth -> setOption ( 'success_code' , 204 ) ; $ base = '/v1/people/~/job-bookmarks/' . $ id ; $ path = $ this -> getOption ( 'api.url' ) . $ base ; $ response = $... | Method to delete a bookmark . |
18,080 | public function removeMultiple ( $ keys ) { $ result = array ( ) ; foreach ( $ keys as $ key ) { $ result [ $ key ] = $ this -> remove ( $ key ) ; } return $ result ; } | Remove multiple cache items in a single operation . |
18,081 | public function create ( $ user , $ repo , $ sha , $ state , $ targetUrl = null , $ description = null ) { $ path = '/repos/' . $ user . '/' . $ repo . '/statuses/' . $ sha ; if ( ! in_array ( $ state , array ( 'pending' , 'success' , 'error' , 'failure' ) ) ) { throw new \ InvalidArgumentException ( 'State must be one... | Method to create a status . |
18,082 | protected function listGetData ( $ url , $ maxpages = 1 , $ token = null ) { $ qurl = $ url ; if ( strpos ( $ url , '&' ) && isset ( $ token ) ) { $ qurl .= '&pageToken=' . $ token ; } elseif ( isset ( $ token ) ) { $ qurl .= 'pageToken=' . $ token ; } $ jdata = $ this -> query ( $ qurl ) ; $ data = json_decode ( $ jda... | Method to retrieve a list of data |
18,083 | public function dump ( $ depth = 3 , \ SplObjectStorage $ dumped = null ) { if ( $ dumped === null ) { $ dumped = new \ SplObjectStorage ; } $ dumped -> attach ( $ this ) ; $ objects = array ( ) ; if ( $ depth > 0 ) { foreach ( $ this -> objects as $ key => $ object ) { $ objects [ $ key ] = $ object -> dump ( $ depth ... | Dumps the data object in the set recursively if appropriate . |
18,084 | public function jsonSerialize ( $ serialized = null ) { if ( $ serialized === null ) { $ serialized = array ( ) ; } $ serialized [ ] = spl_object_hash ( $ this ) ; $ return = array ( ) ; foreach ( $ this -> objects as $ object ) { $ return [ ] = $ object -> jsonSerialize ( $ serialized ) ; } return $ return ; } | Gets the data set in a form that can be serialised to JSON format . |
18,085 | public function next ( ) { $ keys = $ this -> keys ( ) ; if ( $ this -> current === false && isset ( $ keys [ 0 ] ) ) { $ this -> current = $ keys [ 0 ] ; } else { $ position = array_search ( $ this -> current , $ keys ) ; if ( $ position !== false && isset ( $ keys [ $ position + 1 ] ) ) { $ this -> current = $ keys [... | Advances the iterator to the next object in the iterator . |
18,086 | public function offsetUnset ( $ offset ) { if ( ! $ this -> offsetExists ( $ offset ) ) { return ; } if ( $ offset == $ this -> current ) { $ keys = $ this -> keys ( ) ; $ position = array_search ( $ this -> current , $ keys ) ; if ( $ position > 0 ) { $ this -> current = $ keys [ $ position - 1 ] ; } else { $ this -> ... | Unsets an offset in the iterator . |
18,087 | public function rewind ( ) { if ( empty ( $ this -> objects ) ) { $ this -> current = false ; } else { $ keys = $ this -> keys ( ) ; $ this -> current = array_shift ( $ keys ) ; } } | Rewinds the iterator to the first object . |
18,088 | public function valid ( ) { if ( ! is_scalar ( $ this -> current ) || ! isset ( $ this -> objects [ $ this -> current ] ) ) { return false ; } return true ; } | Validates the iterator . |
18,089 | protected function getInput ( ) { $ class = $ this -> element [ 'class' ] ? ' class="' . ( string ) $ this -> element [ 'class' ] . '"' : '' ; $ disabled = ( ( string ) $ this -> element [ 'disabled' ] == 'true' ) ? ' disabled="disabled"' : '' ; $ value = $ this -> element [ 'value' ] ? ( string ) $ this -> element [ '... | Method to get the field input markup . The checked element sets the field to selected . |
18,090 | public static function getStream ( $ use_prefix = true , $ ua = null , $ uamask = false ) { $ context = array ( ) ; $ context [ 'http' ] [ 'user_agent' ] = $ ua ? : 'Joomla! Framework Stream' ; if ( $ use_prefix ) { return new Stream ( JPATH_ROOT . '/' , JPATH_ROOT , $ context ) ; } return new Stream ( '' , '' , $ cont... | Creates a new stream object with appropriate prefix |
18,091 | public function create ( $ files , $ public = false , $ description = null ) { $ path = '/gists' ; $ data = json_encode ( array ( 'files' => $ this -> buildFileData ( ( array ) $ files ) , 'public' => ( bool ) $ public , 'description' => $ description ) ) ; $ response = $ this -> client -> post ( $ this -> fetchUrl ( $... | Method to create a gist . |
18,092 | public function edit ( $ gistId , $ files = null , $ public = null , $ description = null ) { $ path = '/gists/' . ( int ) $ gistId ; $ data = new \ stdClass ; if ( isset ( $ description ) ) { $ data -> description = $ description ; } if ( isset ( $ public ) ) { $ data -> public = $ public ; } if ( isset ( $ files ) ) ... | Method to update a gist . |
18,093 | protected function buildFileData ( array $ files ) { $ data = array ( ) ; foreach ( $ files as $ key => $ file ) { if ( ! is_numeric ( $ key ) ) { $ data [ $ key ] = array ( 'content' => $ file ) ; } elseif ( ! file_exists ( $ file ) ) { throw new \ InvalidArgumentException ( 'The file ' . $ file . ' does not exist.' )... | Method to fetch a data array for transmitting to the GitHub API for a list of files based on an input array of file paths or filename and content pairs . |
18,094 | public static function genericlist ( $ data , $ name , $ attribs = null , $ optKey = 'value' , $ optText = 'text' , $ selected = null , $ idtag = false , $ translate = false ) { $ options = array_merge ( self :: $ formatOptions , array ( 'format.depth' => 0 , 'id' => false ) ) ; if ( is_array ( $ attribs ) && func_num_... | Generates an HTML selection list . |
18,095 | public function getPath ( $ layout , $ ext = 'php' ) { $ file = Path :: clean ( $ layout . '.' . $ ext ) ; $ path = Path :: find ( clone ( $ this -> paths ) , $ file ) ; return $ path ; } | Method to get the layout path . |
18,096 | public function render ( ) { $ path = $ this -> getPath ( $ this -> getLayout ( ) ) ; if ( ! $ path ) { throw new \ RuntimeException ( 'Layout Path Not Found' ) ; } ob_start ( ) ; include $ path ; $ output = ob_get_clean ( ) ; return $ output ; } | Method to render the view . |
18,097 | public function data ( $ name , $ options = null , $ auth = null ) { if ( $ this -> options && ! $ options ) { $ options = $ this -> options ; } if ( $ this -> auth && ! $ auth ) { $ auth = $ this -> auth ; } switch ( strtolower ( $ name ) ) { case 'plus' : return new Data \ Plus ( $ options , $ auth ) ; case 'picasa' ... | Method to create Data objects |
18,098 | public function embed ( $ name , $ options = null ) { if ( $ this -> options && ! $ options ) { $ options = $ this -> options ; } switch ( strtolower ( $ name ) ) { case 'maps' : return new Embed \ Maps ( $ options ) ; case 'analytics' : return new Embed \ Analytics ( $ options ) ; default : return null ; } } | Method to create Embed objects |
18,099 | public function execute ( ) { gc_enable ( ) ; $ this -> getLogger ( ) -> info ( 'Starting ' . $ this -> name ) ; if ( $ this -> daemonize ( ) ) { declare ( ticks = 1 ) ; while ( true ) { $ this -> gc ( ) ; usleep ( 1000 ) ; $ this -> doExecute ( ) ; } } else { $ this -> getLogger ( ) -> info ( 'Starting ' . $ this -> n... | Execute the daemon . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.