idx
int64
0
60.3k
question
stringlengths
101
6.21k
target
stringlengths
7
803
44,700
protected function updateDepths ( $ nodes , $ value ) { $ config = $ this -> config ; $ this -> getFluent ( ) -> update ( $ config [ 'table' ] ) -> set ( $ config [ 'dpt' ] , new FluentLiteral ( "$config[dpt] + $value" ) ) -> where ( $ config [ 'id' ] , $ nodes ) -> execute ( ) ; }
Update nodes depths .
44,701
protected function updateNodeParent ( $ nodeId , $ parent ) { $ config = $ this -> config ; $ this -> getFluent ( ) -> update ( $ config [ 'table' ] ) -> set ( $ config [ 'prt' ] , $ parent ) -> where ( $ config [ 'id' ] , $ nodeId ) -> execute ( ) ; }
Set node the new parent .
44,702
public function paging ( $ records , $ pageURL , $ start = 0 , $ maxshown = 50 , $ numpagesshown = 11 , $ arrows = true , $ additional = array ( ) ) { self :: $ pageURL = $ pageURL ; $ this -> queryString = $ additional ; if ( $ records > $ maxshown ) { self :: $ current = $ start >= 1 ? intval ( $ start ) : 1 ; self :: $ totalPages = ceil ( intval ( $ records ) / ( $ maxshown >= 1 ? intval ( $ maxshown ) : 1 ) ) ; self :: $ lastpage = self :: $ totalPages ; $ this -> getPage ( $ records , $ maxshown , $ numpagesshown ) ; $ paging = '<ul class="' . $ this -> getPaginationClass ( ) . '">' . $ this -> preLinks ( $ arrows ) ; while ( self :: $ page <= self :: $ lastpage ) { $ paging .= $ this -> buildLink ( self :: $ page , self :: $ page , ( self :: $ current == self :: $ page ) ) ; self :: $ page = ( self :: $ page + 1 ) ; } return $ paging . $ this -> postLinks ( $ arrows ) . '</ul>' ; } return false ; }
Returns paging buttons for the number of records
44,703
protected function buildLink ( $ link , $ page , $ current = false ) { return '<li' . ( ! empty ( $ this -> getLiClass ( ) ) || ( $ current === true && ! empty ( $ this -> getLiActiveClass ( ) ) ) ? ' class="' . trim ( $ this -> getLiClass ( ) . ( ( $ current === true && ! empty ( $ this -> getLiActiveClass ( ) ) ) ? ' ' . $ this -> getLiActiveClass ( ) : '' ) . '"' ) : '' ) . '><a href="' . self :: $ pageURL . ( ! empty ( $ this -> buildQueryString ( $ link ) ) ? '?' . $ this -> buildQueryString ( $ link ) : '' ) . '" title="Page ' . $ page . '"' . ( ! empty ( $ this -> getAClass ( ) ) || ( $ current === true && ! empty ( $ this -> getAActiveClass ( ) ) ) ? ' class="' . trim ( $ this -> getAClass ( ) . ( ( $ current === true && ! empty ( $ this -> getAActiveClass ( ) ) ) ? ' ' . $ this -> getAActiveClass ( ) : '' ) ) . '"' : '' ) . '>' . $ page . '</a></li>' ; }
Build a link item with the given values
44,704
protected function buildQueryString ( $ page ) { $ pageInfo = is_numeric ( $ page ) ? [ 'page' => $ page ] : [ ] ; return http_build_query ( array_filter ( array_merge ( $ pageInfo , $ this -> queryString ) ) , '' , '&amp;' ) ; }
Builds the query string to add to the URL
44,705
protected function getPage ( $ records , $ maxshown , $ numpages ) { $ show = floor ( $ numpages / 2 ) ; if ( self :: $ lastpage > $ numpages ) { self :: $ page = ( self :: $ current > $ show ? ( self :: $ current - $ show ) : 1 ) ; if ( self :: $ current < ( self :: $ lastpage - $ show ) ) { self :: $ lastpage = ( ( self :: $ current <= $ show ) ? ( self :: $ current + ( $ numpages - self :: $ current ) ) : ( self :: $ current + $ show ) ) ; } else { self :: $ page = self :: $ current - ( $ numpages - ( ( ceil ( intval ( $ records ) / ( $ maxshown >= 1 ? intval ( $ maxshown ) : 1 ) ) - self :: $ current ) ) - 1 ) ; } } else { self :: $ page = 1 ; } }
Gets the current page
44,706
protected function preLinks ( $ arrows = true ) { $ paging = '' ; if ( self :: $ current != 1 && $ arrows ) { if ( self :: $ current != 2 ) { $ paging .= $ this -> buildLink ( '' , '&laquo;' ) ; } $ paging .= $ this -> buildLink ( ( self :: $ current - 1 ) , '&lt;' ) ; } return $ paging ; }
Returns the previous arrows as long as arrows is set to true and the page is not the first page
44,707
protected function postLinks ( $ arrows = true ) { $ paging = '' ; if ( self :: $ current != self :: $ totalPages && $ arrows ) { $ paging .= $ this -> buildLink ( ( self :: $ current + 1 ) , '&gt;' ) ; if ( self :: $ current != ( self :: $ totalPages - 1 ) ) { $ paging .= $ this -> buildLink ( self :: $ totalPages , '&raquo;' ) ; } } return $ paging ; }
Returns the next arrows as long as arrows is set to true and the page is not the last page
44,708
public function events ( int $ iMemberId = null , bool $ bPublicEvents = false ) { $ aReturn = [ ] ; $ this -> oModel -> forMember ( $ iMemberId ) -> public ( $ bPublicEvents ) ; foreach ( $ this -> oModel -> fetch ( $ this -> strDate ) as $ aEvent ) $ aReturn [ ] = new SkeVent ( $ aEvent ) ; return $ aReturn ; }
Get today s events .
44,709
protected function find_file ( $ cache = true ) { if ( ( $ this -> file [ 0 ] === '/' or ( isset ( $ this -> file [ 1 ] ) and $ this -> file [ 1 ] === ':' ) ) and is_file ( $ this -> file ) ) { $ paths = array ( $ this -> file ) ; } else { $ paths = array_merge ( \ Finder :: search ( 'config/' . \ Fuel :: $ env , $ this -> file , $ this -> ext , true , $ cache ) , \ Finder :: search ( 'config' , $ this -> file , $ this -> ext , true , $ cache ) ) ; } if ( empty ( $ paths ) ) { throw new \ ConfigException ( sprintf ( 'File "%s" does not exist.' , $ this -> file ) ) ; } return array_reverse ( $ paths ) ; }
Finds the given config files
44,710
public function toRoute ( $ name , array $ params = [ ] ) { $ url = $ this -> getUrl ( ) -> fromRoute ( $ name , $ params ) ; return $ this -> toUrl ( $ url ) ; }
Generates redirection by given route .
44,711
public function toUrl ( $ url , $ statusCode = 302 ) { $ server = $ this -> getServer ( ) ; $ response = $ server -> getResponse ( false ) -> withHeader ( 'Location' , $ url ) -> withStatus ( $ statusCode ) ; return $ response ; }
Generates redirection by given url .
44,712
public function checkNavigator ( ) { if ( ! $ this -> checkControllerExists ( ) ) { $ this -> setNotFound ( ) ; return ; } if ( array_key_exists ( 'params' , $ this -> config ) && is_array ( $ this -> config [ 'params' ] ) ) { $ merged = array_merge ( $ this -> config [ 'params' ] , $ this -> request -> getQueryParams ( ) ) ; $ this -> request = $ this -> request -> withQueryParams ( $ merged ) ; } $ this -> controller = new $ this -> config [ 'controller_name' ] ( $ this -> request ) ; $ this -> controller -> setServerEnvironment ( $ this -> getEnv ( ) ) ; if ( ! $ this -> checkActionExists ( ) ) { $ this -> setNotFound ( ) ; } return null ; }
Gaaarrr! Check the Navigator be readin the map!
44,713
private function setNotFound ( ) { $ this -> config [ 'controller_name' ] = class_exists ( '\App\Controller\ErrorController' ) ? '\App\Controller\ErrorController' : '\Bone\Mvc\Controller' ; $ this -> config [ 'action_name' ] = 'notFoundAction' ; $ this -> config [ 'controller' ] = 'error' ; $ this -> config [ 'action' ] = 'not-found' ; $ this -> controller = new $ this -> config [ 'controller_name' ] ( $ this -> request ) ; $ this -> controller -> setServerEnvironment ( $ this -> getEnv ( ) ) ; $ this -> response = $ this -> response -> withStatus ( 404 ) ; }
Sets controller to error and action to not found
44,714
public function get ( $ key , $ default = null ) { if ( isset ( $ this -> contents [ $ key ] ) ) { return $ this -> contents [ $ key ] ; } return $ default ; }
Get value for key
44,715
public static function flash ( $ name , $ string = '' ) { if ( self :: exists ( $ name ) ) { $ session = self :: get ( $ name ) ; self :: delete ( $ name ) ; return $ session ; } else { self :: set ( $ name , $ string ) ; } return '' ; }
flash form alert messages
44,716
private function addParameters ( \ DOMElement $ parent ) { $ data = $ this -> container -> getParameterBag ( ) -> all ( ) ; if ( ! $ data ) { return ; } if ( $ this -> container -> isFrozen ( ) ) { $ data = $ this -> escape ( $ data ) ; } $ parameters = $ this -> document -> createElement ( 'parameters' ) ; $ parent -> appendChild ( $ parameters ) ; $ this -> convertParameters ( $ data , 'parameter' , $ parameters ) ; }
Adds parameters .
44,717
public function addArguments ( array $ arguments ) { foreach ( $ arguments as $ param => $ value ) { $ this -> addArgument ( $ param , $ value ) ; } return $ this ; }
Adiciona uma lista de argumentos .
44,718
public function getArgument ( $ name ) { if ( isset ( $ this -> arguments [ $ name ] ) ) { return $ this -> arguments [ $ name ] ; } return null ; }
Devolve o argumento especificado .
44,719
public function addRecipient ( $ name , $ email , $ amount ) { if ( count ( $ this -> recipients ) == self :: LIMIT_RECIPIENTS ) { return ; } $ this -> recipients [ ] = array ( 'name' => $ name , 'email' => $ email , 'amount' => $ amount , ) ; }
Metodo que asigna a la variable recipientes un nuevo destinatario .
44,720
public static function fileNoExtension ( $ file , $ folder ) { if ( is_array ( $ file ) ) return false ; $ exts = new Extensions ( ) ; if ( strstr ( $ file , '.' ) && $ exts -> check ( $ file ) ) return false ; $ files = self :: fileAll ( $ folder ) ; foreach ( $ files as $ v ) { $ exp = explode ( DIRECTORY_SEPARATOR , $ v ) ; $ file_sch = explode ( '.' , end ( $ exp ) ) ; $ ky = count ( $ file_sch ) - 1 ; $ file_ext = $ file_sch [ $ ky ] ; unset ( $ file_sch [ $ ky ] ) ; if ( implode ( '.' , $ file_sch ) == $ file ) return $ folder . DIRECTORY_SEPARATOR . $ file . '.' . $ file_ext ; } return false ; }
If no exists extension in file find file with the your extension
44,721
protected function addProvider ( ContainerBuilder $ container , $ dir , $ bundle ) { if ( $ container -> hasDefinition ( 'integrated_solr.converter.config.provider.file.' . $ bundle ) ) { return null ; } if ( ! is_dir ( $ dir . '/Resources/config/solr' ) ) { return null ; } $ definition = new Definition ( XmlProvider :: class ) ; $ definition -> setPublic ( false ) ; $ definition -> setArguments ( [ $ this -> addFinder ( $ container , $ dir . '/Resources/config/solr' , $ bundle ) ] ) ; $ container -> setDefinition ( 'integrated_solr.converter.config.provider.file.' . $ bundle , $ definition ) ; return new Reference ( 'integrated_solr.converter.config.provider.file.' . $ bundle ) ; }
Create a provider definition .
44,722
protected function addFinder ( ContainerBuilder $ container , $ dir , $ bundle ) { $ ref = new Reference ( 'integrated_solr.converter.config.provider.file.' . $ bundle . '.finder' ) ; if ( $ container -> hasDefinition ( 'integrated_solr.converter.config.provider.file.' . $ bundle . '.finder' ) ) { return $ ref ; } $ container -> addResource ( new FileResource ( $ dir ) ) ; $ definition = new Definition ( Finder :: class ) ; $ definition -> setPublic ( false ) ; $ definition -> addMethodCall ( 'in' , [ $ dir ] ) ; $ container -> setDefinition ( 'integrated_solr.converter.config.provider.file.' . $ bundle . '.finder' , $ definition ) ; return $ ref ; }
Create a finder definition .
44,723
public function establish ( ) { if ( isset ( $ this -> established ) && $ this -> established ) { return true ; } if ( ! $ this -> socket = @ fsockopen ( $ this -> host , $ this -> port , $ errn , $ errs , 5 ) ) { throw new MPDConnectionException ( 'Connection failed: ' . $ errs , self :: MPD_CONNECTION_FAILED ) ; } while ( ! feof ( $ this -> socket ) ) { $ response = trim ( fgets ( $ this -> socket ) ) ; if ( strncmp ( self :: MPD_OK , $ response , strlen ( self :: MPD_OK ) ) == 0 ) { $ this -> established = true ; $ this -> version = preg_replace ( '/[0]$/' , 'x' , current ( sscanf ( $ response , self :: MPD_OK . " MPD %s\n" ) ) ) ; return true ; } if ( strncmp ( self :: MPD_ERROR , $ response , strlen ( self :: MPD_ERROR ) ) == 0 ) { preg_match ( '/^ACK \[(.*?)\@(.*?)\] \{(.*?)\} (.*?)$/' , $ response , $ matches ) ; throw new MPDConnectionException ( 'Connection failed: ' . $ matches [ 4 ] , self :: MPD_CONNECTION_FAILED ) ; } } throw new MPDConnectionException ( 'Connection failed' , self :: MPD_CONNECTION_FAILED ) ; }
Establishes a connection to the MPD server
44,724
public function close ( ) { try { if ( isset ( $ this -> socket ) ) { fclose ( $ this -> socket ) ; unset ( $ this -> socket ) ; $ this -> established = false ; } } catch ( Exception $ e ) { throw new MPDConnectionException ( 'Disconnection failed: ' . $ e -> getMessage ( ) , self :: MPD_DISCONNECTION_FAILED ) ; } return true ; }
Closes the connection to the MPD server
44,725
public function determineIfLocal ( ) { $ this -> local = false ; if ( ( stream_is_local ( $ this -> socket ) ) || ( $ this -> host == ( isset ( $ _SERVER [ "SERVER_ADDR" ] ) ? $ _SERVER [ "SERVER_ADDR" ] : getHostByName ( getHostName ( ) ) ) ) || ( $ this -> host == 'localhost' ) || ( $ this -> host == '127.0.0.1' ) ) { $ this -> local = true ; } }
determineIfLocal tries to determine if the connection to MPD is local
44,726
public function showAction ( Brand $ brand ) { $ deleteForm = $ this -> createDeleteForm ( $ brand ) ; return array ( 'entity' => $ brand , 'delete_form' => $ deleteForm -> createView ( ) , ) ; }
Finds and displays a Brand entity .
44,727
public function deleteAction ( Request $ request , Brand $ brand ) { $ form = $ this -> createDeleteForm ( $ brand ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> remove ( $ brand ) ; $ em -> flush ( ) ; $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'info' , 'brand.deleted' ) ; } return $ this -> redirectToRoute ( 'ecommerce_brand_index' ) ; }
Deletes a Brand entity .
44,728
private function createDeleteForm ( Brand $ brand ) { return $ this -> createFormBuilder ( ) -> setAction ( $ this -> generateUrl ( 'ecommerce_brand_delete' , array ( 'id' => $ brand -> getId ( ) ) ) ) -> setMethod ( 'DELETE' ) -> getForm ( ) ; }
Creates a form to delete a Brand entity .
44,729
public function upperWords ( $ delimiters = " \t\r\n\f\v" ) { return static :: of ( mb_ucwords ( $ this -> contents , $ delimiters , $ this -> encoding ) , $ this -> encoding ) ; }
Return the string with all the words in upper case .
44,730
public function beginsWith ( $ prefix ) { return $ prefix === '' || mb_strpos ( $ this -> contents , ( string ) $ prefix , null , $ this -> encoding ) === 0 ; }
Returns true if the string begins with the provided string .
44,731
public function endsWith ( $ suffix ) { return $ suffix === '' || $ suffix === mb_substr ( $ this -> contents , - strlen ( ( string ) $ suffix ) , null , $ this -> encoding ) ; }
Returns true if the string ends with the provided string .
44,732
public function contains ( $ inner ) { return mb_strpos ( $ this -> contents , ( string ) $ inner , null , $ this -> encoding ) !== false ; }
Returns true if the string contains the provided string .
44,733
public function reverse ( ) { return static :: of ( ArrayList :: of ( $ this -> split ( ) ) -> reverse ( ) -> join ( ) , $ this -> encoding ) ; }
Return the string with all its characters reversed .
44,734
public function concat ( ... $ others ) { return static :: of ( Std :: foldl ( function ( $ carry , $ part ) { return $ carry . ( string ) $ part ; } , $ this -> contents , $ others ) , $ this -> encoding ) ; }
Concatenate with other strings .
44,735
public function equals ( Rope $ other ) { return $ this -> contents === $ other -> contents && $ this -> encoding === $ other -> encoding ; }
Return whether this Rope is equal to another .
44,736
public function getMessageDataSchema ( MessageInterface $ message ) : \ stdClass { $ parts = explode ( '.' , $ message -> getPurpose ( ) ) ; if ( empty ( $ parts ) ) { throw new InvalidMessageDataException ( 'The message "purpose" property should clearly define specific message schema' ) ; } if ( $ this -> cache -> has ( $ message -> getPurpose ( ) ) ) { return $ this -> cache -> get ( $ message -> getPurpose ( ) ) ; } $ file_name = array_pop ( $ parts ) . '.schema.json' ; $ purpose_dirs = '' ; if ( ! empty ( $ parts ) ) { $ purpose_dirs = implode ( DIRECTORY_SEPARATOR , $ parts ) ; } $ schema_dirs = array_filter ( array_map ( function ( $ dir ) use ( $ purpose_dirs , $ message ) { $ schema_dir = $ dir . DIRECTORY_SEPARATOR . $ message -> getVersion ( ) . DIRECTORY_SEPARATOR . $ purpose_dirs ; if ( file_exists ( $ schema_dir ) ) { return $ schema_dir ; } return NULL ; } , $ this -> schemaDirs ) ) ; $ file_locator = new FileLocator ( $ schema_dirs ) ; try { $ path = $ file_locator -> locate ( $ file_name ) ; $ schema = json_decode ( file_get_contents ( $ path ) ) ; $ this -> cache -> set ( $ message -> getPurpose ( ) , $ schema ) ; return $ schema ; } catch ( FileLocatorFileNotFoundException $ e ) { throw new InvalidMessageDataException ( 'Could not find message with purpose "' . $ message -> getPurpose ( ) . '"' ) ; } }
Gets message schema .
44,737
public static function cleanUpOldModules ( Event $ event ) { $ composer = $ event -> getComposer ( ) ; $ requires = $ composer -> getPackage ( ) -> getRequires ( ) ; $ projectPath = str_replace ( 'vendor/vkf/shop' , '' , $ composer -> getInstallationManager ( ) -> getInstallpath ( $ composer -> getPackage ( ) ) ) ; $ modulePath = $ projectPath . 'htdocs/modules' ; foreach ( array ( 'ra' , 'vkf' ) as $ renzelVendorDir ) { foreach ( glob ( $ modulePath . '/' . $ renzelVendorDir . '/*' ) as $ file ) { if ( is_dir ( $ file ) ) { $ packageId = str_replace ( $ modulePath . '/' , '' , $ file ) ; if ( ! isset ( $ requires [ $ packageId ] ) ) { self :: rmdir ( $ file ) ; $ event -> getIO ( ) -> write ( 'Deleted old package ' . $ packageId ) ; } } } } }
cleanup deleted modules
44,738
public function getInstallPath ( PackageInterface $ package ) { if ( $ package -> getType ( ) === 'oxid-base' ) { return $ this -> _locations [ $ package -> getType ( ) ] ; } $ themeName = "ra" ; $ extra = $ package -> getExtra ( ) ; $ installFolder = $ this -> _locations [ $ package -> getType ( ) ] . '/' . str_replace ( array ( $ themeName . "/" , '-theme' ) , '' , $ package -> getPrettyName ( ) ) ; if ( $ extra ) { $ themeName = $ extra [ "themeName" ] ; $ installFolder = $ this -> _locations [ $ package -> getType ( ) ] . '/' . $ themeName ; } return $ installFolder ; }
get install path by package
44,739
protected function notify ( $ title , $ message , $ icon = null ) { $ app = __DIR__ . '/../../bin/toast.exe' ; $ title = iconv ( 'UTF-8' , 'ASCII//TRANSLIT' , $ title ) ; $ message = iconv ( 'UTF-8' , 'ASCII//TRANSLIT' , $ message ) ; $ icon = is_string ( $ icon ) ? " -p \"$icon\"" : $ this -> icon ; $ this -> execute ( "$app -t \"{$title}\" -m \"{$message}\"$icon" ) ; }
Notify with toast . exe .
44,740
public function reset ( ) { $ originalSettings = $ this -> settings ; $ this -> settings = array ( ) ; if ( file_put_contents ( $ this -> cacheFileName , "{}" ) === FALSE ) { $ this -> settings = $ originalSettings ; return FALSE ; } return TRUE ; }
resets complete cache to empty
44,741
function convert_absolute_path_to_url ( $ absolute_path ) { $ file_base = str_replace ( ABSPATH , '' , $ absolute_path ) ; $ file_url = trailingslashit ( site_url ( ) ) . $ file_base ; return $ file_url ; }
Converts an absolute path to a file into a url to the file .
44,742
function convert_url_to_absolute_path ( $ file_url ) { $ file_base = str_replace ( trailingslashit ( site_url ( ) ) , '' , $ file_url ) ; $ absolute_path = ABSPATH . $ file_base ; return $ absolute_path ; }
Converts a url to a file into an absolute path to the file .
44,743
public function is_external_file ( $ file_url ) { $ is_external_file = false ; $ parsed_file_url = parse_url ( $ file_url ) ; $ parsed_site_url = parse_url ( site_url ( ) ) ; if ( $ parsed_file_url [ 'host' ] !== $ parsed_site_url [ 'host' ] ) { $ is_external_file = true ; } return $ is_external_file ; }
Determines if a file is externally hosted based on url .
44,744
public function is_uploaded_file ( $ file_url ) { $ is_uploaded_file = false ; $ wp_upload_directory = wp_upload_dir ( ) ; if ( false !== strpos ( $ file_url , $ wp_upload_directory [ 'baseurl' ] ) ) { $ is_uploaded_file = true ; } return $ is_uploaded_file ; }
Determines if a file is a file that was uploaded to WordPress .
44,745
private function register ( ) { $ this -> options [ 'labels' ] = $ this -> label ; if ( ! isset ( $ this -> options [ 'rewrite' ] ) ) { $ this -> options [ 'rewrite' ] = array ( 'slug' => $ this -> singular ) ; } $ _self = & $ this ; add_action ( 'init' , function ( ) use ( & $ _self ) { register_post_type ( $ _self -> singular , $ _self -> options ) ; } ) ; }
Register the post type
44,746
public function generate ( ) : string { $ condID = ( string ) $ this -> attributes [ 'data-conditional-id' ] ; $ getState = $ this -> vHandler -> get -> get ( $ condID . '_state' , Variables :: TYPE_INT ) == 1 ; $ postState = $ this -> vHandler -> post -> get ( $ condID . '_state' , Variables :: TYPE_INT ) == 1 ; $ visible = $ getState || $ postState ; $ this -> attributes [ 'class' ] .= $ visible === true ? ' visible' : '' ; $ elements = [ ] ; $ elements [ ] = Controlls \ Text :: inputHidden ( $ condID . '_state' , ( int ) $ visible , [ 'method-get' => true , 'id' => '' ] ) ; foreach ( $ this -> elements as $ element ) { $ elements [ ] = $ element -> generate ( ) ; } return Tags :: div ( $ elements , $ this -> attributes ) ; }
Generates from conditional and returns it
44,747
protected function _normalizeArray ( $ value ) { if ( $ value instanceof stdClass ) { $ value = ( array ) $ value ; } if ( is_array ( $ value ) ) { return $ value ; } if ( ! ( $ value instanceof Traversable ) ) { throw $ this -> _createInvalidArgumentException ( $ this -> __ ( 'Not an iterable' ) , null , null , $ value ) ; } $ value = iterator_to_array ( $ value , true ) ; return $ value ; }
Normalizes a value into an array .
44,748
public static function unstackErrors ( ) { $ level = array_pop ( self :: $ stackedErrorLevels ) ; if ( null !== $ level ) { $ errorReportingLevel = error_reporting ( $ level ) ; if ( $ errorReportingLevel !== ( $ level | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR ) ) { error_reporting ( $ errorReportingLevel ) ; } } if ( empty ( self :: $ stackedErrorLevels ) ) { $ errors = self :: $ stackedErrors ; self :: $ stackedErrors = array ( ) ; foreach ( $ errors as $ error ) { $ error [ 0 ] -> log ( $ error [ 1 ] , $ error [ 2 ] , $ error [ 3 ] ) ; } } }
Unstacks stacked errors and forwards to the logger .
44,749
public function normalizeHeaderKey ( string $ key ) { $ key = strtr ( strtolower ( $ key ) , '_' , '-' ) ; if ( strpos ( $ key , 'http-' ) === 0 ) { $ key = substr ( $ key , 5 ) ; } return $ key ; }
Normalize header name
44,750
public function _read ( $ pId ) { if ( ! isset ( $ this -> _items [ $ pId ] ) ) { $ this -> _items [ $ pId ] = Agl :: getModel ( self :: DB_COLLECTION ) ; $ this -> _items [ $ pId ] -> loadByRealid ( $ pId ) ; } if ( $ this -> _items [ $ pId ] -> getId ( ) ) { return $ this -> _items [ $ pId ] -> getData ( ) ; } return '' ; }
Read the session identified by the ID parameter and return the session data .
44,751
public function _write ( $ pId , $ pData ) { Agl :: validateParams ( array ( 'String' => $ pData ) ) ; $ access = time ( ) ; if ( ! isset ( $ this -> _items [ $ pId ] ) ) { $ this -> _items [ $ pId ] = Agl :: getModel ( self :: DB_COLLECTION ) ; $ this -> _items [ $ pId ] -> loadByRealid ( $ pId ) ; } $ this -> _items [ $ pId ] -> setRealid ( $ pId ) -> setAccess ( $ access ) -> setData ( $ pData ) ; if ( ! $ this -> _items [ $ pId ] -> getId ( ) ) { $ this -> _items [ $ pId ] -> insert ( ) ; } else { $ this -> _items [ $ pId ] -> save ( ) ; } return true ; }
Write the session to the database .
44,752
public function _destroy ( $ pId ) { if ( ! isset ( $ this -> _items [ $ pId ] ) ) { $ this -> _items [ $ pId ] = Agl :: getModel ( self :: DB_COLLECTION ) ; $ this -> _items [ $ pId ] -> loadByRealid ( $ pId ) ; } if ( $ this -> _items [ $ pId ] -> getId ( ) ) { $ this -> _items [ $ pId ] -> delete ( ) ; } return true ; }
Destroy the session from the database .
44,753
public function _clean ( $ pMax ) { Agl :: validateParams ( array ( 'Digit' => $ pMax ) ) ; $ old = time ( ) - $ pMax ; $ collection = new Collection ( self :: DB_COLLECTION ) ; $ conditions = new Conditions ( ) ; $ conditions -> add ( 'access' , Conditions :: LT , $ old ) ; $ collection -> load ( $ conditions ) ; $ collection -> deleteItems ( ) ; return true ; }
Clean the database by deleting old sessions .
44,754
public function register ( Application $ App ) { $ App -> addCommand ( new \ YourApp \ Command \ Foo ( ) ) ; $ App -> addCommand ( new \ YourApp \ Command \ Bar ( ) ) ; $ App -> addCommand ( new \ YourApp \ Command \ Baz ( ) ) ; }
Add the appropriate Command implementations to the Application .
44,755
public static function prettyPrint ( $ data , $ prefix = '' ) { $ php = '[' . PHP_EOL ; if ( is_array ( $ data ) and array_diff_key ( $ data , array_keys ( array_keys ( $ data ) ) ) ) { foreach ( $ data as $ key => $ value ) { $ php .= $ prefix . ' ' . var_export ( $ key , true ) . ' => ' ; if ( is_array ( $ value ) ) { $ php .= self :: prettyPrint ( $ value , $ prefix . ' ' ) ; } else { $ php .= var_export ( $ value , true ) ; } $ php .= ',' . PHP_EOL ; } } else { foreach ( $ data as $ value ) { $ php .= $ prefix . ' ' ; if ( is_array ( $ value ) ) { $ php .= self :: prettyPrint ( $ value , $ prefix . ' ' ) ; } else { $ php .= var_export ( $ value , true ) ; } $ php .= ',' . PHP_EOL ; } } return $ php . $ prefix . ']' ; }
Create valid PHP array representation
44,756
public function renderPluginParams ( ) { $ tabNav = [ ] ; $ tabContent = [ ] ; $ entity = $ this -> _View -> get ( 'entity' ) ; $ params = Plugin :: getData ( $ entity -> getName ( ) , 'params' ) ; foreach ( $ params -> getArrayCopy ( ) as $ title => $ _params ) { $ fields = [ ] ; $ _params = new Data ( $ _params ) ; $ tabId = 'tab-' . Str :: slug ( $ title ) ; $ tabNav [ ] = $ this -> _View -> element ( 'Extensions.Params/tab' , [ 'title' => $ title , 'params' => $ _params , 'tabId' => $ tabId ] ) ; foreach ( $ _params as $ key => $ options ) { $ fieldName = Str :: clean ( 'params.' . $ key ) ; if ( is_callable ( $ options ) ) { $ fields [ ] = call_user_func ( $ options , $ this -> _View ) ; continue ; } if ( isset ( $ options [ 'options' ] ) && is_callable ( $ options [ 'options' ] ) ) { $ options [ 'options' ] = call_user_func ( $ options [ 'options' ] , $ this -> _View ) ; } $ fields [ ] = $ this -> _View -> Form -> control ( $ fieldName , $ options ) ; } $ tabContent [ $ tabId ] = implode ( PHP_EOL , $ fields ) ; } return implode ( PHP_EOL , [ $ this -> _View -> element ( 'Extensions.Params/list' , [ 'items' => $ tabNav ] ) , $ this -> _View -> element ( 'Extensions.Params/content' , [ 'content' => $ tabContent ] ) ] ) ; }
Render plugin params .
44,757
public function setEventDispatcher ( EventDispatcherInterface $ eventDispatcher ) { $ this -> eventDispatcher = $ eventDispatcher ; $ this -> twig -> setEventDispatcher ( $ eventDispatcher ) ; }
Set the event dispatcher instance .
44,758
public function addNamespace ( $ namespace , $ location ) { $ loader = $ this -> twig -> getLoader ( ) ; $ loader -> addPath ( $ location , $ namespace ) ; foreach ( $ loader -> getPaths ( ) as $ path ) { if ( is_dir ( $ dir = $ path . '/' . $ namespace ) ) { $ loader -> prependPath ( $ dir , $ namespace ) ; } } }
Register a template namespace .
44,759
protected function _setCallbackFilter ( $ filter ) { if ( ! is_callable ( $ filter , true ) && ! is_null ( $ filter ) ) { throw new InvalidArgumentException ( 'Filter must be a callable' ) ; } $ this -> callbackFilter = $ filter ; return $ this ; }
Assigns the filter that is optionally used to filter files .
44,760
protected function _getPaths ( ) { $ directories = $ this -> _createDirectoryIterator ( $ this -> _getRootDir ( ) ) ; $ flattened = $ this -> _createRecursiveIteratorIterator ( $ directories ) ; $ flattened -> setMaxDepth ( $ this -> _getMaxDepth ( ) ) ; $ filter = $ this -> _createFilterIterator ( $ flattened , function ( SplFileInfo $ current , $ key , Iterator $ iterator ) { return $ this -> _filterFile ( $ current ) ; } ) ; return $ filter ; }
Retrieves a list of file paths .
44,761
protected function _filterFile ( SplFileInfo $ fileInfo ) { if ( ! $ fileInfo -> isFile ( ) ) { return false ; } if ( ( $ expr = $ this -> _getFilenameRegex ( ) ) && ! preg_match ( $ expr , $ fileInfo -> getPathname ( ) ) ) { return false ; } if ( ( $ callback = $ this -> _getCallbackFilter ( ) ) && ! call_user_func_array ( $ callback , array ( $ fileInfo ) ) ) { return false ; } return true ; }
Determines whether or not a file is allowed to be found .
44,762
public function getOption ( $ name ) { if ( $ this -> hasOption ( $ name ) ) { $ option = $ this -> options [ $ name ] ; } else { $ option = null ; } return $ option ; }
Get option by name
44,763
protected function loadWhoopsErrorHandler ( ) { $ run = new \ Whoops \ Run ; $ run -> pushHandler ( new \ Whoops \ Handler \ PrettyPageHandler ) ; $ run -> register ( ) ; return $ run ; }
Setup the instance of Whoops .
44,764
public function addProperty ( $ property , $ content , $ position = 100 ) { $ attr = [ 'property' => $ property , 'content' => $ content ] ; $ this -> add ( $ attr , $ position ) ; return $ this ; }
add a property meta tag
44,765
public function image ( $ image , $ position = 100 ) { $ this -> add ( [ 'name' => 'image' , 'property' => 'og:image' , 'content' => $ image ] , $ position ) ; $ this -> addElement ( $ position , $ this -> void ( 'link' , [ 'rel' => 'image_src' , 'href' => $ image ] ) ) ; return $ this ; }
set opengraph and rel image
44,766
protected function _getValidationErrors ( $ subject ) { $ errors = array ( ) ; foreach ( $ this -> _getChildValidators ( ) as $ _idx => $ _validator ) { try { if ( ! ( $ _validator instanceof ValidatorInterface ) ) { throw $ this -> _createOutOfRangeException ( $ this -> __ ( 'Validator %1$s is invalid' , array ( $ _idx ) ) , null , null , $ _validator ) ; } $ _validator -> validate ( $ subject ) ; } catch ( ValidationFailedExceptionInterface $ e ) { $ errors [ ] = $ e -> getValidationErrors ( ) ; } } return $ this -> _normalizeErrorList ( $ errors ) ; }
Retrieve a list of reasons that make the subject invalid .
44,767
static public function secondToTime ( $ times ) { $ result = '00:00:00' ; if ( $ times > 0 ) { $ hour = floor ( $ times / 3600 ) ; $ minute = floor ( ( $ times - 3600 * $ hour ) / 60 ) ; $ second = floor ( ( ( $ times - 3600 * $ hour ) - 60 * $ minute ) % 60 ) ; $ result = str_pad ( $ hour , 2 , "0" , STR_PAD_LEFT ) . ':' . str_pad ( $ minute , 2 , "0" , STR_PAD_LEFT ) . ':' . str_pad ( $ second , 2 , "0" , STR_PAD_LEFT ) ; } return $ result ; }
second to time
44,768
public static function display ( array $ assocArgs , CheckerCollection $ checkerCollection ) : void { $ assocArgs [ 'fields' ] = $ assocArgs [ 'fields' ] ?? self :: DEFAULT_FIELDS ; $ formatter = new Formatter ( $ assocArgs , $ assocArgs [ 'fields' ] ) ; $ items = ( in_array ( $ formatter -> format , [ 'ids' , 'count' ] , true ) ) ? self :: pluckIds ( $ checkerCollection ) : self :: toArray ( $ checkerCollection ) ; $ formatter -> display_items ( $ items ) ; }
Display a checker collection in a given format .
44,769
private static function toArray ( CheckerCollection $ checkerCollection ) : array { return array_map ( function ( CheckerInterface $ checker ) : array { return [ 'id' => $ checker -> getId ( ) , 'description' => $ checker -> getDescription ( ) , 'link' => $ checker -> getLink ( ) , ] ; } , $ checkerCollection -> all ( ) ) ; }
Converts the underlying checkers into a plain PHP array .
44,770
private static function modelInstance ( array $ ctor = [ ] ) { static $ cached ; if ( ! isset ( $ cached ) ) { $ class = new ReflectionClass ( get_called_class ( ) ) ; $ cached = $ class -> newInstanceArgs ( $ ctor ) ; } return $ cached ; }
Internal helper to retrieve a cached anonymous instance of the actual model to work on . Needed to ensure dependencies are properly injected etc .
44,771
public function handle ( ) { if ( env ( 'APP_ENV' ) == 'testing' ) { return ; } $ this -> origins ( ) ; $ this -> credentials ( ) ; $ this -> methods ( ) ; $ this -> headers ( ) ; }
Handle a cors request .
44,772
private function origins ( ) { if ( array_has ( $ _SERVER , 'HTTP_ORIGIN' ) ) { foreach ( config ( 'cors.origins' ) as $ origin ) { if ( $ _SERVER [ 'HTTP_ORIGIN' ] == $ origin ) { header ( 'Access-Control-Allow-Origin: ' . $ _SERVER [ 'HTTP_ORIGIN' ] ) ; break ; } } if ( config ( 'cors.origins' ) == [ '*' ] ) { header ( 'Access-Control-Allow-Origin: ' . $ _SERVER [ 'HTTP_ORIGIN' ] ) ; } } if ( ! array_has ( $ _SERVER , 'HTTP_ORIGIN' ) && env ( 'APP_ENV' ) != 'local' && config ( 'cors.local' ) != 'true' && config ( 'cors.internal' ) == false ) { abort ( 403 ) ; } }
Set access control origins .
44,773
private function methods ( ) { $ methods = '' ; foreach ( config ( 'cors.methods' ) as $ method ) { $ methods = $ methods . $ method . ', ' ; } header ( 'Access-Control-Allow-Methods: ' . $ methods ) ; }
set access control methods
44,774
private function headers ( ) { $ headers = '' ; foreach ( config ( 'cors.headers' ) as $ header ) { $ headers = $ headers . $ header . ', ' ; } header ( 'Access-Control-Allow-Headers: ' . $ headers ) ; }
Set access control headers .
44,775
public static function decorate ( StreamInterface $ stream , array $ methods ) { foreach ( array_diff ( static :: SLOTS , array_keys ( $ methods ) ) as $ diff ) { $ methods [ $ diff ] = [ $ stream , $ diff ] ; } return new self ( $ methods ) ; }
Adds custom functionality to an underlying stream by intercepting specific method calls .
44,776
protected function configure ( IConfig $ config ) { $ configuration = $ config -> get ( 'routes' ) ; foreach ( $ configuration as $ route ) { $ this -> map ( $ route ) ; } }
Create routes from config .
44,777
public static function flattenAssoc ( array $ kvArray , $ kField , $ vField ) { $ array = [ ] ; if ( ! empty ( $ kvArray ) && self :: isAssoc ( $ kvArray ) ) { foreach ( $ kvArray as $ k => $ v ) { $ row = [ ] ; if ( is_string ( $ vField ) ) { $ row [ $ vField ] = $ v ; } else if ( true === $ vField && self :: isAssoc ( $ v ) ) { $ row = array_merge ( $ row , $ v ) ; } $ row [ $ kField ] = $ k ; $ array [ ] = $ row ; } } return $ array ; }
Returns a flattened array for the specified associative array . Keys and values are hosted in a new array and then inserted as regular rows to be returned as the result .
44,778
public function elapsed ( ) { if ( isset ( $ this -> timeBegin ) && isset ( $ this -> timeEnd ) ) { return number_format ( $ this -> timeEnd - $ this -> timeBegin , 5 ) ; } else { if ( ! isset ( $ this -> timeBegin ) ) { echo "It is necesary execute the method 'start' first" ; } else { echo "It is necesary execute the method 'terminate' before" ; } } }
Calcula el tiempo consumido entre el inicio y fin del calculo
44,779
public function setAkas ( array $ akas ) { $ this -> akas = [ ] ; foreach ( $ akas as $ aka ) { $ this -> addAka ( $ aka ) ; } return $ this ; }
Set A . K . A s
44,780
public function augment ( $ data ) { $ this [ self :: KEY_AUGMENTED ] = [ ] ; $ rulekeys = array_filter ( $ this -> keys ( ) , function ( $ key ) { return strpos ( $ key , self :: PREFIX_RULE ) === 0 ; } ) ; foreach ( $ rulekeys as $ rulename ) { $ augmentation_step = $ this [ $ rulename ] ( $ this , $ data ) ; if ( ! is_array ( $ augmentation_step ) ) { throw new \ RuntimeException ( "augmentaion rule '$rulename' did not produce data. Make sure to return the array of augmented data." ) ; } $ this [ self :: KEY_AUGMENTED ] = array_merge ( $ this [ self :: KEY_AUGMENTED ] , $ augmentation_step ) ; } $ this -> checkAugmented ( ) ; if ( $ this -> hasColumnOrderSpecification ( ) ) { $ result = [ ] ; foreach ( $ this [ self :: KEY_COLOUMN_ORDER ] as $ key ) { $ result [ $ key ] = $ this [ self :: KEY_AUGMENTED ] [ $ key ] ; } return $ result ; } else { return $ this [ self :: KEY_AUGMENTED ] ; } }
Augment data according to the rules and return the result .
44,781
public function getAugmentedSoFar ( ) { if ( ! $ this -> offsetExists ( self :: KEY_AUGMENTED ) ) { $ this [ self :: KEY_AUGMENTED ] = [ ] ; } return $ this [ self :: KEY_AUGMENTED ] ; }
Access the data that has been augmented so far in the previous augmentation steps .
44,782
public function addRule ( $ name , callable $ rule ) { if ( isset ( $ this [ self :: rule ( $ name ) ] ) ) { throw new \ RuntimeException ( "rule '$name' already exists'" ) ; } $ this [ self :: rule ( $ name ) ] = $ this -> protect ( $ rule ) ; }
Add an augmentation rule .
44,783
public function appendTo ( $ key , $ value ) { if ( ! $ this -> offsetExists ( $ key ) ) { $ this [ $ key ] = [ $ value ] ; return ; } $ old_value = $ this [ $ key ] ; if ( ! is_array ( $ old_value ) ) { $ old_value = [ $ old_value ] ; } if ( is_array ( $ value ) ) { $ old_value = array_merge ( $ old_value , $ value ) ; } else { $ old_value [ ] = $ value ; } $ this [ $ key ] = $ old_value ; }
Append to an already stored array .
44,784
protected function applyError ( CacheItem $ cacheItem , $ status , $ message , $ inputFilename , $ templateType , $ templateKey , $ logSeverity = 'error' ) { $ cacheItem -> setCacheStatus ( $ status ) -> setError ( $ message ) ; $ logger = $ this -> getLogger ( ) ; if ( $ logger && method_exists ( $ logger , $ logSeverity ) ) { $ logger -> $ logSeverity ( $ message , array ( 'worker' => get_class ( $ this ) , 'templateType' => $ templateType , 'templateKey' => $ templateKey , 'fileId' => $ cacheItem -> getFileId ( ) , 'fileVersion' => $ cacheItem -> getFileVersion ( ) , 'fileMimeType' => $ cacheItem -> getMimeType ( ) , 'fileMediaType' => $ cacheItem -> getMediaType ( ) , 'inputFile' => $ inputFilename , ) ) ; } }
Apply error to cache item .
44,785
public function toString ( ) { return implode ( ', ' , array_filter ( [ $ this -> name , $ this -> street1 , $ this -> street2 , $ this -> city , $ this -> county , $ this -> postcode , $ this -> country ( $ this -> country ) -> name , ] ) ) ; }
Return address as a comma - separated string .
44,786
public function name ( $ value = false , $ overwrite = false ) { if ( $ value === false ) { return $ this -> adapter -> basename ( $ this -> path ) ; } if ( ! is_string ( $ value ) || strlen ( $ value ) == 0 ) { throw new FilesystemException ( 'Invalid name given to name() method' ) ; } $ newPath = substr ( $ this -> path , 0 , strrpos ( $ this -> path , DIRECTORY_SEPARATOR ) + 1 ) ; $ newPath .= $ value ; return $ this -> path ( $ newPath , $ overwrite ) ; }
Gets or sets the name of the file .
44,787
public function path ( $ value = false , $ overwrite = false ) { if ( $ value === false ) { return $ this -> path ; } $ oldPath = $ this -> path ; if ( ! $ overwrite && $ this -> adapter -> fileExists ( $ value ) ) { throw new FilesystemException ( "Cannot rename the file '{$this->path}' to '{$value}' because a file already exists" ) ; } ( new static ( $ value , $ this -> adapter ) ) -> remove ( ) ; if ( ! $ this -> adapter -> rename ( $ this -> path , $ value ) ) { throw new FilesystemException ( "Cannot rename the file '{$this->path}' to '{$value}'" ) ; } $ this -> path = $ value ; $ this -> fs = null ; $ this -> pathChanged ( $ oldPath ) ; return $ this ; }
Gets or Sets the path .
44,788
protected function pathChanged ( $ oldPath ) { foreach ( $ this -> pathListeners as $ cb ) { $ cb ( $ oldPath , $ this -> path ) ; } }
Notifies the path listeners and passes the old and the new path as parameters to each callback .
44,789
public function perms ( $ value = false ) { if ( $ value === false ) { return substr ( sprintf ( '%o' , $ this -> adapter -> fileperms ( $ this -> path ) ) , - 4 ) ; } if ( ! $ this -> adapter -> chmod ( $ this -> path , $ value ) ) { throw new FilesystemException ( "Unable to apply permissions to '{$this->path}'" ) ; } $ this -> clearStat ( ) ; return $ this ; }
Gets or Sets the file permissions .
44,790
public function fs ( ) { if ( null === $ this -> fs ) $ this -> fs = new Filesystem ( $ this -> getFilesystemPath ( ) , $ this -> adapter ) ; return $ this -> fs ; }
Gets the filesystem coresponding to the file .
44,791
public function validateAndParseWebhookNotificationFromCurrentRequest ( ) { $ json_string = file_get_contents ( 'php://input' ) ; $ json_data = json_decode ( $ json_string , true ) ; $ this -> validateWebhookNotification ( $ json_data ) ; return $ this -> parseWebhookNotificationData ( $ json_data ) ; }
Reads the input from the current web request and returns the notification Throws an AuthorizationException if validation fails
44,792
public function validateAndParseWebhookNotificationFromRequest ( \ Symfony \ Component \ HttpFoundation \ Request $ request ) { $ json_data = json_decode ( $ request -> getContent ( ) , true ) ; if ( ! is_array ( $ json_data ) ) { throw new AuthorizationException ( "Invalid webhook data received" ) ; } $ this -> validateWebhookNotification ( $ json_data ) ; return $ this -> parseWebhookNotificationData ( $ json_data ) ; }
Reads the input from a Symfony request and returns the notification Throws an AuthorizationException if validation fails
44,793
public function validateWebhookNotification ( $ json_data ) { if ( ! strlen ( $ json_data [ 'apiToken' ] ) ) { throw new AuthorizationException ( "API token not found" ) ; } if ( $ json_data [ 'apiToken' ] != $ this -> api_token ) { throw new AuthorizationException ( "Invalid API token" ) ; } if ( ! strlen ( $ json_data [ 'signature' ] ) ) { throw new AuthorizationException ( "signature not found" ) ; } $ notification_json_string = $ json_data [ 'payload' ] ; if ( ! strlen ( $ notification_json_string ) ) { throw new AuthorizationException ( "payload not found" ) ; } $ expected_signature = hash_hmac ( 'sha256' , $ notification_json_string , $ this -> api_scret_key , false ) ; $ is_valid = ( $ expected_signature === $ json_data [ 'signature' ] ) ; if ( ! $ is_valid ) { throw new AuthorizationException ( "Invalid signature" ) ; } return $ is_valid ; }
Parses and validates a notification Throws an AuthorizationException if validation fails
44,794
protected function parseCompositeValue ( $ compositeValue ) { $ time = false ; try { $ time = new RhubarbTime ( $ compositeValue ) ; } catch ( \ Exception $ er ) { } if ( $ time === false ) { $ this -> model -> hours = "" ; $ this -> model -> minutes = "" ; } else { $ this -> model -> hours = $ time -> format ( "H" ) ; $ this -> model -> minutes = $ time -> format ( "i" ) ; } }
The place to parse the value property and break into the sub values for sub controls to bind to
44,795
protected function createCompositeValue ( ) { $ hours = ( int ) $ this -> model -> hours ; $ minutes = ( int ) $ this -> model -> minutes ; $ time = new RhubarbTime ( ) ; $ time -> setTime ( $ hours , $ minutes ) ; return $ time ; }
The place to combine the model properties for sub values into a single value array or object .
44,796
public function asset ( $ asset , $ version = null ) { $ host = $ this -> request -> getHost ( ) ; $ port = $ this -> request -> getPort ( ) ; $ path = $ this -> request -> getBasePath ( ) ; if ( '/' !== substr ( $ asset , 1 ) ) { $ asset = '/' . $ asset ; } if ( 80 === $ port ) { $ port = '' ; } else { $ port = ':' . $ port ; } return '//' . $ host . $ port . $ path . $ asset ; }
Get the absolute URL of an asset .
44,797
public function set ( $ key , $ value ) { setvalr ( trim ( $ key ) , $ this -> data , $ value ) ; return $ value ; }
Set a store value
44,798
public function push ( $ key , $ data ) { $ key = trim ( $ key ) ; if ( ! array_key_exists ( $ key , $ this -> data ) || ! is_array ( $ this -> data [ $ key ] ) ) { $ this -> data [ $ key ] = [ ] ; } array_push ( $ this -> data [ $ key ] , $ data ) ; }
Push data onto key
44,799
public function addArgument ( $ argument , $ description = null , $ options = array ( ) , \ Closure $ code = null ) { return $ this -> addCommand ( $ argument , $ description , $ options , $ code ) ; }
Alias of addCommand for legacy .