idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
230,900 | protected function setCookieFromSession ( $ session = NULL ) { if ( ! $ this -> getVariable ( 'cookie_support' ) ) return ; $ cookie_name = $ this -> getSessionCookieName ( ) ; $ value = 'deleted' ; $ expires = time ( ) - 3600 ; $ base_domain = $ this -> getVariable ( 'base_domain' , self :: DEFAULT_BASE_DOMAIN ) ; if ... | Set a JS Cookie based on the _passed in_ session . |
230,901 | protected function generateSignature ( $ params , $ secret ) { ksort ( $ params ) ; $ base_string = '' ; foreach ( $ params as $ key => $ value ) { $ base_string .= $ key . '=' . $ value ; } $ base_string .= $ secret ; return md5 ( $ base_string ) ; } | Generate a signature for the given params and secret . |
230,902 | public function toMinutes ( ) { $ time = $ this -> get ( ) ; if ( ! $ time ) { $ time = '00:00' ; } else { $ time = sprintf ( '%02d:%02d' , ( int ) ( floor ( $ time / 60 ) ) , ( int ) ( $ time % 60 ) ) ; } return $ this ; } | Convert an int as seconds into Minutes . |
230,903 | public function createBlade ( $ views , $ cache ) { $ this -> _blade = new Blade ( $ views , $ cache ) ; $ this -> _view = $ this -> _blade -> view ( ) ; } | Creates a new Blade instance . |
230,904 | public function compile ( $ path ) { $ this -> parseContent ( $ path , $ this -> _data ) ; return $ this -> _factory -> render ( ) ; } | Compiles the view . |
230,905 | public function with ( $ key , $ value = null ) { if ( is_array ( $ key ) ) { $ this -> _data = array_merge ( $ this -> _data , $ key ) ; } else { $ this -> _data [ $ key ] = $ value ; } return $ this ; } | Adds data to pass onto the view . |
230,906 | public static function renderView ( $ path , $ dataName = '' , $ data = '' ) { $ view = new self ( ) ; if ( ! empty ( $ dataName ) ) { $ view -> with ( $ dataName , $ data ) ; } return $ view -> render ( $ path , false ) ; } | Static function to render a view . |
230,907 | private function parseContent ( $ path , $ data ) { $ path = str_replace ( '.' , '/' , $ path ) ; $ this -> _factory = $ this -> _view -> make ( $ path , $ data ) ; } | Parses the view using the Blade Factory . |
230,908 | protected function echoPageLeader ( ) : void { echo '<!DOCTYPE html>' ; echo Html :: generateTag ( 'html' , [ 'xmlns' => 'http://www.w3.org/1999/xhtml' , 'xml:lang' => Abc :: $ babel -> getCode ( ) , 'lang' => Abc :: $ babel -> getCode ( ) ] ) ; echo '<head>' ; Abc :: $ assets -> echoMetaTags ( ) ; Abc :: $ assets -> e... | Echos the XHTML document leader i . e . the start html tag the head element and start body tag . |
230,909 | protected function assignFields ( $ fields ) { foreach ( $ fields as $ field ) { if ( ! $ field instanceof FieldInterface ) { throw new ModelException ( sprintf ( 'Field must be an instance of FieldInterface, got "%s"' , $ this -> getType ( $ field ) ) ) ; } $ field -> table ( $ this -> table ) ; $ this -> fields [ $ f... | Assigns fields to model |
230,910 | protected function assignIndexes ( $ indexes ) { foreach ( $ indexes as $ index ) { if ( ! $ index instanceof IndexInterface ) { throw new ModelException ( sprintf ( 'Index must be an instance of IndexInterface, got "%s"' , $ this -> getType ( $ index ) ) ) ; } foreach ( $ index -> fields ( ) as $ key => $ field ) { $ ... | Assigns indexes to model |
230,911 | protected function assignRelations ( $ relations ) { foreach ( $ relations as $ relation ) { if ( ! $ relation instanceof RelationInterface ) { throw new ModelException ( sprintf ( 'Relation must be an instance of RelationInterface, got "%s"' , $ this -> getType ( $ relation ) ) ) ; } foreach ( array_keys ( $ relation ... | Assigns relations to model |
230,912 | protected function assertField ( $ field ) { if ( ! $ this -> hasField ( $ field ) ) { throw new ModelException ( sprintf ( 'Unknown field, field "%s" not found in model "%s"' , $ field , $ this -> entity ) ) ; } } | Asserts if model has field |
230,913 | public function primaryFields ( ) { $ result = [ ] ; foreach ( $ this -> indexes as $ index ) { if ( ! $ index -> isPrimary ( ) ) { continue ; } foreach ( $ index -> fields ( ) as $ field ) { $ result [ ] = $ this -> field ( $ field ) ; } } return $ result ; } | Returns array containing names of primary indexes |
230,914 | public function indexFields ( ) { $ fields = [ ] ; foreach ( $ this -> indexes as $ index ) { $ fields = array_merge ( $ fields , $ index -> fields ( ) ) ; } $ result = [ ] ; foreach ( array_unique ( $ fields ) as $ field ) { $ result [ ] = $ this -> field ( $ field ) ; } return $ result ; } | Returns array of fields from indexes |
230,915 | public function index ( $ index ) { if ( empty ( $ this -> indexes [ $ index ] ) ) { throw new ModelException ( sprintf ( 'Unknown index, index "%s" not found in model "%s"' , $ index , $ this -> entity ) ) ; } return $ this -> indexes [ $ index ] ; } | Returns index definition |
230,916 | public function referredIn ( $ field ) { $ result = [ ] ; foreach ( $ this -> relations as $ relation ) { if ( false === $ i = array_search ( $ field , $ relation -> localKeys ( ) ) ) { continue ; } $ result [ $ relation -> foreignKeys ( ) [ $ i ] ] = $ relation ; } return $ result ; } | Returns all relation where field is listed as local key |
230,917 | public function relation ( $ relationName ) { if ( ! $ relation = $ this -> findRelationByName ( $ relationName ) ) { throw new ModelException ( sprintf ( 'Unknown relation, relation "%s" not found in model "%s"' , $ relationName , $ this -> entity ) ) ; } return $ relation ; } | Returns relation definition for passed entity class |
230,918 | protected function findRelationByName ( $ relationName ) { foreach ( $ this -> relations as $ relation ) { if ( $ relation -> name ( ) == $ relationName || $ relation -> entity ( ) == $ relationName ) { return $ relation ; } } return null ; } | Finds relation by its name |
230,919 | public function remove ( ) { $ removed = 0 ; foreach ( func_get_args ( ) as $ arg ) { if ( $ arg instanceof Container ) { $ originalCount = $ this -> count ( ) ; $ this -> collection = array_diff_key ( $ this -> collection , $ arg -> collection ) ; $ removed += ( $ originalCount - $ this -> count ( ) ) ; } else { $ sea... | Remove entities from collection |
230,920 | public function mapCombine ( $ keys , $ values ) { return array_combine ( array_map ( $ keys , $ this -> collection ) , array_map ( $ values , $ this -> collection ) ) ; } | MapCombine . Like array map but takes a callback for the array keys |
230,921 | public function pluck ( $ property , $ ifEmptyDefaultToContainer = false ) { $ mapper = $ this -> getPropertyMapper ( $ property ) ; $ isAllObjects = true ; $ output = [ ] ; foreach ( $ this -> collection as $ obj ) { $ propertyValue = $ mapper -> get ( $ obj ) ; $ isAllObjects = $ isAllObjects and is_object ( $ proper... | Pluck a property from the collection |
230,922 | private function generateSortByPropertyClosure ( $ property , $ direction = SORT_ASC ) { if ( $ direction === SORT_DESC ) { $ aLTb = 1 ; $ aGTb = - 1 ; } else { $ aLTb = - 1 ; $ aGTb = 1 ; } $ mapper = $ this -> getPropertyMapper ( $ property ) ; return function ( $ a , $ b ) use ( $ mapper , $ aLTb , $ aGTb ) { $ prop... | Return a user defined sort comparison function that is property mapper aware . |
230,923 | private function generateGetPropertyClosure ( $ property ) { $ mapper = $ this -> getPropertyMapper ( $ property ) ; return function ( $ obj ) use ( $ mapper ) { return $ mapper -> get ( $ obj ) ; } ; } | Returns a callable to access a object property |
230,924 | public function sortByProperty ( $ property , $ direction = null ) { $ this -> sort ( $ this -> generateSortByPropertyClosure ( $ property , $ direction ) ) ; return $ this ; } | Sort container by property |
230,925 | private function checkEntity ( $ obj ) { if ( $ class = $ this -> classGet ( ) and ! ( $ obj instanceof $ class ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Obj %s is not compatible with Container of class %s' , get_class ( $ obj ) , $ class ) ) ; } return true ; } | Check an entity implments ContainerInterface . It should be the same type of entities already in collection . |
230,926 | private function checkEntityArray ( array $ entityArray , & $ error = null ) { if ( $ existing = $ this -> classGet ( ) ) { foreach ( $ entityArray as $ value ) { if ( ! ( $ value instanceof $ existing ) ) { $ error = "Can't add entity of class `" . get_class ( $ value ) . "` to container of class `{$existing}`." ; ret... | Check if a array of Entity s is compatible with this container |
230,927 | public function contains ( ) { $ output = true ; $ args = func_get_args ( ) ; while ( list ( , $ value ) = each ( $ args ) and $ output ) { if ( $ value instanceof Container ) { $ numChecking = count ( $ value ) ; $ numContained = count ( array_intersect_key ( $ value -> collection , $ this -> collection ) ) ; $ testRe... | Does this container contain the following entities |
230,928 | private function arrayHelperMethod ( $ fn , array $ args ) { $ class = $ this -> classGet ( ) ; $ fnArguments = array ( $ this -> collection ) ; foreach ( $ args as $ container ) { if ( ! ( $ container instanceof $ this ) ) { throw new \ InvalidArgumentException ( "You can only `{$fn}` containers." ) ; } $ containerCla... | Validation and execution helper method for intersect and diff . |
230,929 | public function randomGet ( $ n = null , $ returnContainer = false , $ removeFromContainer = false ) { $ n = $ n === null ? 1 : ( int ) $ n ; if ( 0 === $ containerSize = $ this -> count ( ) ) { if ( $ returnContainer or $ n > 1 ) { return $ this -> newContainer ( ) ; } return null ; } if ( $ n === 1 ) { $ key = array_... | Return a random number of entities from this collection . If n = 1 you will recieve a entity otherwise you will get a container |
230,930 | public function findByFilterComponents ( $ qty , array $ filterComponents ) { $ output = $ this -> copy ( ) ; if ( ! $ filterComponents ) { return $ output ; } $ filterClosure = function ( $ obj ) use ( $ filterComponents ) { $ pass = true ; foreach ( $ filterComponents as $ filter ) { $ filterResult = $ filter -> chec... | Filter a container |
230,931 | public function classSet ( $ input ) { if ( is_object ( $ input ) ) { if ( $ input instanceof self ) { $ class = $ input -> classGet ( ) ; } else { $ class = get_class ( $ input ) ; } } else { $ class = $ input ; } $ currentClass = $ this -> classGet ( ) ; if ( $ currentClass ) { if ( $ class !== $ currentClass ) { thr... | Set a containers class |
230,932 | private function classGet ( ) { return isset ( $ this -> class ) ? $ this -> class : ( ( $ firstElement = $ this -> firstElementGet ( ) ) ? ( $ this -> class = get_class ( $ firstElement ) ) : null ) ; } | Get the class of this container . |
230,933 | public function splitByClass ( ) { $ classes = array ( ) ; foreach ( $ this -> collection as $ key => $ entity ) { $ classes [ get_class ( $ entity ) ] [ ] = $ key ; } ksort ( $ classes ) ; $ output = array ( ) ; foreach ( $ classes as $ class => $ splHashes ) { $ container = $ this -> newContainer ( ) ; $ container ->... | Split by class |
230,934 | public function implode ( $ glue , $ propertyOrClosure = null ) { if ( null === $ propertyOrClosure ) { $ pieces = $ this -> map ( 'strval' ) ; } elseif ( $ propertyOrClosure instanceof \ Closure ) { $ pieces = $ this -> map ( $ propertyOrClosure ) ; } else { $ pieces = $ this -> map ( $ this -> generateGetPropertyClos... | Seems like I m more and more imploding groups of entities on something |
230,935 | public function newContainer ( ) { $ refl = new ReflectionClass ( $ this ) ; $ container = $ refl -> newInstanceArgs ( func_get_args ( ) ) ; $ container -> classSet ( $ this -> class ) ; $ container -> propertyMapper = $ this -> propertyMapper ; return $ container ; } | Generate a new empty container of the same type as what is currently instantiated |
230,936 | public function init ( ) : void { parent :: init ( ) ; if ( ! ( $ this -> contentFS instanceof Filesystem ) ) { throw new InvalidConfigException ( sprintf ( 'ContentFS must be instance of %s.' , Filesystem :: class ) ) ; } if ( ! ( $ this -> cacheFS instanceof Filesystem ) ) { throw new InvalidConfigException ( sprintf... | Check initialization parameters and parse configs |
230,937 | public function getFilePath ( IFile $ file , string $ format , array $ formatterConfig = [ ] ) : ? string { $ alias = $ this -> getAliasConfig ( $ file -> getModelAlias ( ) ) ; $ formatter = $ this -> buildFormatter ( $ file , $ format , $ formatterConfig ) ; $ targetPath = $ alias -> getAssetPath ( $ file , $ format )... | Caches file and returns url to it . |
230,938 | protected function cacheFile ( IFile $ file , FileFormatter $ formatter , string $ targetPath ) : bool { if ( $ file instanceof ICacheStateful && $ file -> getIsCached ( $ formatter -> name ) ) { return true ; } return ( new Saver ( $ file , $ this -> cacheFS , $ targetPath ) ) -> save ( $ formatter ) ; } | Caches file available in web . |
230,939 | public function process ( ServerRequestInterface $ request , RequestHandlerInterface $ handler ) : ResponseInterface { $ response = $ handler -> handle ( $ request ) ; $ code = $ response -> getStatusCode ( ) ; $ allowedCodes = array_keys ( $ this -> renderer ) + array_keys ( $ this -> defaultErrors ) ; if ( in_array (... | Execute the middleware . |
230,940 | private function getOnlineUsers ( ) { $ date = Carbon :: now ( ) -> subMinutes ( config ( 'arcanesoft.auth.track-activity.minutes' , 5 ) ) ; return $ this -> getCachedUsers ( ) -> filter ( function ( User $ user ) use ( $ date ) { return ! is_null ( $ user -> last_activity ) && $ user -> last_activity -> gte ( $ date )... | Get the online users . |
230,941 | public function model ( $ name = '' , $ namespace = null ) { if ( null === $ name ) { $ namespace = $ this -> namespace ; } $ namespace = $ this -> resolveNamespace ( $ namespace ) ; $ model = $ this -> model = $ this -> createModelInstance ( $ namespace , $ name ) ; return $ model ; } | create and return model instance |
230,942 | public function getDataForBreadcrumb ( Page $ page ) { $ parent = $ page -> getParent ( ) ; if ( $ parent ) { $ data = array ( ) ; if ( $ parent -> getParent ( ) ) { $ data = array_merge ( $ this -> getDataForBreadcrumb ( $ parent ) , $ data ) ; } $ data [ ] = $ parent ; return $ data ; } return NULL ; } | Get breadcrumb data |
230,943 | public function allowChildren ( Page $ page ) { $ models = $ this -> container -> getParameter ( 'fulgurio_light_cms.models' ) ; return $ models [ $ page -> getModel ( ) ] [ 'allow_children' ] ; } | Check if page model allow children |
230,944 | public function needTranslatedPages ( Page $ page ) { if ( ! $ page -> getParent ( ) || ! is_null ( $ page -> getSourceId ( ) ) ) { return FALSE ; } if ( $ this -> container -> hasParameter ( 'fulgurio_light_cms.languages' ) ) { $ availableLangs = $ this -> container -> getParameter ( 'fulgurio_light_cms.languages' ) ;... | Get parent page to copy page for translation |
230,945 | public function thumb ( $ media , $ size = 'small' ) { $ thumbSizes = $ this -> container -> getParameter ( 'fulgurio_light_cms.thumbs' ) ; return LightCMSUtils :: getThumbFilename ( $ media -> getFullPath ( ) , $ media -> getMediaType ( ) , $ thumbSizes [ $ size ] ) ; } | Get thumb of a picture |
230,946 | public function getPagesMenu ( $ menuName , $ lang = NULL ) { $ pages = $ this -> doctrine -> getRepository ( 'FulgurioLightCMSBundle:PageMenu' ) -> findPagesOfMenu ( $ menuName , $ lang ) ; $ availablePages = array ( ) ; foreach ( $ pages as & $ page ) { $ availablePages [ ] = $ page ; } return $ availablePages ; } | Get page menu to display |
230,947 | public function getHash ( ) { $ data = [ ] ; foreach ( $ this -> instrumentors as $ instrumentor ) { $ data [ get_class ( $ instrumentor ) ] = NULL ; if ( $ instrumentor instanceof CachingInstrumentorInterface ) { $ data [ get_class ( $ instrumentor ) ] = $ instrumentor -> getHash ( ) ; } else { $ data [ get_class ( $ ... | Get a hash computed from the the fully - qualified names of all registered instrumentors . |
230,948 | public function getLastModified ( ) { $ mtime = 0 ; foreach ( $ this -> instrumentors as $ instrumentor ) { $ mtime = max ( $ mtime , filemtime ( ( new \ ReflectionClass ( $ instrumentor ) ) -> getFileName ( ) ) ) ; if ( $ instrumentor instanceof CachingInstrumentorInterface ) { $ mtime = max ( $ mtime , $ instrumentor... | Get the most - recent modification time computed from all registered instrumentors . |
230,949 | public function isDispatchable ( Request $ request ) { $ className = $ this -> getControllerClass ( $ request ) ; if ( ( $ this -> _defaultModule != $ this -> _curModule ) || $ this -> getParam ( 'prefixDefaultModule' ) ) { $ className = $ this -> formatClassName ( $ this -> _curModule , $ className ) ; } if ( class_ex... | Returns TRUE if the Zend_Controller_Request_Abstract object can be dispatched to a controller . |
230,950 | protected function init ( ) : bool { if ( ! isset ( $ _SESSION [ $ this -> name ] ) ) { $ _SESSION [ $ this -> name ] = [ ] ; } return true ; } | Initializes the session . |
230,951 | public function set ( string $ key , $ value ) : bool { if ( is_string ( $ key ) === false || $ key === "" ) { return false ; } $ this -> _configValues [ $ key ] = $ value ; return true ; } | Set config item |
230,952 | public function get ( string $ key ) { return isset ( $ this -> _configValues [ $ key ] ) ? $ this -> _configValues [ $ key ] : null ; } | Get config item |
230,953 | public function remove ( string $ key ) : bool { if ( isset ( $ this -> _configValues [ $ key ] ) === false ) { return false ; } unset ( $ this -> _configValues [ $ key ] ) ; return true ; } | Remove config item |
230,954 | public function prependResourceName ( array $ loadedConfig , string $ resName ) : array { $ prefixedConf = [ ] ; foreach ( $ loadedConfig as $ key => $ value ) { $ prefixedConf [ "{$resName}.{$key}" ] = $ value ; } return $ prefixedConf ; } | Prepend resource name to keys |
230,955 | protected function _getAbsPath ( string $ resName ) : string { foreach ( $ this -> _resDir as $ dir ) { $ absPath = rtrim ( $ dir , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . $ resName ; if ( file_exists ( $ absPath ) ) { return $ absPath ; } } return "" ; } | Get resource absolute path |
230,956 | public function changeHeader ( string $ name , string $ value ) : void { $ this -> headers [ $ name ] = $ value ; } | Changes header value . |
230,957 | public function changeHeaders ( callable $ callback ) : void { foreach ( $ this -> headers as $ name => $ value ) { $ this -> headers [ $ name ] = call_user_func ( $ callback , $ name , $ value ) ; } } | Changes headers using callback function . |
230,958 | public function applyEntity ( Resource $ resource , EntityInterface $ entity ) { $ this -> validateResourceTypes ( $ resource -> getEntityType ( ) , $ entity -> getType ( ) ) ; $ document -> pushData ( $ entity ) ; return $ this ; } | Applies an entity or entity identifier to a resource . |
230,959 | public function applyRelationships ( Entity $ owner , $ data ) { $ this -> validateData ( $ data ) ; $ meta = $ this -> mf -> getMetadataForType ( $ owner -> getType ( ) ) ; foreach ( $ meta -> getRelationships ( ) as $ key => $ relationship ) { if ( ! isset ( $ data [ $ key ] ) || ! $ data [ $ key ] instanceof EntityI... | Applies an array or array - like set of relationship data to an entity . Each array member must be a EntityInterface object keyed by the relationship field key . |
230,960 | public function applyRelationship ( Entity $ owner , $ fieldKey , EntityInterface $ related ) { $ meta = $ this -> em -> getMetadataForType ( $ owner -> getType ( ) ) ; if ( false === $ meta -> hasRelationship ( $ fieldKey ) ) { throw new InvalidArgumentException ( 'The resource "%s" does not contain relationship field... | Applies a single relationship to an owning resource via a related resource object . |
230,961 | public function applyAttributes ( Resource $ entity , $ data ) { $ this -> validateData ( $ data ) ; $ meta = $ this -> em -> getMetadataFor ( $ entity -> getType ( ) ) ; foreach ( $ meta -> getAttributes ( ) as $ key => $ attribute ) { if ( ! isset ( $ data [ $ key ] ) ) { continue ; } $ this -> applyAttribute ( $ ent... | Applies an array or array - like set of attribute data to an entity . Each array member must be keyed by the attribute field key . |
230,962 | public function applyAttribute ( Entity $ entity , $ fieldKey , $ value ) { $ entity -> addAttribute ( $ this -> createAttribute ( $ fieldKey , $ value ) ) ; return $ this ; } | Applies a single attribute value to a resource . |
230,963 | public function update ( $ id , array $ data ) { $ obj = $ this -> find ( $ id ) ; Event :: fire ( 'repository.updating' , [ $ obj , $ data ] ) ; $ obj -> update ( $ data ) ; return $ obj ; } | Update a new object |
230,964 | public function delete ( $ id ) { $ obj = $ this -> find ( $ id ) ; Event :: fire ( 'repository.deleting' , [ $ obj ] ) ; return $ obj -> delete ( ) ; } | Deletes a new object |
230,965 | final public function socketCreatePair ( $ domain , $ type , $ protocol , array & $ fd ) { return socket_create_pair ( $ domain , $ type , $ protocol , $ fd ) ; } | Creates a pair of indistinguishable sockets and stores them in an array |
230,966 | final public function socketSetOption ( $ optname , $ optval , $ level = SOL_SOCKET ) { return socket_set_option ( $ this -> socket , $ level , $ optname , $ optval ) ; } | Sets socket options for the socket |
230,967 | final public function socketSend ( $ buff , $ len , $ flags = MSG_OOB ) { return socket_send ( $ this -> socket , $ buff , is_int ( $ len ) ? $ len : strlen ( $ buff ) , $ flags ) ; } | Sends data to a connected socket |
230,968 | final public function socketSendto ( $ buf , $ len , $ flags , $ addr , $ port = 0 ) { return socket_sendto ( $ this -> socket , $ buf , $ len , $ flags , $ addr , $ port ) ; } | Sends a message to a socket whether it is connected or not |
230,969 | public function listAction ( Request $ request ) { $ response = $ this -> getCacheTimeKeeper ( ) -> getResponse ( 'AnimeDbCatalogBundle:Storage' ) ; if ( $ response -> isNotModified ( $ request ) ) { return $ response ; } $ rep = $ this -> getDoctrine ( ) -> getRepository ( 'AnimeDbCatalogBundle:Storage' ) ; return $ t... | Storage list . |
230,970 | public function changeAction ( Storage $ storage , Request $ request ) { $ response = $ this -> getCacheTimeKeeper ( ) -> getResponse ( $ storage -> getDateUpdate ( ) ) ; if ( $ response -> isNotModified ( $ request ) ) { return $ response ; } $ form = $ this -> createForm ( new StorageForm ( ) , $ storage ) ; if ( $ r... | Change storage . |
230,971 | public function addAction ( Request $ request ) { $ storage = new Storage ( ) ; $ form = $ this -> createForm ( new StorageForm ( ) , $ storage ) ; if ( $ request -> getMethod ( ) == 'POST' ) { $ form -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ ... | Add storage . |
230,972 | public function deleteAction ( Storage $ storage ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> remove ( $ storage ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'storage_list' ) ) ; } | Delete storage . |
230,973 | public function getPathAction ( Request $ request ) { $ response = $ this -> getCacheTimeKeeper ( ) -> getResponse ( 'AnimeDbCatalogBundle:Storage' , - 1 , new JsonResponse ( ) ) ; if ( $ response -> isNotModified ( $ request ) ) { return $ response ; } $ storage = $ this -> getDoctrine ( ) -> getManager ( ) -> find ( ... | Get storage path . |
230,974 | public function scanAction ( Storage $ storage ) { $ this -> get ( 'anime_db.storage.scan_executor' ) -> export ( $ storage ) ; return $ this -> render ( 'AnimeDbCatalogBundle:Storage:scan.html.twig' , [ 'storage' => $ storage , ] ) ; } | Scan storage . |
230,975 | public function scanOutputAction ( Storage $ storage , Request $ request ) { $ filename = $ this -> container -> getParameter ( 'anime_db.catalog.storage.scan_output' ) ; $ filename = sprintf ( $ filename , $ storage -> getId ( ) ) ; if ( ! file_exists ( $ filename ) ) { throw $ this -> createNotFoundException ( 'Log f... | Get storage scan output . |
230,976 | public function scanProgressAction ( Storage $ storage ) { $ filename = $ this -> container -> getParameter ( 'anime_db.catalog.storage.scan_progress' ) ; $ filename = sprintf ( $ filename , $ storage -> getId ( ) ) ; if ( ! file_exists ( $ filename ) ) { throw $ this -> createNotFoundException ( 'The progress status c... | Get storage scan progress . |
230,977 | public function actionIndex ( $ option = null ) { if ( ! ConfigHelper :: isDetected ( ) ) { Question :: confirm ( 'Config not detected! Restore?' , 1 ) ; ConfigHelper :: restoreConfig ( ) ; } $ option = Question :: displayWithQuit ( 'Set offline state' , [ 'Enable' , 'Disable' ] , $ option ) ; $ result = ConfigHelper :... | Set offline mode |
230,978 | public function buildInput ( ApiDoc $ annotation , $ data = null ) { $ annotationReflection = new \ ReflectionClass ( 'Nelmio\ApiDocBundle\Annotation\ApiDoc' ) ; $ inputReflection = $ annotationReflection -> getProperty ( 'input' ) ; $ inputReflection -> setAccessible ( true ) ; if ( ! ( isset ( $ data [ 'input' ] ) ||... | Method that adds the input property of ApiDoc getting the form type s fully qualified name . |
230,979 | public function buildOutput ( ApiDoc $ annotation , $ data = null ) { $ annotationReflection = new \ ReflectionClass ( 'Nelmio\ApiDocBundle\Annotation\ApiDoc' ) ; $ outputReflection = $ annotationReflection -> getProperty ( 'output' ) ; $ outputReflection -> setAccessible ( true ) ; if ( ! ( isset ( $ data [ 'output' ]... | Method that adds the output property of ApiDoc getting the model s fully qualified name . |
230,980 | protected function checkExists ( $ id ) { $ filter = array ( 'fields' => array ( array ( 'field' => 'id' , 'compare' => '=' , 'value' => $ id , ) , ) , ) ; $ exists = $ this -> rubric -> count ( $ filter ) ; return $ exists ? true : false ; } | Check for exists |
230,981 | final public function unhighlightString ( $ contents = '' , $ update_file = false , array $ replacements = array ( '<br />' => PHP_EOL , '<br>' => PHP_EOL , ' ' => ' ' ) ) { $ contents = str_replace ( array_keys ( $ replacements ) , array_values ( $ replacements ) , $ contents ) ; $ contents = strip_tags ( $ conte... | Inverse of highlight function . Attempts to convert HTML to regular string |
230,982 | public function write ( ) { foreach ( $ this -> parameters as $ prop => $ value ) { $ placeHolders [ ] = sprintf ( '<%s>' , $ prop ) ; $ replacements [ ] = $ value ; } $ content = str_replace ( $ placeHolders , $ replacements , self :: $ template ) ; fwrite ( $ this -> file , $ this -> addHeaders ( $ content ) ) ; } | Write staging in file . |
230,983 | public static function setObjectFilter ( $ Class , $ Filter ) { $ instance = FirePHP :: getInstance ( true ) ; $ instance -> setObjectFilter ( $ Class , $ Filter ) ; } | Specify a filter to be used when encoding an object |
230,984 | public static function send ( ) { $ instance = FirePHP :: getInstance ( true ) ; $ args = func_get_args ( ) ; return call_user_func_array ( array ( $ instance , 'fb' ) , $ args ) ; } | Log object to firebug |
230,985 | public static function group ( $ Name , $ Options = null ) { $ instance = FirePHP :: getInstance ( true ) ; return $ instance -> group ( $ Name , $ Options ) ; } | Start a group for following messages |
230,986 | public static function getInstance ( $ AutoCreate = false ) { if ( $ AutoCreate === true && ! self :: $ instance ) { self :: init ( ) ; } return self :: $ instance ; } | Gets singleton instance of FirePHP |
230,987 | public function setLogToInsightConsole ( $ console ) { if ( is_string ( $ console ) ) { if ( get_class ( $ this ) != 'FirePHP_Insight' && ! is_subclass_of ( $ this , 'FirePHP_Insight' ) ) { throw new Exception ( 'FirePHP instance not an instance or subclass of FirePHP_Insight!' ) ; } $ this -> logToInsightConsole = $ t... | Set an Insight console to direct all logging calls to |
230,988 | public function setOption ( $ Name , $ Value ) { if ( ! isset ( $ this -> options [ $ Name ] ) ) { throw $ this -> newException ( 'Unknown option: ' . $ Name ) ; } $ this -> options [ $ Name ] = $ Value ; } | Set an option for the library |
230,989 | public function getOption ( $ Name ) { if ( ! isset ( $ this -> options [ $ Name ] ) ) { throw $ this -> newException ( 'Unknown option: ' . $ Name ) ; } return $ this -> options [ $ Name ] ; } | Get an option from the library |
230,990 | public function errorHandler ( $ errno , $ errstr , $ errfile , $ errline , $ errcontext ) { if ( error_reporting ( ) == 0 ) { return ; } if ( error_reporting ( ) & $ errno ) { $ exception = new ErrorException ( $ errstr , 0 , $ errno , $ errfile , $ errline ) ; if ( $ this -> throwErrorExceptions ) { throw $ exception... | FirePHP s error handler |
230,991 | function exceptionHandler ( $ Exception ) { $ this -> inExceptionHandler = true ; header ( 'HTTP/1.1 500 Internal Server Error' ) ; try { $ this -> fb ( $ Exception ) ; } catch ( Exception $ e ) { echo 'We had an exception: ' . $ e ; } $ this -> inExceptionHandler = false ; } | FirePHP s exception handler |
230,992 | public function registerAssertionHandler ( $ convertAssertionErrorsToExceptions = true , $ throwAssertionExceptions = false ) { $ this -> convertAssertionErrorsToExceptions = $ convertAssertionErrorsToExceptions ; $ this -> throwAssertionExceptions = $ throwAssertionExceptions ; if ( $ throwAssertionExceptions && ! $ c... | Register FirePHP driver as your assert callback |
230,993 | public function assertionHandler ( $ file , $ line , $ code ) { if ( $ this -> convertAssertionErrorsToExceptions ) { $ exception = new ErrorException ( 'Assertion Failed - Code[ ' . $ code . ' ]' , 0 , null , $ file , $ line ) ; if ( $ this -> throwAssertionExceptions ) { throw $ exception ; } else { $ this -> fb ( $ ... | FirePHP s assertion handler |
230,994 | public function group ( $ Name , $ Options = null ) { if ( ! $ Name ) { throw $ this -> newException ( 'You must specify a label for the group!' ) ; } if ( $ Options ) { if ( ! is_array ( $ Options ) ) { throw $ this -> newException ( 'Options must be defined as an array!' ) ; } if ( array_key_exists ( 'Collapsed' , $ ... | Start a group for following messages . |
230,995 | public function dump ( $ Key , $ Variable , $ Options = array ( ) ) { if ( ! is_string ( $ Key ) ) { throw $ this -> newException ( 'Key passed to dump() is not a string' ) ; } if ( strlen ( $ Key ) > 100 ) { throw $ this -> newException ( 'Key passed to dump() is longer than 100 characters' ) ; } if ( ! preg_match_all... | Dumps key and variable to firebug server panel |
230,996 | public function table ( $ Label , $ Table , $ Options = array ( ) ) { return $ this -> fb ( $ Table , $ Label , FirePHP :: TABLE , $ Options ) ; } | Log a table in the firebug console |
230,997 | public static function to ( ) { $ instance = self :: getInstance ( ) ; if ( ! method_exists ( $ instance , "_to" ) ) { throw new Exception ( "FirePHP::to() implementation not loaded" ) ; } $ args = func_get_args ( ) ; return call_user_func_array ( array ( $ instance , '_to' ) , $ args ) ; } | Insight API wrapper |
230,998 | public function detectClientExtension ( ) { if ( @ preg_match_all ( '/\sFirePHP\/([\.\d]*)\s?/si' , $ this -> getUserAgent ( ) , $ m ) && version_compare ( $ m [ 1 ] [ 0 ] , '0.0.6' , '>=' ) ) { return true ; } else if ( @ preg_match_all ( '/^([\.\d]*)$/si' , $ this -> getRequestHeader ( "X-FirePHP-Version" ) , $ m ) &... | Check if FirePHP is installed on client |
230,999 | protected function _escapeTrace ( $ Trace ) { if ( ! $ Trace ) return $ Trace ; for ( $ i = 0 ; $ i < sizeof ( $ Trace ) ; $ i ++ ) { if ( isset ( $ Trace [ $ i ] [ 'file' ] ) ) { $ Trace [ $ i ] [ 'file' ] = $ this -> _escapeTraceFile ( $ Trace [ $ i ] [ 'file' ] ) ; } if ( isset ( $ Trace [ $ i ] [ 'args' ] ) ) { $ T... | Escape trace path for windows systems |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.