idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
7,500
protected function validateUUID ( $ uuid ) { $ validator = Yii :: createObject ( array_merge ( [ 'class' => UniqueValidator :: class , ] , $ this -> uniqueValidator ) ) ; $ model = clone $ this -> owner ; $ model -> clearErrors ( ) ; $ model -> { $ this -> attribute } = $ uuid ; $ validator -> validateAttribute ( $ mod...
Checks if given uuid value is unique .
7,501
public function changeExtension ( $ rename ) { $ search = '' ; $ replace = '' ; if ( is_array ( $ rename ) ) { $ search = key ( $ rename ) ; $ replace = current ( $ rename ) ; } if ( is_string ( $ rename ) ) { $ search = pathinfo ( $ this -> outputPathname , PATHINFO_EXTENSION ) ; $ replace = $ rename ; } $ this -> out...
Change the extension of the output pathname .
7,502
public function getPasswordBrokerManager ( ) : ? PasswordBrokerManager { if ( ! $ this -> hasPasswordBrokerManager ( ) ) { $ this -> setPasswordBrokerManager ( $ this -> getDefaultPasswordBrokerManager ( ) ) ; } return $ this -> passwordBrokerManager ; }
Get password broker manager
7,503
public function insertAsset ( AssetAbstract $ asset , $ location ) { array_splice ( $ this -> assets , $ location , 0 , array ( $ asset ) ) ; return $ this ; }
This will insert an asset in to a specific location in the array and then shift the element keys .
7,504
public function readCell ( $ column , $ row , $ worksheetName = '' ) { return ( $ row >= $ this -> firstRow && $ row <= $ this -> lastRow && array_key_exists ( $ column , $ this -> range ) ) ; }
Should this cell be read?
7,505
public function select ( $ mNameId , $ aData , $ mDefault = null , $ sClass = null , $ iTabindex = null , $ bDisabled = false , $ bMultiple = false , $ sExtraHtml = null ) { self :: getNameAndId ( $ mNameId , $ sName , $ sId ) ; $ res = '<select name="' . $ sName . '"' ; $ res .= null === $ sId ? '' : ' id="' . $ sId ....
Retourne un champ de formulaire de type select .
7,506
public function checkbox ( $ mNameId , $ value , $ checked = '' , $ sClass = null , $ iTabindex = null , $ bDisabled = false , $ sExtraHtml = null ) { self :: getNameAndId ( $ mNameId , $ sName , $ sId ) ; $ res = '<input type="checkbox" name="' . $ sName . '" value="' . $ value . '"' ; $ res .= null === $ sId ? '' : '...
Retourne un champ de formulaire de type checkbox .
7,507
public function text ( $ mNameId , $ size , $ max = null , $ sDefault = null , $ sClass = null , $ sPlaceholder = null , $ iTabindex = null , $ bDisabled = false , $ sExtraHtml = null ) { self :: getNameAndId ( $ mNameId , $ sName , $ sId ) ; $ res = '<input type="text" size="' . $ size . '" name="' . $ sName . '"' ; $...
Retourne un champ de formulaire de type text .
7,508
public function file ( $ mNameId , $ sDefault = null , $ sClass = null , $ iTabindex = null , $ bDisabled = false , $ sExtraHtml = null ) { self :: getNameAndId ( $ mNameId , $ sName , $ sId ) ; $ res = '<input type="file" name="' . $ sName . '"' ; $ res .= null === $ sId ? '' : ' id="' . $ sId . '"' ; $ res .= null ==...
Retourne un champ de formulaire de type file .
7,509
public function textarea ( $ mNameId , $ iCols = null , $ iRows = null , $ sDefault = null , $ sClass = null , $ sPlaceholder = null , $ iTabindex = null , $ bDisabled = false , $ sExtraHtml = null ) { self :: getNameAndId ( $ mNameId , $ sName , $ sId ) ; $ res = '<textarea' ; $ res .= null === $ iCols ? '' : ' cols="...
Retourne un champ de formulaire de type textarea .
7,510
public function hidden ( $ mNameId , $ value ) { self :: getNameAndId ( $ mNameId , $ sName , $ sId ) ; $ res = '<input type="hidden" name="' . $ sName . '" value="' . $ value . '" ' ; $ res .= null === $ sId ? '' : ' id="' . $ sId . '"' ; $ res .= '>' ; return $ res ; }
Retourne un champ de formulaire de type hidden .
7,511
public function filterByStreet ( $ street = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ street ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ street ) ) { $ street = str_replace ( '*' , '%' , $ street ) ; $ comparison = Criteria :: LIKE ; } } return $ th...
Filter the query on the street column
7,512
public function filterByZip ( $ zip = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ zip ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ zip ) ) { $ zip = str_replace ( '*' , '%' , $ zip ) ; $ comparison = Criteria :: LIKE ; } } return $ this -> addUsingAlia...
Filter the query on the zip column
7,513
public function filterByCity ( $ city = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ city ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ city ) ) { $ city = str_replace ( '*' , '%' , $ city ) ; $ comparison = Criteria :: LIKE ; } } return $ this -> addUsi...
Filter the query on the city column
7,514
public function filterByCountryId ( $ countryId = null , $ comparison = null ) { if ( is_array ( $ countryId ) ) { $ useMinMax = false ; if ( isset ( $ countryId [ 'min' ] ) ) { $ this -> addUsingAlias ( CustomerPeer :: COUNTRY_ID , $ countryId [ 'min' ] , Criteria :: GREATER_EQUAL ) ; $ useMinMax = true ; } if ( isset...
Filter the query on the country_id column
7,515
public function filterByFax ( $ fax = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ fax ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ fax ) ) { $ fax = str_replace ( '*' , '%' , $ fax ) ; $ comparison = Criteria :: LIKE ; } } return $ this -> addUsingAlia...
Filter the query on the fax column
7,516
public function filterByEmail ( $ email = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ email ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ email ) ) { $ email = str_replace ( '*' , '%' , $ email ) ; $ comparison = Criteria :: LIKE ; } } return $ this -> ...
Filter the query on the email column
7,517
public function filterByLegalform ( $ legalform = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ legalform ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ legalform ) ) { $ legalform = str_replace ( '*' , '%' , $ legalform ) ; $ comparison = Criteria :: LIKE...
Filter the query on the legalform column
7,518
public function filterByLogo ( $ logo = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ logo ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ logo ) ) { $ logo = str_replace ( '*' , '%' , $ logo ) ; $ comparison = Criteria :: LIKE ; } } return $ this -> addUsi...
Filter the query on the logo column
7,519
public function filterByCreated ( $ created = null , $ comparison = null ) { if ( is_array ( $ created ) ) { $ useMinMax = false ; if ( isset ( $ created [ 'min' ] ) ) { $ this -> addUsingAlias ( CustomerPeer :: CREATED , $ created [ 'min' ] , Criteria :: GREATER_EQUAL ) ; $ useMinMax = true ; } if ( isset ( $ created ...
Filter the query on the created column
7,520
public function filterByNotes ( $ notes = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ notes ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ notes ) ) { $ notes = str_replace ( '*' , '%' , $ notes ) ; $ comparison = Criteria :: LIKE ; } } return $ this -> ...
Filter the query on the notes column
7,521
public function filterByCountry ( $ country , $ comparison = null ) { if ( $ country instanceof Country ) { return $ this -> addUsingAlias ( CustomerPeer :: COUNTRY_ID , $ country -> getId ( ) , $ comparison ) ; } elseif ( $ country instanceof PropelObjectCollection ) { if ( null === $ comparison ) { $ comparison = Cri...
Filter the query by a related Country object
7,522
public function useCountryQuery ( $ relationAlias = null , $ joinType = Criteria :: INNER_JOIN ) { return $ this -> joinCountry ( $ relationAlias , $ joinType ) -> useQuery ( $ relationAlias ? $ relationAlias : 'Country' , '\Slashworks\AppBundle\Model\CountryQuery' ) ; }
Use the Country relation Country object
7,523
public function useUserCustomerRelationQuery ( $ relationAlias = null , $ joinType = Criteria :: INNER_JOIN ) { return $ this -> joinUserCustomerRelation ( $ relationAlias , $ joinType ) -> useQuery ( $ relationAlias ? $ relationAlias : 'UserCustomerRelation' , '\Slashworks\AppBundle\Model\UserCustomerRelationQuery' ) ...
Use the UserCustomerRelation relation UserCustomerRelation object
7,524
protected function resolve ( $ name ) { $ config = $ this -> disks [ $ name ] ; if ( isset ( $ config [ 'class' ] ) ) { return Yii :: createObject ( $ config ) ; } else if ( isset ( $ config [ 'adapter' ] ) ) { $ driverMethod = 'create' . ucfirst ( $ config [ 'adapter' ] ) . 'Adapter' ; if ( method_exists ( $ this , $ ...
Resolve the given disk .
7,525
public function createLocalAdapter ( array $ config ) { $ permissions = $ config [ 'permissions' ] ?? [ ] ; $ root = Yii :: getAlias ( $ config [ 'root' ] ) ; $ links = ( $ config [ 'links' ] ?? null ) === 'skip' ? LocalAdapter :: SKIP_LINKS : LocalAdapter :: DISALLOW_LINKS ; return $ this -> adapt ( $ this -> createFl...
Create an instance of the local adapter .
7,526
public function createOssAdapter ( array $ config ) { $ root = $ config [ 'root' ] ?? null ; $ oss = new OssClient ( $ config [ 'access_id' ] , $ config [ 'access_secret' ] , $ config [ 'endpoint' ] , $ config [ 'isCName' ] ?? false , $ config [ 'securityToken' ] ?? null , $ config [ 'proxy' ] ?? null ) ; $ oss -> setT...
Create an instance of the oss driver .
7,527
protected function createView ( $ path ) { $ contents = $ this -> getViewContents ( ) ; file_put_contents ( $ path , $ contents ) ; $ this -> info ( 'View created successfully.' ) ; }
Generate the Blade view .
7,528
protected function makeDirectory ( $ path ) { $ dir = dirname ( $ path ) ; if ( ! file_exists ( $ dir ) ) { mkdir ( $ dir , 0777 , true ) ; } }
Create the directory for the view if it does not already exist .
7,529
public function getQueueingBus ( ) : ? QueueingDispatcher { if ( ! $ this -> hasQueueingBus ( ) ) { $ this -> setQueueingBus ( $ this -> getDefaultQueueingBus ( ) ) ; } return $ this -> queueingBus ; }
Get queueing bus
7,530
public function serialize ( TranslatableInterface $ translatable , $ targetLang ) { $ output = $ this -> beginExport ( $ translatable , $ targetLang ) ; $ output .= $ this -> exportTranslatable ( $ translatable , $ targetLang ) ; $ output .= $ this -> endExport ( ) ; return $ output ; }
Serializes a given translatable into an XLIFF file with the specified target language .
7,531
public function unserialize ( TranslatableInterface $ translatable , $ targetLang , $ xliff , $ callSetData = TRUE ) { if ( $ this -> validateImport ( $ translatable , $ targetLang , $ xliff ) ) { $ data = $ this -> import ( $ xliff ) ; if ( $ callSetData ) { $ translatable -> setData ( $ data , $ targetLang ) ; } retu...
Unserializes given XLIFF data ; before unserialization occurs the provided XLIFF is also validated against the provided translatable and target language .
7,532
public function beginExport ( TranslatableInterface $ translatable , $ targetLang ) { $ this -> openMemory ( ) ; $ this -> setIndent ( TRUE ) ; $ this -> setIndentString ( ' ' ) ; $ this -> startDocument ( '1.0' , 'UTF-8' ) ; $ this -> startElement ( 'xliff' ) ; $ this -> writeAttribute ( 'version' , '1.2' ) ; $ this -...
Starts an export .
7,533
public function exportTranslatable ( TranslatableInterface $ translatable , $ targetLang ) { $ this -> openMemory ( ) ; $ this -> setIndent ( TRUE ) ; $ this -> setIndentString ( ' ' ) ; $ this -> startElement ( 'xlf:group' ) ; $ this -> writeAttribute ( 'id' , $ translatable -> getIdentifier ( ) ) ; $ this -> writeAtt...
Adds a translatable item to the XML export .
7,534
protected function addTransUnit ( $ key , $ element , $ targetLang ) { $ this -> startElement ( 'xlf:group' ) ; $ this -> writeAttribute ( 'id' , $ key ) ; $ this -> writeAttribute ( 'resname' , $ key ) ; $ this -> writeAttribute ( 'restype' , 'x-eggs-n-cereal-field' ) ; $ list = get_html_translation_table ( HTML_ENTIT...
Adds a single translation unit for a data element .
7,535
public function serializerSimplexmlLoadString ( $ xmlString ) { $ numericTable = array ( ) ; $ numericTable [ '&' ] = '&#38;' ; $ entBitmask = defined ( 'ENT_HTML5' ) ? ENT_QUOTES | ENT_HTML5 : ENT_QUOTES ; $ trans = get_html_translation_table ( HTML_ENTITIES , $ entBitmask ) ; foreach ( $ trans as $ k => $ v ) { $ num...
Converts xml to string and handles entity encoding .
7,536
public function validateImport ( TranslatableInterface $ translatable , $ targetLang , $ xmlString ) { $ xmlString = Converter :: filterXmlControlCharacters ( $ xmlString ) ; $ error = $ this -> errorStart ( ) ; $ xml = $ this -> serializerSimplexmlLoadString ( $ xmlString ) ; $ this -> errorStop ( $ error ) ; if ( ! $...
Validates an import .
7,537
protected function errorStop ( $ use ) { foreach ( libxml_get_errors ( ) as $ error ) { switch ( $ error -> level ) { case LIBXML_ERR_WARNING : case LIBXML_ERR_ERROR : $ level = LogLevel :: WARNING ; break ; case LIBXML_ERR_FATAL : $ level = LogLevel :: ERROR ; break ; default : $ level = LogLevel :: INFO ; } $ this ->...
Ends custom error handling .
7,538
public static function getValue ( $ array , $ key , $ default = null ) { if ( is_string ( $ key ) ) { $ keys = explode ( '.' , $ key ) ; foreach ( $ keys as $ key ) { if ( ! isset ( $ array [ $ key ] ) ) { return $ default ; } $ array = & $ array [ $ key ] ; } return $ array ; } elseif ( is_null ( $ key ) ) { return $ ...
Get value of path default value if path doesn t exist or all data
7,539
public function addOption ( OptionInterface $ option ) { if ( ! $ this -> hasOption ( $ option ) ) { $ this -> options -> add ( $ option ) ; } return $ this ; }
Add a given option
7,540
public function removeOption ( OptionInterface $ option ) { if ( $ this -> hasOption ( $ option ) ) { $ this -> options -> removeElement ( $ option ) ; } return $ this ; }
Remove a given option
7,541
public function getContent ( $ rowResult ) { if ( $ this -> callManager ( $ rowResult ) === false ) { return '' ; } return $ this -> builder -> render ( $ this -> template ) ; }
Get column content
7,542
public function setManager ( Closure $ manager ) { if ( ! is_callable ( $ manager ) ) { throw new Exception ( 'Manager must be callable.' ) ; } $ this -> manager = $ manager ; return $ this ; }
Set action manager
7,543
protected function render ( $ template , $ data = [ ] , $ status = 200 ) { $ rendered = View :: render ( $ template , $ data ) ; $ this -> response -> getBody ( ) -> write ( $ rendered ) ; return $ this -> getResponse ( ) -> withStatus ( $ status ) -> withHeader ( 'Content-Type' , 'text/html; charset=utf-8' ) ; }
Render a view template with optional data
7,544
protected function redirect ( $ url , $ status = 302 ) { return $ this -> getResponse ( ) -> withStatus ( $ status ) -> withHeader ( 'Location' , ( string ) $ url ) ; }
Redirect to URL with optional status
7,545
public function routerError ( $ error = null , $ subject = null ) { switch ( $ error ) { case Router :: ERR_NOT_FOUND : $ status = 404 ; $ template = 'router/error404' ; break ; case Router :: ERR_BAD_METHOD : $ status = 405 ; $ template = 'router/error405' ; break ; case Router :: ERR_MISSING_CONTROLLER : case Router ...
Router Error Action
7,546
public function setRequest ( Request $ request ) { $ this -> request = $ request ; $ parsedBody = $ this -> request -> getParsedBody ( ) ; if ( ! empty ( $ parsedBody ) ) { if ( is_array ( $ parsedBody ) ) { $ this -> data = array_map ( 'trim' , ( array ) $ parsedBody ) ; } else { $ this -> data = $ parsedBody ; } } re...
Assign a request object
7,547
public function setStyle3dId ( $ style3dId ) { $ this -> style3dId = ( string ) $ style3dId ; $ this -> style3d = null ; return $ this ; }
Set the Style3d id
7,548
public function setStyle3d ( Style3d $ style3d ) { $ this -> style3dId = null ; $ this -> style3d = $ style3d ; return $ this ; }
Set the Style3d
7,549
protected function RetrievePropertyValueFromData ( string $ property ) { $ isNullable = in_array ( $ property , static :: DaftObjectNullableProperties ( ) , DefinitionAssistant :: IN_ARRAY_STRICT_MODE ) ; if ( ! array_key_exists ( $ property , $ this -> data ) && ! $ isNullable ) { throw Exceptions \ Factory :: Propert...
Retrieve a property from data .
7,550
public function pluck ( $ key_for_value , $ key_for_key = null ) { $ map = new Map ; $ this -> walk ( function ( $ v ) use ( $ key_for_value , $ key_for_key , $ map ) { if ( null === $ key_for_key ) { $ key = null ; } else if ( $ v -> has ( $ key_for_key ) ) { $ key = $ v -> get ( $ key_for_key ) ; } else { throw new \...
Create a new map by pulling the given key out of all contained maps .
7,551
public function createService ( ServiceLocatorInterface $ serviceLocator ) { $ config = $ serviceLocator -> get ( 'Config' ) ; ErrorHandler :: start ( ) ; $ compiledInstantiators = include $ config [ 'ocra_di_compiler' ] [ 'compiled_di_instantiator_filename' ] ; ErrorHandler :: stop ( ) ; if ( ! is_array ( $ compiledIn...
Generates a compiled Di proxy to be used as a replacement for \ Zend \ Di \ Di
7,552
public static function flatten ( array $ array , $ prefix = '' , $ join = '.' ) { $ flat = array ( ) ; foreach ( $ array as $ key => $ value ) { $ key = $ prefix ? $ prefix . $ join . $ key : $ key ; if ( is_array ( $ value ) ) { $ flat = array_merge ( $ flat , self :: flatten ( $ value , $ key , $ join ) ) ; } else { ...
Flattens an associative array .
7,553
protected function doInit ( ) { if ( $ this -> loadWith === self :: JAVASCRIPT ) { jQuery :: widget ( $ this -> html , $ this -> widgetName , ( array ) $ this -> widgetOptions ) ; } else { $ this -> html -> setAttribute ( 'data-widget' , $ this -> widgetName ) -> setAttribute ( 'data-widget-options' , $ this -> getJSON...
Initialisiert das Widget des objektes
7,554
public function onUpdatedProposeUpdateTask ( ) { $ task = $ this -> em -> getRepository ( 'AnimeDbAppBundle:Task' ) -> findOneBy ( [ 'command' => 'animedb:propose-update' ] ) ; $ next_run = new \ DateTime ( ) ; $ next_run -> modify ( sprintf ( '+%s seconds 01:00:00' , ProposeUpdateCommand :: INERVAL_UPDATE ) ) ; $ thi...
Update next run date for the propose update task .
7,555
public function setProviders ( $ providers ) { $ array = Parser :: map ( $ providers ) ; if ( empty ( $ array [ 'required' ] ) === false ) { $ this -> requiredProviders = implode ( ',' , $ array [ 'required' ] ) ; } if ( empty ( $ array [ 'hidden' ] ) === false ) { $ this -> hiddenProviders = implode ( ',' , $ array [ ...
Allows you to add authentication providers in the list of available .
7,556
public function setFields ( $ fields ) { if ( empty ( $ fields ) === false ) { if ( is_array ( $ fields ) === true ) { $ this -> requiredFields = implode ( ',' , $ fields ) ; } else { $ this -> requiredFields = $ fields ; } } return $ this ; }
Allows you to add to the list of fields requested for the provider s authorization .
7,557
public function setOptional ( $ fields ) { if ( empty ( $ fields ) === false ) { if ( is_array ( $ fields ) === true ) { $ this -> optionalFields = implode ( ',' , $ fields ) ; } else { $ this -> optionalFields = $ fields ; } } return $ this ; }
Allows you to add to the list of optionals fields .
7,558
public function setType ( $ type ) { if ( is_array ( $ type ) === true ) { $ type = $ type [ key ( $ type ) ] ; } $ this -> types = array_flip ( $ this -> types ) ; if ( isset ( $ this -> types [ $ type ] ) === true ) { $ this -> widget = $ type ; } return $ this ; }
Lets you specify the widget type . Must match the variable types
7,559
public function setUrl ( $ url = '' ) { if ( is_array ( $ url ) === true ) { $ url = $ url [ key ( $ url ) ] ; } $ request = new Request ( ) ; if ( empty ( $ url ) === true ) { $ this -> url = $ request -> getScheme ( ) . '://' . $ request -> getHttpHost ( ) . ( new Router ( ) ) -> getRewriteUri ( ) ; } else { $ this -...
Lets you specify the callback url to redirect to when authorizing the page is reloaded . If the url is not specified and is used to redirect the authorization the authorization after the current page just updated
7,560
private function destroyUserData ( ) { if ( is_array ( $ this -> user ) === true && isset ( $ this -> user [ "error" ] ) === true ) { $ this -> user = false ; return true ; } return false ; }
Destroy user data
7,561
public function getToken ( ) { $ request = new Request ( ) ; if ( $ request -> isPost ( ) === true ) { $ this -> token = $ request -> getPost ( 'token' , null , false ) ; } else { $ this -> token = $ request -> getQuery ( 'token' , null , false ) ; } return $ this -> token ; }
Reads the parameters passed to the script and selects the authorization key ULogin
7,562
public function getUser ( ) { $ this -> destroyUserData ( ) ; if ( $ this -> user === false ) { $ url = 'http://ulogin.ru/token.php?token=' . $ this -> getToken ( ) . '&host=' . ( new Request ( ) ) -> getHttpHost ( ) ; $ content = file_get_contents ( $ url ) ; $ this -> user = json_decode ( $ content , true ) ; if ( $ ...
Returns an associative array with the data about the user . Fields array described in the method setFields
7,563
public function isAuthorised ( ) { if ( is_array ( $ this -> user ) === true && isset ( $ this -> user [ 'error' ] ) === false ) { return true ; } return $ this -> getUser ( ) ; }
Checks whether logon
7,564
public function getForm ( ) { $ view = new View ( ) ; return $ view -> render ( __DIR__ . '/../views/ulogin' , [ 'widget' => $ this -> widget , 'fields' => $ this -> requiredFields , 'optional' => $ this -> optionalFields , 'providers' => $ this -> requiredProviders , 'hidden' => $ this -> hiddenProviders , 'url' => $ ...
Returns the html - form widget
7,565
public function setOverwrite ( $ state = false ) { $ tmp = $ this -> overwrite ; if ( $ state ) { $ this -> overwrite = true ; } else { $ this -> overwrite = false ; } return $ tmp ; }
Set the allow overwrite switch
7,566
public function setUpgrade ( $ state = false ) { $ tmp = $ this -> upgrade ; if ( $ state ) { $ this -> upgrade = true ; } else { $ this -> upgrade = false ; } return $ tmp ; }
Set the upgrade switch
7,567
public function getPath ( $ name , $ default = null ) { return ( ! empty ( $ this -> paths [ $ name ] ) ) ? $ this -> paths [ $ name ] : $ default ; }
Get an installer path by name
7,568
public function abort ( $ msg = null , $ type = null ) { $ retval = true ; $ step = array_pop ( $ this -> stepStack ) ; if ( $ msg ) { $ this -> log ( LogLevel :: WARNING , $ msg ) ; } while ( $ step != null ) { switch ( $ step [ 'type' ] ) { case 'file' : $ stepval = File :: delete ( $ step [ 'path' ] ) ; break ; case...
Installation abort method
7,569
public function parseFiles ( SimpleXMLElement $ element , $ cid = 0 , $ oldFiles = null , $ oldMD5 = null ) { if ( ! $ element || ! $ element -> children ( ) -> count ( ) ) { return 0 ; } $ copyfiles = array ( ) ; $ pathname = 'extension_root' ; $ destination = $ this -> getPath ( $ pathname ) ; $ folder = ( string ) $...
Method to parse through a files element of the installation manifest and take appropriate action .
7,570
public function send ( Parameters $ params ) { $ this -> client -> setUri ( ReCaptcha :: VERIFY_SERVER ) ; $ this -> client -> setRawBody ( $ params -> toQueryString ( ) ) ; $ this -> client -> setEncType ( 'application/x-www-form-urlencoded' ) ; $ result = $ this -> client -> setMethod ( 'POST' ) -> send ( ) ; return ...
Submit ReCaptcha API request return response body .
7,571
public function operate ( Expression $ left , Expression $ right ) { $ typeSpec = self :: $ opTypes [ $ this -> name ] ; $ leftType = self :: $ typeSpecMap [ $ typeSpec [ 0 ] ] ; $ rightType = self :: $ typeSpecMap [ $ typeSpec [ 1 ] ] ; $ resultType = self :: $ typeSpecMap [ $ typeSpec [ 2 ] ] ; $ start = min ( $ this...
Compute the operation
7,572
public function addPageControl ( Control $ pageControl , $ pageNumber = null ) { if ( $ pageNumber === null ) { $ pageNumber = count ( $ this -> pages ) + 1 ; } $ page = new PagingPage ( $ pageControl , $ pageNumber ) ; return $ this -> addPage ( $ page ) ; }
Add a new Page Control
7,573
public function addPage ( PagingPage $ page ) { if ( ! in_array ( $ page , $ this -> pages , true ) ) { array_push ( $ this -> pages , $ page ) ; } return $ this ; }
Add a new Page
7,574
public function setPages ( array $ pages ) { $ this -> pages = array ( ) ; foreach ( $ pages as $ page ) { $ this -> addPage ( $ page ) ; } return $ this ; }
Add new Pages
7,575
public function addButtonControl ( Control $ buttonControl , $ browseAction = null ) { if ( $ browseAction === null ) { $ buttonCount = count ( $ this -> buttons ) ; if ( $ buttonCount % 2 === 0 ) { $ browseAction = $ buttonCount / 2 + 1 ; } else { $ browseAction = $ buttonCount / - 2 - 1 ; } } $ button = new PagingBut...
Add a new Button Control to browse through the Pages
7,576
public function addButton ( PagingButton $ button ) { if ( ! in_array ( $ button , $ this -> buttons , true ) ) { array_push ( $ this -> buttons , $ button ) ; } return $ this ; }
Add a new Button to browse through Pages
7,577
public function setButtons ( array $ buttons ) { $ this -> buttons = array ( ) ; foreach ( $ buttons as $ button ) { $ this -> addButton ( $ button ) ; } return $ this ; }
Set the Paging Buttons
7,578
protected function getMinPage ( ) { $ minPageNumber = null ; $ minPage = null ; foreach ( $ this -> pages as $ page ) { $ pageNumber = $ page -> getPageNumber ( ) ; if ( $ minPageNumber === null || $ pageNumber < $ minPageNumber ) { $ minPageNumber = $ pageNumber ; $ minPage = $ page ; } } return $ minPage ; }
Get the minimum Page
7,579
protected function getMaxPage ( ) { $ maxPageNumber = null ; $ maxPage = null ; foreach ( $ this -> pages as $ page ) { $ pageNumber = $ page -> getPageNumber ( ) ; if ( $ maxPageNumber === null || $ pageNumber > $ maxPageNumber ) { $ maxPageNumber = $ pageNumber ; $ maxPage = $ page ; } } return $ maxPage ; }
Get the maximum Page
7,580
protected function getPagesArrayText ( ) { if ( empty ( $ this -> pages ) ) { return Builder :: getArray ( array ( 0 => '' ) , true ) ; } $ pages = array ( ) ; foreach ( $ this -> pages as $ page ) { $ pages [ $ page -> getPageNumber ( ) ] = $ page -> getControl ( ) -> getId ( ) ; } return Builder :: getArray ( $ pages...
Build the array text for the Pages
7,581
protected function getPageButtonsArrayText ( ) { if ( empty ( $ this -> buttons ) ) { return Builder :: getArray ( array ( '' => 0 ) , true ) ; } $ pageButtons = array ( ) ; foreach ( $ this -> buttons as $ pageButton ) { $ pageButtons [ $ pageButton -> getControl ( ) -> getId ( ) ] = $ pageButton -> getPagingCount ( )...
Build the array text for the Page Buttons
7,582
public static function factory ( string $ name , $ options = null ) : RepositoryInterface { try { $ className = sprintf ( '%s\%sRepository' , self :: getNamespace ( ) , ucfirst ( strtolower ( $ name ) ) ) ; $ reflectionClass = new \ ReflectionClass ( $ className ) ; if ( is_null ( $ options ) ) { return $ reflectionCla...
Returns the desired repository using the provided data .
7,583
public function toObject ( ) { $ obj = new stdClass ( ) ; if ( ! empty ( $ this -> attributes ) ) { foreach ( $ this -> attributes as $ key => $ value ) { $ obj -> $ key = $ value ; } } return $ obj ; }
Convert this class to a standard object .
7,584
public function calculate ( ColorJizz $ foreground , ColorJizz $ background ) { $ fgLuma = $ this -> relativeLuminosity ( $ foreground -> toRGB ( ) ) ; $ bgLuma = $ this -> relativeLuminosity ( $ background -> toRGB ( ) ) ; if ( $ fgLuma > $ bgLuma ) { return ( $ fgLuma + 0.05 ) / ( $ bgLuma + 0.05 ) ; } else { return ...
returns the contrast ratio between foreground and background color .
7,585
public static function arrayResolve ( array $ data ) { $ array = [ ] ; foreach ( $ data as $ provider => $ bool ) { if ( $ bool === true ) { $ array [ 'required' ] [ ] = $ provider ; } else { $ array [ 'hidden' ] [ ] = $ provider ; } } return $ array ; }
Resolve array data as providers
7,586
private static function isDelim ( $ provider , $ delimiter = '=' ) { if ( mb_strpos ( $ provider , $ delimiter ) !== false ) { $ res = explode ( '=' , $ provider ) ; return $ res ; } return false ; }
Check if data has delimiter
7,587
public static function encodeParams ( string $ html , array $ variables = [ ] ) : string { $ normalizedVariables = [ ] ; if ( is_array ( $ variables ) ) { foreach ( $ variables as $ key => $ value ) { $ key = '{' . trim ( $ key , '{}' ) . '}' ; $ normalizedVariables [ $ key ] = static :: encode ( $ value ) ; } $ html =...
Will take an HTML string and an associative array of key = > value pairs HTML encode the values and swap them back into the original string using the keys as tokens .
7,588
public function setRed ( float $ red , float $ scale = 1. ) { $ this -> red = $ this -> setComponent ( $ red , $ scale ) ; return $ this ; }
Sets the red component of the color .
7,589
public function setGreen ( float $ green , float $ scale = 1. ) { $ this -> green = $ this -> setComponent ( $ green , $ scale ) ; return $ this ; }
Sets the green component of the color .
7,590
public function setBlue ( float $ blue , float $ scale = 1. ) { $ this -> blue = $ this -> setComponent ( $ blue , $ scale ) ; return $ this ; }
Sets the blue component of the color .
7,591
public function setAlpha ( float $ alpha , float $ scale = 1. ) { $ this -> alpha = $ this -> setComponent ( $ alpha , $ scale ) ; return $ this ; }
Sets the alpha component of the color .
7,592
protected function setComponent ( float $ value , float $ scale ) : float { return ( $ scale < 0 ) ? ( 1 - $ value / - $ scale ) : ( $ value / $ scale ) ; }
Calculates the value to set a component .
7,593
protected function getComponent ( float $ value , float $ scale ) : float { return ( $ scale < 0 ) ? ( ( 1 - $ value ) * - $ scale ) : ( $ value * $ scale ) ; }
Calculates the value to get a component .
7,594
public function getNotificationDispatcher ( ) : ? Dispatcher { if ( ! $ this -> hasNotificationDispatcher ( ) ) { $ this -> setNotificationDispatcher ( $ this -> getDefaultNotificationDispatcher ( ) ) ; } return $ this -> notificationDispatcher ; }
Get notification dispatcher
7,595
public static function _init ( ) { static :: $ path_offset = ClanCats :: $ config -> get ( 'url.path' , '/' ) ; if ( empty ( static :: $ path_offset ) ) { static :: $ path_offset = '/' ; } if ( substr ( static :: $ path_offset , - 1 ) != '/' ) { static :: $ path_offset .= '/' ; } static :: $ parameter_provider = array ...
static CCUrl initialisation
7,596
public static function to ( $ uri = '' , $ params = array ( ) , $ retain = false ) { if ( $ uri === '/' ) { $ uri = '' ; } if ( substr ( $ uri , 0 , 1 ) == '@' ) { return static :: alias ( substr ( $ uri , 1 ) , $ params , $ retain ) ; } if ( strpos ( $ uri , '?' ) !== false ) { $ parts = explode ( '?' , $ uri ) ; $ ur...
Generate an url
7,597
public static function alias ( $ alias , $ params = array ( ) , $ retain = false ) { $ route_params = array ( ) ; $ suffix = '' ; if ( strpos ( $ alias , '/' ) !== false && $ alias !== '/' ) { list ( $ alias , $ suffix ) = explode ( '/' , $ alias ) ; $ suffix = '/' . $ suffix ; } foreach ( $ params as $ key => $ value ...
Create an URL based on an router alias
7,598
public static function full ( $ uri = '' , $ params = array ( ) , $ retain = false ) { return CCIn :: protocol ( ) . '://' . CCIn :: host ( ) . static :: to ( $ uri , $ params , $ retain ) ; }
Create the full url including protocol and hostname
7,599
public static function secure ( $ uri = '' , $ params = array ( ) , $ retain = false ) { return 'https://' . CCIn :: host ( ) . static :: to ( $ uri , $ params , $ retain ) ; }
Create the url and force the https protocol