idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
7,800
protected function getProperties ( ) { return array ( "chat" => $ this -> chatProperties , "chat_avatar" => $ this -> chatAvatarProperties , "map_info" => $ this -> mapInfoProperties , "countdown" => $ this -> countdownProperties , "go" => $ this -> goProperties , "endmap_ladder_recap" => $ this -> endMapLadderRecapPro...
Get associative array of all properties
7,801
protected function setPositionProperty ( array & $ properties , $ positionX , $ positionY , $ positionZ = null ) { $ position = array ( ( float ) $ positionX , ( float ) $ positionY ) ; if ( $ positionZ ) { array_push ( $ position , ( float ) $ positionZ ) ; } $ this -> setProperty ( $ properties , "pos" , implode ( " ...
Set the Position property value
7,802
public function createScope ( $ closure ) { $ newScope = ( new static ( $ this -> request , $ this -> result , $ this -> urlGenerator ) ) ; $ newScope -> setupParent ( $ this -> prefix , $ this -> prefixMatched , $ this -> requestPathOffset , $ this -> params ) ; $ newScope -> use ( $ this -> middlewares ) ; $ newScope...
Create a child scope .
7,803
public function prefix ( $ prefix ) { $ this -> prefix = $ this -> parentPrefix ; $ this -> requestPathOffset = $ this -> parentRequestPathOffset ; if ( $ this -> parentPrefixMatched ) { $ this -> prefixMatched = $ this -> parentPrefixMatched ; } if ( ! $ this -> result -> hasHandler ( ) && $ this -> prefixMatched ) { ...
Set a common path prefix for all routes .
7,804
public function use ( $ middlewares ) { $ middlewares = ( array ) $ middlewares ; if ( $ this -> namespace ) { foreach ( $ middlewares as & $ middleware ) { $ middleware = $ this -> namespace . $ middleware ; } } $ this -> middlewares = array_merge ( $ this -> middlewares , ( array ) $ middlewares ) ; return $ this ; }
Add middlewares .
7,805
public function on ( $ method , $ path , $ handler , $ name = '' ) { if ( ! $ this -> result -> hasHandler ( ) && $ this -> prefixMatched && $ this -> request -> isMethod ( $ method ) ) { if ( $ this -> matchPartial ( $ path , true ) ) { $ handlers = ( array ) $ handler ; if ( $ this -> namespace ) { foreach ( $ handle...
Add a route .
7,806
public function setupParent ( $ prefix , $ prefixMatched , $ requestPathOffset , $ params ) { $ this -> prefix = $ prefix ; $ this -> parentPrefix = $ prefix ; $ this -> prefixMatched = $ prefixMatched ; $ this -> parentPrefixMatched = $ prefixMatched ; $ this -> requestPathOffset = $ requestPathOffset ; $ this -> pare...
Inherit data from parent scope .
7,807
protected function matchPartial ( $ routePathPartial , $ toEnd = false ) { $ result = false ; $ numOfRouteMatches = preg_match_all ( self :: ROUTE_PARAM_PATTERN , $ routePathPartial , $ routeMatches , PREG_OFFSET_CAPTURE ) ; if ( $ numOfRouteMatches === 0 ) { if ( $ toEnd ) { $ requestPathPartial = substr ( $ this -> r...
Match path partial with request path . This will move the request path offset .
7,808
public function getHtml ( $ name = null ) { $ host = self :: API_SERVER ; $ langOption = '' ; if ( isset ( $ this -> options [ 'lang' ] ) && ! empty ( $ this -> options [ 'lang' ] ) ) { $ langOption = "?hl={$this->options['lang']}" ; } $ return = <<<HTML<script type="text/javascript" src="{$host}{$langOption}" async d...
Get the HTML code for the captcha
7,809
protected function query ( $ responseField ) { $ params = new Parameters ( $ this -> secretKey , $ responseField , $ this -> ip ) ; return $ this -> request -> send ( $ params ) ; }
Gets a solution to the verify server
7,810
public function actionProfile ( ) { $ model = UserProfile :: findOne ( [ 'user_id' => Yii :: $ app -> user -> identity -> getId ( ) ] ) ; if ( Yii :: $ app -> request -> isAjax && $ model -> load ( Yii :: $ app -> request -> post ( ) ) ) { Yii :: $ app -> response -> format = Response :: FORMAT_JSON ; return ActiveForm...
Shows profile settings form .
7,811
public function actionAvatar ( ) { $ model = new AvatarForm ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { Yii :: $ app -> getSession ( ) -> setFlash ( 'success' , Yii :: t ( 'yuncms' , 'Your avatar has been updated' ) ) ; } return $ this -> render ( 'avatar' , [ 'model' =...
Show portrait setting form
7,812
private function getAssociatedClass ( $ errno ) { $ associations = [ E_WARNING => Exception \ WarningException :: class , E_NOTICE => Exception \ NoticeException :: class , E_USER_ERROR => Exception \ UserErrorException :: class , E_USER_WARNING => Exception \ UserWarningException :: class , E_USER_NOTICE => Exception ...
Getting the exception class name associated with error code .
7,813
public function initCustomers ( $ overrideExisting = true ) { if ( null !== $ this -> collCustomers && ! $ overrideExisting ) { return ; } $ this -> collCustomers = new PropelObjectCollection ( ) ; $ this -> collCustomers -> setModel ( 'Customer' ) ; }
Initializes the collCustomers collection .
7,814
public function getCustomers ( $ criteria = null , PropelPDO $ con = null ) { $ partial = $ this -> collCustomersPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collCustomers || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && null === $ this -> collCustomers ) { $ this -> initCustomers ( ) ;...
Gets an array of Customer objects which contain a foreign key that references this object .
7,815
public function countCustomers ( Criteria $ criteria = null , $ distinct = false , PropelPDO $ con = null ) { $ partial = $ this -> collCustomersPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collCustomers || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && null === $ this -> collCustomers )...
Returns the number of related Customer objects .
7,816
public function addCustomer ( Customer $ l ) { if ( $ this -> collCustomers === null ) { $ this -> initCustomers ( ) ; $ this -> collCustomersPartial = true ; } if ( ! in_array ( $ l , $ this -> collCustomers -> getArrayCopy ( ) , true ) ) { $ this -> doAddCustomer ( $ l ) ; if ( $ this -> customersScheduledForDeletion...
Method called to associate a Customer object to this object through the Customer foreign key attribute .
7,817
public function down ( Table $ table , $ id , $ step = 1 ) { return $ this -> _move ( $ table , $ id , $ step , self :: TYPE_DOWN ) ; }
Move down record in tree .
7,818
public function up ( Table $ table , $ id , $ step = 1 ) { return $ this -> _move ( $ table , $ id , $ step ) ; }
Move up record in tree .
7,819
protected function _move ( Table $ table , $ id , $ step = 1 , $ type = self :: TYPE_UP ) { $ behaviors = $ table -> behaviors ( ) ; if ( ! Arr :: in ( 'Tree' , $ behaviors -> loaded ( ) ) ) { $ behaviors -> load ( 'Tree' ) ; } $ entity = $ table -> get ( $ id ) ; $ treeBehavior = $ behaviors -> get ( 'Tree' ) ; $ tree...
Move object in tree table .
7,820
protected function _redirect ( ) { $ request = $ this -> _controller -> request ; return $ this -> _controller -> redirect ( [ 'prefix' => $ request -> getParam ( 'prefix' ) , 'plugin' => $ request -> getParam ( 'plugin' ) , 'controller' => $ request -> getParam ( 'controller' ) , 'action' => $ this -> getConfig ( 'act...
Process redirect .
7,821
function & getDebugAsXMLComment ( ) { while ( strpos ( $ this -> debug_str , '--' ) ) { $ this -> debug_str = str_replace ( '--' , '- -' , $ this -> debug_str ) ; } $ ret = "<!--\n" . $ this -> debug_str . "\n ; return $ ret ; }
gets the current debug data for this instance as an XML comment this may change the contents of the debug data
7,822
function serializeTypeDef ( $ type ) { if ( $ typeDef = $ this -> getTypeDef ( $ type ) ) { $ str .= '<' . $ type ; if ( is_array ( $ typeDef [ 'attrs' ] ) ) { foreach ( $ typeDef [ 'attrs' ] as $ attName => $ data ) { $ str .= " $attName=\"{type = " . $ data [ 'type' ] . "}\"" ; } } $ str .= " xmlns=\"" . $ this -> sc...
returns a sample serialization of a given type or false if no type by the given name
7,823
function typeToForm ( $ name , $ type ) { if ( $ typeDef = $ this -> getTypeDef ( $ type ) ) { if ( $ typeDef [ 'phpType' ] == 'struct' ) { $ buffer .= '<table>' ; foreach ( $ typeDef [ 'elements' ] as $ child => $ childDef ) { $ buffer .= " <tr><td align='right'>$childDef[name] (type: " . $ this -> getLocalPart ( ...
returns HTML form elements that allow a user to enter values for creating an instance of the given type .
7,824
function addComplexType ( $ name , $ typeClass = 'complexType' , $ phpType = 'array' , $ compositor = '' , $ restrictionBase = '' , $ elements = [ ] , $ attrs = [ ] , $ arrayType = '' ) { $ this -> complexTypes [ $ name ] = [ 'name' => $ name , 'typeClass' => $ typeClass , 'phpType' => $ phpType , 'compositor' => $ com...
adds a complex type to the schema
7,825
function setURL ( $ url ) { $ this -> url = $ url ; $ u = parse_url ( $ url ) ; foreach ( $ u as $ k => $ v ) { $ this -> debug ( "parsed URL $k = $v" ) ; $ this -> $ k = $ v ; } if ( isset ( $ u [ 'query' ] ) && $ u [ 'query' ] != '' ) { $ this -> path .= '?' . $ u [ 'query' ] ; } if ( ! isset ( $ u [ 'port' ] ) ) { i...
sets the URL to which to connect
7,826
function setEncoding ( $ enc = 'gzip, deflate' ) { if ( function_exists ( 'gzdeflate' ) ) { $ this -> protocol_version = '1.1' ; $ this -> setHeader ( 'Accept-Encoding' , $ enc ) ; if ( ! isset ( $ this -> outgoing_headers [ 'Connection' ] ) ) { $ this -> setHeader ( 'Connection' , 'close' ) ; $ this -> persistentConne...
use http encoding
7,827
function register ( $ name , $ in = [ ] , $ out = [ ] , $ namespace = FALSE , $ soapaction = FALSE , $ style = FALSE , $ use = FALSE , $ documentation = '' , $ encodingStyle = '' ) { global $ HTTP_SERVER_VARS ; if ( $ this -> externalWSDLURL ) { die ( 'You cannot bind to an external WSDL file, and register methods outs...
register a service function with the server
7,828
function getOperations ( $ portName = '' , $ bindingType = 'soap' ) { $ ops = [ ] ; if ( $ bindingType == 'soap' ) { $ bindingType = 'http://schemas.xmlsoap.org/wsdl/soap/' ; } elseif ( $ bindingType == 'soap12' ) { $ bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/' ; } else { $ this -> debug ( "getOperations bi...
returns an assoc array of operation names = > operation data
7,829
function parseResponse ( $ headers , $ data ) { $ this -> debug ( 'Entering parseResponse() for data of length ' . strlen ( $ data ) . ' headers:' ) ; $ this -> appendDebug ( $ this -> varDump ( $ headers ) ) ; if ( ! isset ( $ headers [ 'content-type' ] ) ) { $ this -> setError ( 'Response not of type text/xml (no con...
processes SOAP message returned from server
7,830
function getProxy ( ) { $ r = rand ( ) ; $ evalStr = $ this -> _getProxyClassCode ( $ r ) ; if ( $ this -> getError ( ) ) { $ this -> debug ( "Error from _getProxyClassCode, so return null" ) ; return NULL ; } eval ( $ evalStr ) ; eval ( "\$proxy = new nusoap_proxy_$r('');" ) ; $ proxy -> endpointType = 'wsdl' ; $ prox...
dynamically creates an instance of a proxy class allowing user to directly call methods from wsdl
7,831
function _getProxyClassCode ( $ r ) { $ this -> debug ( "in getProxy endpointType=$this->endpointType" ) ; $ this -> appendDebug ( "wsdl=" . $ this -> varDump ( $ this -> wsdl ) ) ; if ( $ this -> endpointType != 'wsdl' ) { $ evalStr = 'A proxy can only be created for a WSDL client' ; $ this -> setError ( $ evalStr ) ;...
dynamically creates proxy class code
7,832
public function validateSet ( ) { $ this -> validatedComponents = array ( ) ; $ exceptions = array ( ) ; foreach ( $ this -> components as $ component ) { try { $ this -> validateComponent ( $ component ) ; } catch ( ValidatorException $ e ) { if ( $ this -> exceptionList ) { $ exceptions [ ] = $ e ; } else { throw $ e...
Validiert alle Daten anhand der Meta - Daten von den FormDaten
7,833
protected function getContentType ( $ method ) { $ method = null ; $ file = $ this -> getArgument ( "file" ) ; if ( ! is_null ( $ file ) ) { return "text/csv" ; } $ soundFile = $ this -> getArgument ( "sound_file" ) ; if ( ! is_null ( $ soundFile ) ) { return "audio/mpeg" ; } return 'application/json' ; }
Returns the content type for this endpoint .
7,834
protected function getAcceptContentType ( $ method ) { $ method = null ; $ acceptFile = $ this -> getArgument ( "accept_file" ) ; if ( ! is_null ( $ acceptFile ) ) { return "text/csv" ; } $ acceptAnyFile = $ this -> getArgument ( "accept_any_file" ) ; if ( ! is_null ( $ acceptAnyFile ) ) { return "*/*" ; } $ acceptSoun...
Returns the accepted content type for this endpoint .
7,835
protected function run ( $ method ) { $ endpoint = $ this -> getEndpoint ( $ method ) ; $ outputFile = $ this -> getArgument ( 'accept_file' ) ; if ( is_null ( $ outputFile ) ) { $ outputFile = $ this -> getArgument ( 'accept_any_file' ) ; } if ( is_null ( $ outputFile ) ) { $ outputFile = $ this -> getArgument ( 'acce...
Runs this command with the given method and returns the result .
7,836
public function getOriginalFile ( $ source_file ) { $ original_file = $ this -> options [ 'path_local' ] . '/' . $ source_file ; if ( ! is_file ( $ original_file ) ) { throw new Exceptions \ NotFoundException ( 'File not found' ) ; } return $ original_file ; }
The path to the original file
7,837
public function handleRequest ( $ preset_key , $ file ) { $ preset = $ this -> getPresetActions ( $ preset_key , $ file ) ; $ source_file = $ this -> getOriginalFilename ( $ file ) ; $ original_file = $ this -> getOriginalFile ( $ source_file ) ; $ final_file = $ this -> localUrl ( $ preset_key , $ file ) ; $ this -> v...
Take a preset and a file and return a transformed image
7,838
protected function verifyDirectoryExistence ( $ base , $ cacheDir ) { if ( is_dir ( "$base/$cacheDir" ) ) { return ; } $ folder_path = explode ( '/' , $ cacheDir ) ; foreach ( $ folder_path as $ element ) { $ base .= '/' . $ element ; if ( ! is_dir ( $ base ) ) { mkdir ( $ base , 0755 , true ) ; chmod ( $ base , 0755 )...
Create the folder containing the cached images if it doesn t exist
7,839
protected function buildImage ( $ actions , Image $ image , $ dst ) { foreach ( $ actions as $ action ) { if ( isset ( $ action [ 'width' ] ) ) { $ action [ 'width' ] = $ this -> percent ( $ action [ 'width' ] , $ image -> getWidth ( ) ) ; } if ( isset ( $ action [ 'height' ] ) ) { $ action [ 'height' ] = $ this -> per...
Create a new image based on an image preset .
7,840
public function percent ( $ value , $ current_pixels ) { if ( strpos ( $ value , '%' ) !== false ) { $ value = str_replace ( '%' , '' , $ value ) * 0.01 * $ current_pixels ; } return $ value ; }
Accept a percentage and return it in pixels .
7,841
public function process ( $ name , array $ ids = [ ] ) { $ allowActions = $ this -> getConfig ( 'actions' ) ; if ( ! Arr :: key ( $ name , $ allowActions ) ) { throw new \ InvalidArgumentException ( __d ( 'core' , 'Invalid action to perform' ) ) ; } $ action = $ allowActions [ $ name ] ; if ( $ action === false ) { thr...
Process table method .
7,842
public function processDelete ( array $ ids ) { return $ this -> _table -> deleteAll ( [ $ this -> _table -> getPrimaryKey ( ) . ' IN (' . implode ( ',' , $ ids ) . ')' ] ) ; }
Process delete method .
7,843
protected function _toggleField ( array $ ids , $ value = STATUS_UN_PUBLISH ) { return $ this -> _table -> updateAll ( [ $ this -> _configRead ( 'field' ) => $ value , ] , [ $ this -> _table -> getPrimaryKey ( ) . ' IN (' . implode ( ',' , $ ids ) . ')' ] ) ; }
Toggle table field .
7,844
public function setId ( $ id = null ) { $ this -> id = ( $ id !== null ) ? $ id : SecureKey :: generate ( ) ; return $ this ; }
Set token ID
7,845
public function setSessionId ( $ session_id = null ) { $ this -> session_id = ( $ session_id !== null ) ? $ session_id : null ; return $ this ; }
Set the session id that this token is associated to ..
7,846
protected function getExistingIdentity ( UserResponseInterface $ response ) { $ repo = $ this -> om -> getRepository ( $ this -> userIdentityClass ) ; return $ repo -> findOneBy ( array ( 'identifier' => $ response -> getUsername ( ) , 'type' => $ response -> getResourceOwner ( ) -> getName ( ) , ) ) ; }
Checks whether the authenticating Identity already exists
7,847
protected function createUser ( UserResponseInterface $ response ) { $ user = $ this -> userManager -> createUser ( ) ; $ user -> setUsername ( $ this -> createUniqueUsername ( $ this -> getRealName ( $ response ) ) ) ; $ user -> setEmail ( $ this -> getEmail ( $ response ) ) ; $ user -> setPassword ( '' ) ; $ user -> ...
Creates new User
7,848
protected function createIdentity ( User $ user , UserResponseInterface $ response ) { $ identity = new $ this -> userIdentityClass ; $ identity -> setAccessToken ( $ this -> getAccessToken ( $ response ) ) ; $ identity -> setIdentifier ( $ response -> getUsername ( ) ) ; $ identity -> setType ( $ response -> getResour...
Creates new Identity
7,849
protected function createUniqueUsername ( $ username ) { $ originalName = $ username ; $ existingUser = $ this -> userManager -> findUserByUsername ( $ username ) ; $ suffix = 0 ; while ( $ existingUser ) { $ suffix ++ ; $ username = $ originalName . $ suffix ; $ existingUser = $ this -> userManager -> findUserByUserna...
Ensures uniqueness of username
7,850
public function setCacheHeaders ( ) { $ cacheTime = 31536000 ; $ this -> getHeaders ( ) -> set ( 'Expires' , gmdate ( 'D, d M Y H:i:s' , time ( ) + $ cacheTime ) . ' GMT' ) -> set ( 'Pragma' , 'cache' ) -> set ( 'Cache-Control' , 'max-age=' . $ cacheTime ) ; return $ this ; }
Sets headers that will instruct the client to cache this response .
7,851
public function setLastModifiedHeader ( string $ path ) { $ modifiedTime = filemtime ( $ path ) ; if ( $ modifiedTime ) { $ this -> getHeaders ( ) -> set ( 'Last-Modified' , gmdate ( 'D, d M Y H:i:s' , $ modifiedTime ) . ' GMT' ) ; } return $ this ; }
Sets a Last - Modified header based on a given file path .
7,852
public function sendFile ( $ file ) { if ( $ this -> sent ) { return $ this ; } $ this -> setMode ( self :: MODE_FILE ) ; $ this -> send ( $ file ) ; return $ this ; }
Send a file .
7,853
public function redirect ( $ url , $ statusCode = 302 ) { $ this -> setStatusCode ( $ statusCode ) -> setHeader ( 'Location' , $ url ) -> setBody ( sprintf ( '<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="refresh" content="1;url=%1$s"><title>Redirecting to %1$s</title>Redirecting to <a href="%1$s">%1$s</a>' , ...
Setup HTTP redirect .
7,854
public function redirectRoute ( $ name , $ params = [ ] , $ statusCode = 302 ) { $ this -> redirect ( $ this -> urlGenerator -> generate ( $ name , $ params ) , $ statusCode ) ; return $ this ; }
HTTP redirect to a named route .
7,855
public static function closeOutputBuffers ( $ targetLevel , $ flush ) { $ status = ob_get_status ( true ) ; $ level = count ( $ status ) ; while ( $ level -- > $ targetLevel && ( ! empty ( $ status [ $ level ] [ 'del' ] ) || ( isset ( $ status [ $ level ] [ 'flags' ] ) && ( $ status [ $ level ] [ 'flags' ] & PHP_OUTPUT...
Cleans or flushes output buffers up to target level .
7,856
public function log ( $ text , $ severity = 'info' ) { if ( $ severity === 'warn' || $ severity === 'warning' ) { return Log :: warning ( $ text ) ; } if ( $ severity === 'err' || $ severity === 'error' ) { return Log :: error ( $ text ) ; } return Log :: info ( $ text ) ; }
Write to application log
7,857
public function getAnonymizeed ( ) { $ userinfo = $ this -> toObject ( ) ; $ userinfo -> password_clear = '******' ; if ( isset ( $ userinfo -> password ) ) { $ userinfo -> password = substr ( $ userinfo -> password , 0 , 6 ) . '********' ; } if ( isset ( $ userinfo -> password_salt ) ) { $ userinfo -> password_salt = ...
hides sensitive information
7,858
private function render ( ) { $ strings = implode ( $ this -> strings ) ; foreach ( $ this -> incTemplates as $ path => $ include ) { $ incOutput = $ include -> render ( ) ; $ path = preg_replace ( "/\//" , "\/" , $ path ) ; $ strings = preg_replace ( "/\{include\s$path\}/" , $ incOutput , $ strings ) ; } foreach ( $ t...
The render function goes through and renders the parsed document .
7,859
private function set ( $ var , $ val ) { $ this -> vars [ $ var ] = $ val ; foreach ( $ this -> forTemplates as $ templateBunch ) foreach ( $ templateBunch as $ sub ) $ sub -> set ( $ var , $ val ) ; foreach ( $ this -> ifTemplates as $ templateBunch ) foreach ( $ templateBunch as $ sub ) $ sub -> set ( $ var , $ val )...
Sets the value of a variable .
7,860
private function parseRecursive ( $ start , $ regex , $ subName = 'template' ) { $ re_beg = $ regex [ 0 ] ; $ re_end = $ regex [ 1 ] ; $ numLines = count ( $ this -> strings ) ; $ i = $ start ; $ n = 0 ; $ line = 0 ; for ( $ i ; $ i < $ numLines ; $ i ++ ) { $ match = preg_match ( $ re_beg , $ this -> strings [ $ i ] )...
This function is used by the parse function to grab the contents of scurvy block statements .
7,861
public function setPassword ( $ password ) { if ( is_array ( $ password ) ) { if ( $ password [ 'password' ] == NULL ) return $ this ; $ this -> hashPassword ( $ password [ 'password' ] ) ; } else { if ( $ password == NULL ) return $ this ; $ this -> password = $ password ; } return $ this ; }
Das setzt das gehashte Passwort und sollte nur intern benutzt werden
7,862
public function indexAction ( Request $ request ) { $ exportManager = $ this -> get ( 'chill.main.export_manager' ) ; $ exports = $ exportManager -> getExports ( true ) ; return $ this -> render ( 'ChillMainBundle:Export:layout.html.twig' , array ( 'exports' => $ exports ) ) ; }
Render the list of available exports
7,863
public function newAction ( Request $ request , $ alias ) { $ exportManager = $ this -> get ( 'chill.main.export_manager' ) ; $ export = $ exportManager -> getExport ( $ alias ) ; if ( $ exportManager -> isGrantedForElement ( $ export ) === FALSE ) { throw $ this -> createAccessDeniedException ( 'The user does not have...
handle the step to build a query for an export
7,864
protected function exportFormStep ( Request $ request , $ alias ) { $ exportManager = $ this -> get ( 'chill.main.export_manager' ) ; $ data = $ this -> get ( 'session' ) -> get ( 'centers_step' , null ) ; if ( $ data === null ) { return $ this -> redirectToRoute ( 'chill_main_export_new' , array ( 'step' => $ this -> ...
Render the export form
7,865
protected function createCreateFormExport ( $ alias , $ step , $ data = array ( ) ) { $ exportManager = $ this -> get ( 'chill.main.export_manager' ) ; $ isGenerate = strpos ( $ step , 'generate_' ) === 0 ; $ builder = $ this -> get ( 'form.factory' ) -> createNamedBuilder ( null , FormType :: class , array ( ) , array...
create a form to show on different steps .
7,866
private function iterate ( array $ content , $ parent = null ) { foreach ( $ content as $ element ) { $ this -> process ( $ element , $ parent ) ; } }
Iterate given content array and call process for every element inside
7,867
private function process ( array $ element , $ parent = null ) { $ apiElement = $ element [ 'element' ] ; if ( isset ( $ this -> elementMap [ $ apiElement ] ) ) { $ this -> processElement ( $ element , $ this -> elementMap [ $ apiElement ] , $ parent ) ; } if ( $ element [ 'element' ] === 'category' ) { $ this -> proce...
Create php classes using raw element data ; called recursively
7,868
private function processElement ( array $ element , $ class , BaseElement $ parent , $ replaceAttribute = null ) { $ apiElement = new $ class ( $ element ) ; if ( ! $ replaceAttribute ) { $ parent -> addContentElement ( $ apiElement ) ; } else { $ parent -> replaceAttributeWithElement ( $ replaceAttribute , $ apiElemen...
Create new element from raw data and add it to its parent
7,869
private function processCategory ( array $ element , $ parent = null ) { if ( $ this -> isMasterCategory ( $ element ) ) { $ this -> createCategory ( $ element , MasterCategoryElement :: class , $ this -> parseResult ) ; } if ( $ this -> isResourceGroup ( $ element ) ) { $ this -> createCategory ( $ element , ResourceG...
Helper to create different php classes from element category which carries its actual meaning in its classes
7,870
private function createCategory ( array $ element , $ className , BaseElement $ parent ) { $ newElement = new $ className ( $ element ) ; $ parent -> addContentElement ( $ newElement ) ; $ this -> iterate ( $ element [ 'content' ] , $ newElement ) ; }
Sub - helper for processCategory
7,871
final public function call ( MVC $ mvc , $ method , $ fileView = null ) { if ( ! method_exists ( $ this , $ method ) ) { throw new \ LogicException ( sprintf ( 'Method "s" don\'t exists.' , $ method ) ) ; } $ this -> view = $ mvc -> view ( ) ; $ arguments = array ( ) ; $ reflectionMethod = new \ ReflectionMethod ( get_...
Call a action of controller
7,872
public function renderJson ( $ value ) { $ options = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP ; return json_encode ( $ value , $ options ) ; }
Converts the supplied value to JSON .
7,873
public function offset ( $ timezone ) { $ timeOffset = ( new \ DateTimeZone ( $ timezone ) ) -> getOffset ( new \ DateTime ( 'now' , new \ DateTimeZone ( 'UTC' ) ) ) ; if ( $ timeOffset < 0 ) { return 'UTC -' . gmdate ( 'H:i' , - $ timeOffset ) ; } else { return 'UTC +' . gmdate ( 'H:i' , $ timeOffset ) ; } }
Get Time Offset
7,874
public function datetime ( $ datetime , $ timezone = null , $ format = 'M/d/Y - h:i:s A' ) { $ datetime = new \ DateTime ( $ datetime ) ; if ( $ timezone ) { $ datetime -> setTimezone ( new \ DateTimeZone ( $ timezone ) ) ; } return $ datetime -> format ( $ format ) ; }
Set Date and Time
7,875
public function createTask ( $ name ) { $ this -> init ( ) ; $ class = Code :: expandNamespace ( \ Webforge \ Common \ String :: expand ( $ name , 'Task' ) , 'Psc\System\Deploy' ) ; $ gClass = GClass :: factory ( $ class ) ; $ params = array ( ) ; if ( $ gClass -> hasMethod ( '__construct' ) ) { $ constructor = $ gClas...
wird automatisch mit dependencies erstellt
7,876
public function setResponse ( JsonResponse $ response ) { $ this -> response = $ response ; if ( ! $ response -> getRequest ( ) ) { $ response -> setRequest ( $ this ) ; } return $ this ; }
Set response .
7,877
public function isValid ( ) { if ( empty ( $ this -> jsonrpc ) ) { return false ; } if ( empty ( $ this -> method ) || ! is_string ( $ this -> method ) ) { return false ; } if ( ! empty ( $ this -> params ) && ! is_array ( $ this -> params ) ) { return false ; } return true ; }
Is valid .
7,878
public function toArray ( ) { $ json = [ ] ; $ json [ 'jsonrpc' ] = $ this -> jsonrpc ; if ( $ this -> method ) { $ json [ 'method' ] = $ this -> method ; } $ json [ 'method' ] = $ this -> method ; if ( $ this -> params ) { $ json [ 'params' ] = $ this -> params ; } if ( $ this -> id ) { $ json [ 'id' ] = $ this -> id ...
Convert JsonRequest to json string .
7,879
public function filter ( $ value , array $ options = [ ] ) { return is_string ( $ value ) ? filter_var ( Str :: lower ( trim ( $ value ) ) , FILTER_SANITIZE_EMAIL ) : $ value ; }
Sanitize email of the given string .
7,880
public function createMessage ( TicketInterface $ ticket = null ) { $ message = new $ this -> ticketMessageClass ( ) ; if ( $ ticket ) { $ message -> setPriority ( $ ticket -> getPriority ( ) ) ; $ message -> setStatus ( $ ticket -> getStatus ( ) ) ; $ message -> setTicket ( $ ticket ) ; } else { $ message -> setStatus...
Create a new instance of TicketMessage Entity .
7,881
public function isPreviouslyDeployed ( Asset $ asset ) { $ outputBasename = $ this -> computeOutputBasename ( $ asset ) ; $ file = $ this -> destinationPath . DIRECTORY_SEPARATOR . $ outputBasename ; if ( is_file ( $ file ) ) { $ objectUrl = $ this -> baseUrl . '/' . $ outputBasename ; $ asset -> setOutputUrl ( $ objec...
Attempt to retrieve a previously deployed asset ; if it does exist then update the Asset instance s outputUrl property without performing any further filters actions . fullPath and outputExtension are set at this point in the Asset instance .
7,882
public function deploy ( Asset $ asset ) { $ outputBasename = $ this -> computeOutputBasename ( $ asset ) ; $ fullPath = $ this -> destinationPath . DIRECTORY_SEPARATOR . $ outputBasename ; $ saving = file_put_contents ( $ fullPath , $ asset -> getContents ( ) ) ; if ( $ saving === false ) { throw new PhassetsInternalE...
Given an Asset instance try to deploy is using internal rules of this deployer and update Asset s property outputUrl .
7,883
public function isSupported ( ) { $ this -> destinationPath = $ this -> configurator -> getConfig ( 'filesystem_deployer' , 'destination_path' ) ; $ this -> baseUrl = $ this -> configurator -> getConfig ( 'filesystem_deployer' , 'base_url' ) ; $ this -> trigger = $ this -> configurator -> getConfig ( 'filesystem_deploy...
This must throw a PhassetsInternalException if the current configuration doesn t allow this deployer to deploy processed assets .
7,884
public function compile ( $ lessFile , $ basePath = null ) { try { $ basePath = $ this -> _prepareBasepath ( $ basePath , dirname ( $ lessFile ) ) ; $ cache = new Cache ( $ this -> _options ) ; $ cache -> setFile ( $ lessFile , $ basePath ) ; $ isExpired = $ cache -> isExpired ( ) ; $ isForce = $ this -> _options -> ge...
Compile less file .
7,885
public static function getVariableValues ( Schema $ schema , array $ asts , array $ inputs ) { $ values = [ ] ; foreach ( $ asts as $ ast ) { $ variable = $ ast -> get ( 'variable' ) -> get ( 'name' ) -> get ( 'value' ) ; $ values [ $ variable ] = self :: getvariableValue ( $ schema , $ ast , isset ( $ inputs [ $ varia...
Prepares an object map of variables of the correct type based on the provided variable definitions and arbitrary input . If the input cannot be coerced to match the variable definitions a Error will be thrown .
7,886
protected static function getVariableValue ( Schema $ schema , VariableDefinition $ definition , $ input ) { $ type = TypeInfo :: typeFromAST ( $ schema , $ definition -> get ( 'type' ) ) ; if ( ! $ type ) { return NULL ; } if ( self :: isValidValue ( $ type , $ input ) ) { if ( ! isset ( $ input ) ) { $ default = $ de...
Given a variable definition and any value of input return a value which adheres to the variable definition or throw an error .
7,887
protected static function isValidValue ( TypeInterface $ type , $ value ) { if ( $ type instanceof NonNullModifier ) { if ( NULL === $ value ) { return FALSE ; } return self :: isValidValue ( $ type -> getWrappedType ( ) , $ value ) ; } if ( $ value === NULL ) { return TRUE ; } if ( $ type instanceof ListModifier ) { $...
Given a type and any value return true if that value is valid .
7,888
protected static function coerceValue ( TypeInterface $ type , $ value ) { if ( $ type instanceof NonNullModifier ) { return self :: coerceValue ( $ type -> getWrappedType ( ) , $ value ) ; } if ( ! isset ( $ value ) ) { return NULL ; } if ( $ type instanceof ListModifier ) { $ itemType = $ type -> getWrappedType ( ) ;...
Given a type and any value return a runtime value coerced to match the type .
7,889
protected static function coerceValueAST ( TypeInterface $ type , $ ast , $ variables = NULL ) { if ( $ type instanceof NonNullModifier ) { return self :: coerceValueAST ( $ type -> getWrappedType ( ) , $ ast , $ variables ) ; } if ( ! $ ast ) { return NULL ; } if ( $ ast :: KIND === Node :: KIND_VARIABLE ) { $ variabl...
Given a type and a value AST node known to match this type build a runtime value .
7,890
public function close ( ) { if ( isset ( $ this -> zip ) ) { $ this -> zip -> close ( ) ; $ this -> zip = null ; } }
Release the zip resource .
7,891
public function prepend ( ContainerBuilder $ container ) { $ configs = array ( 'bazinga_geocoder' => array ( 'providers' => array ( 'google_maps' => null ) ) , 'doctrine' => array ( 'orm' => array ( 'dql' => array ( 'numeric_functions' => array ( 'GEO_DISTANCE' => 'Craue\GeoBundle\Doctrine\Query\Mysql\GeoDistance' ) ) ...
Configure sensitive defaults for other bundles
7,892
public static function create ( $ modelAlias = null , $ criteria = null ) { if ( $ criteria instanceof ApiLogQuery ) { return $ criteria ; } $ query = new ApiLogQuery ( null , null , $ modelAlias ) ; if ( $ criteria instanceof Criteria ) { $ query -> mergeWith ( $ criteria ) ; } return $ query ; }
Returns a new ApiLogQuery object .
7,893
public function filterByDtCall ( $ dtCall = null , $ comparison = null ) { if ( is_array ( $ dtCall ) ) { $ useMinMax = false ; if ( isset ( $ dtCall [ 'min' ] ) ) { $ this -> addUsingAlias ( ApiLogPeer :: DT_CALL , $ dtCall [ 'min' ] , Criteria :: GREATER_EQUAL ) ; $ useMinMax = true ; } if ( isset ( $ dtCall [ 'max' ...
Filter the query on the dt_call column
7,894
public function filterByLastResponse ( $ lastResponse = null , $ comparison = null ) { return $ this -> addUsingAlias ( ApiLogPeer :: LAST_RESPONSE , $ lastResponse , $ comparison ) ; }
Filter the query on the last_response column
7,895
public function encrypt ( $ plaintext , $ key ) { $ inputData = cryptoHelpers :: convertStringToByteArray ( $ plaintext ) ; $ keyAsNumbers = cryptoHelpers :: toNumbers ( bin2hex ( $ key ) ) ; $ keyLength = count ( $ keyAsNumbers ) ; $ iv = cryptoHelpers :: generateSharedKey ( 16 ) ; $ encrypted = AES :: encrypt ( $ inp...
encrypts the given plain text with a key
7,896
public function decrypt ( $ encrypted , $ key ) { if ( empty ( $ encrypted ) ) return null ; list ( $ identifier , $ input ) = explode ( self :: SEPARATOR_ALGORITHM , $ encrypted , 2 ) ; if ( $ identifier !== self :: IDENTIFIER ) throw new Exception ( 'Encryption can not be decrypted. Unsupported identifier: ' . $ iden...
decrypts a message
7,897
protected function edebug ( $ str ) { if ( ! $ this -> SMTPDebug ) { return ; } switch ( $ this -> Debugoutput ) { case 'error_log' : error_log ( $ str ) ; break ; case 'html' : echo htmlentities ( preg_replace ( '/[\r\n]+/' , '' , $ str ) , ENT_QUOTES , $ this -> CharSet ) . "<br>\n" ; break ; case 'echo' : default : ...
Output debugging info via user - defined method . Only if debug output is enabled .
7,898
public function addAttachment ( $ path , $ name = '' , $ encoding = 'base64' , $ type = '' , $ disposition = 'attachment' ) { try { if ( ! @ is_file ( $ path ) ) { throw new phpmailerException ( $ this -> lang ( 'file_access' ) . $ path , self :: STOP_CONTINUE ) ; } if ( $ type == '' ) { $ type = self :: filenameToType...
Add an attachment from a path on the filesystem . Returns false if the file could not be found or read .
7,899
public function encodeQ ( $ str , $ position = 'text' ) { $ pattern = '' ; $ encoded = str_replace ( array ( "\r" , "\n" ) , '' , $ str ) ; switch ( strtolower ( $ position ) ) { case 'phrase' : $ pattern = '^A-Za-z0-9!*+\/ -' ; break ; case 'comment' : $ pattern = '\(\)"' ; case 'text' : default : $ pattern = '\000-\0...
Encode a string using Q encoding .