idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
49,500 | public function breadcrumbs ( $ route , $ parsedRoute ) { if ( isset ( $ parsedRoute [ 'action' ] ) ) { switch ( $ parsedRoute [ 'action' ] ) { case 'index' : return $ this -> breadcrumbsIndex ( $ route , $ parsedRoute ) ; } } return null ; } | Builds breadcrumbs for a particular route . |
49,501 | protected function getDeliveries ( ) { $ service = $ this -> getServiceManager ( ) -> get ( ProctorService :: SERVICE_ID ) ; $ proctor = \ common_session_SessionManager :: getSession ( ) -> getUser ( ) ; $ context = $ this -> hasRequestParameter ( 'context' ) ? $ this -> getRequestParameter ( 'context' ) : null ; $ del... | Lists all available deliveries |
49,502 | public function get ( $ deliveryExecutionId , $ eventId = null ) { $ queryBuilder = $ this -> getQueryBuilder ( ) ; $ queryBuilder -> select ( '*' ) -> from ( static :: TABLE_NAME ) -> where ( static :: DELIVERY_EXECUTION_ID . '=:delivery_execution_id' ) -> setParameter ( 'delivery_execution_id' , $ deliveryExecutionId... | Get logged data by delivery execution id |
49,503 | public function getProctorableDeliveries ( User $ proctor , $ context = null ) { return DeliveryAssemblyService :: singleton ( ) -> getRootClass ( ) -> searchInstances ( array ( self :: ACCESSIBLE_PROCTOR => self :: ACCESSIBLE_PROCTOR_ENABLED ) , array ( 'recursive' => true ) ) ; } | Gets all deliveries available for a proctor |
49,504 | private function isProctoredDelivery ( \ core_kernel_classes_Resource $ delivery ) { $ hasProctor = $ delivery -> getOnePropertyValue ( $ this -> getProperty ( ProctorService :: ACCESSIBLE_PROCTOR ) ) ; $ result = $ hasProctor instanceof \ core_kernel_classes_Resource && $ hasProctor -> getUri ( ) == ProctorService :: ... | Check whether secure plugins must be used . |
49,505 | public function check ( RunnerServiceContext $ context ) { parent :: check ( $ context ) ; $ state = $ context -> getTestSession ( ) -> getState ( ) ; if ( $ state == AssessmentTestSessionState :: SUSPENDED ) { throw new QtiRunnerPausedException ( ) ; } return true ; } | Check whether the test is in a runnable state . |
49,506 | protected function buildData ( DeliveryExecutionInterface $ deliveryExecution , $ data ) { $ dataObject = $ this -> createMonitoringData ( $ deliveryExecution , $ data ) ; return $ dataObject ; } | Ensure that all DeliveryMonitoringData are unique per delivery execution id |
49,507 | protected function loadData ( $ deliveryExecutionId ) { $ qb = $ this -> getPersistence ( ) -> getPlatForm ( ) -> getQueryBuilder ( ) ; $ qb -> select ( '*' ) -> from ( self :: TABLE_NAME ) -> where ( self :: DELIVERY_EXECUTION_ID . '= :deid' ) -> setParameter ( 'deid' , $ deliveryExecutionId ) ; $ data = $ qb -> execu... | Load data instead of searching Returns false on failure |
49,508 | public function find ( array $ criteria = [ ] , array $ options = [ ] , $ together = false ) { $ result = [ ] ; $ this -> joins = [ ] ; $ this -> queryParams = [ ] ; $ this -> selectColumns = $ this -> getPrimaryColumns ( ) ; $ this -> groupColumns = [ 't.delivery_execution_id' ] ; $ defaultOptions = [ 'order' => join ... | Find delivery monitoring data . |
49,509 | protected function getKvData ( array $ ids ) { if ( empty ( $ ids ) ) { return [ ] ; } $ result = [ ] ; $ sql = 'SELECT * FROM ' . self :: KV_TABLE_NAME . ' WHERE ' . self :: KV_COLUMN_PARENT_ID . ' IN(' . join ( ',' , array_map ( function ( ) { return '?' ; } , $ ids ) ) . ')' ; $ secondaryData = $ this... | Get secondary data by parent data id |
49,510 | protected function isNewRecord ( DeliveryMonitoringDataInterface $ deliveryMonitoring ) { $ data = $ deliveryMonitoring -> get ( ) ; $ deliveryExecutionId = $ data [ self :: COLUMN_DELIVERY_EXECUTION_ID ] ; $ sql = "SELECT EXISTS( " . PHP_EOL . "SELECT " . self :: COLUMN_DELIVERY_EXECUTION_ID . PHP_EOL . "FROM " . self... | Check if record for delivery execution already exists in the storage . |
49,511 | public function deliveryLabelChanged ( MetadataModified $ event ) { $ resource = $ event -> getResource ( ) ; if ( $ event -> getMetadataUri ( ) === OntologyRdfs :: RDFS_LABEL ) { $ assemblyClass = DeliveryAssemblyService :: singleton ( ) -> getRootClass ( ) ; if ( $ resource -> isInstanceOf ( $ assemblyClass ) ) { $ q... | Update the label of the delivery across the entrie cache |
49,512 | public function deliveryAuthorized ( AuthorizationGranted $ event ) { $ deliveryExecution = $ event -> getDeliveryExecution ( ) ; $ data = $ this -> createMonitoringData ( $ deliveryExecution ) ; $ data -> update ( DeliveryMonitoringService :: AUTHORIZED_BY , $ event -> getAuthorizer ( ) -> getIdentifier ( ) ) ; if ( !... | Sets the protor who authorized this delivery execution |
49,513 | private function updateStatus ( ) { $ status = $ this -> deliveryExecution -> getState ( ) -> getUri ( ) ; $ this -> addValue ( DeliveryMonitoringService :: STATUS , $ status , true ) ; if ( $ status == ProctoredDeliveryExecution :: STATE_PAUSED ) { $ this -> addValue ( DeliveryMonitoringService :: LAST_PAUSE_TIMESTAMP... | Update test session state |
49,514 | private function updateRemainingTime ( ) { $ result = null ; $ remaining = 0 ; $ hasTimer = false ; $ session = $ this -> getTestSession ( ) ; if ( $ session !== null && $ session -> isRunning ( ) ) { $ remaining = PHP_INT_MAX ; $ timeConstraints = $ session -> getTimeConstraints ( ) ; foreach ( $ timeConstraints as $ ... | Update remaining time of delivery execution |
49,515 | private function updateDiffTimestamp ( ) { $ diffTimestamp = 0 ; $ lastTimeStamp = 0 ; $ lastActivity = 0 ; if ( isset ( $ this -> data [ DeliveryMonitoringService :: LAST_PAUSE_TIMESTAMP ] ) ) { $ lastTimeStamp = $ this -> data [ DeliveryMonitoringService :: LAST_PAUSE_TIMESTAMP ] ; } if ( isset ( $ this -> data [ Del... | Update diff between last_pause_timestamp and last_test_taker_activity |
49,516 | private function updateExtraTime ( ) { $ testSession = $ this -> getTestSession ( ) ; if ( $ testSession instanceof TestSession ) { $ timer = $ testSession -> getTimer ( ) ; $ timerTarget = $ testSession -> getTimerTarget ( ) ; } else { $ timerTarget = TimePoint :: TARGET_SERVER ; $ qtiTimerFactory = $ this -> getServi... | Update extra time allowed for the delivery execution |
49,517 | public function index ( ) { $ user = common_session_SessionManager :: getSession ( ) -> getUser ( ) ; $ startedExecutions = $ this -> service -> getResumableDeliveries ( $ user ) ; foreach ( $ startedExecutions as $ startedExecution ) { if ( $ startedExecution -> getDelivery ( ) -> exists ( ) ) { $ this -> revoke ( $ s... | Overrides the content extension data |
49,518 | public function awaitingAuthorization ( ) { $ deliveryExecution = $ this -> getCurrentDeliveryExecution ( ) ; $ deliveryExecutionStateService = $ this -> getServiceManager ( ) -> get ( DeliveryExecutionStateService :: SERVICE_ID ) ; $ executionState = $ deliveryExecution -> getState ( ) -> getUri ( ) ; $ runDeliveryUrl... | The awaiting authorization screen |
49,519 | public function isAuthorized ( ) { $ deliveryExecution = $ this -> getCurrentDeliveryExecution ( ) ; $ executionState = $ deliveryExecution -> getState ( ) -> getUri ( ) ; $ authorized = false ; $ success = true ; $ message = null ; switch ( $ executionState ) { case DeliveryExecutionState :: STATE_AUTHORIZED : $ autho... | The action called to check if the requested delivery execution has been authorized by the proctor |
49,520 | public function cancelExecution ( ) { $ deliveryExecution = $ this -> getCurrentDeliveryExecution ( ) ; $ deliveryExecutionStateService = $ this -> getServiceManager ( ) -> get ( DeliveryExecutionStateService :: SERVICE_ID ) ; $ reason = [ 'reasons' => [ 'category' => 'Examinee' , 'subCategory' => 'Navigation' ] , ] ; ... | Cancel delivery authorization request . |
49,521 | protected function getCategories ( ) { return array ( array ( 'id' => 'environment' , 'label' => __ ( 'Environment' ) , 'categories' => array ( array ( 'id' => 'comfort' , 'label' => __ ( 'Comfort' ) ) , array ( 'id' => 'disturbance' , 'label' => __ ( 'Disturbance' ) ) , array ( 'id' => 'noise' , 'label' => __ ( 'Noise... | Default category list . It can be overwritten by child classes . Pay attention to the keys! |
49,522 | public function index ( ) { $ this -> setData ( 'homeUrl' , $ this -> getServiceManager ( ) -> get ( DefaultUrlService :: SERVICE_ID ) -> getUrl ( 'ProctoringHome' ) ) ; $ this -> setData ( 'logout' , $ this -> getServiceManager ( ) -> get ( DefaultUrlService :: SERVICE_ID ) -> getUrl ( 'ProctoringLogout' ) ) ; $ this ... | Monitoring view of a selected delivery |
49,523 | public function deliveryExecutions ( ) { $ dataTable = new DeliveriesMonitorDatatable ( $ this -> getCurrentDelivery ( ) , $ this -> getRequest ( ) ) ; $ this -> getServiceManager ( ) -> propagate ( $ dataTable ) ; $ this -> returnJson ( $ dataTable ) ; } | Gets the list of current executions for a delivery |
49,524 | public function authoriseExecutions ( ) { $ deliveryExecution = $ this -> getRequestParameter ( 'execution' ) ; $ reason = $ this -> getRequestParameter ( 'reason' ) ; $ testCenter = $ this -> getRequestParameter ( 'testCenter' ) ; if ( ! is_array ( $ deliveryExecution ) ) { $ deliveryExecution = array ( $ deliveryExec... | Authorises a delivery execution |
49,525 | public function terminateExecutions ( ) { $ deliveryExecution = $ this -> getRequestParameter ( 'execution' ) ; $ reason = $ this -> getRequestParameter ( 'reason' ) ; if ( ! is_array ( $ deliveryExecution ) ) { $ deliveryExecution = array ( $ deliveryExecution ) ; } try { $ data = DeliveryHelper :: terminateExecutions... | Terminates delivery executions |
49,526 | public function onDeliveryCreated ( DeliveryCreatedEvent $ event ) { $ delivery = $ this -> getResource ( $ event -> getDeliveryUri ( ) ) ; $ proctoredByDefault = $ this -> isProctoredByDefault ( ) ; $ delivery -> editPropertyValues ( $ this -> getProperty ( ProctorService :: ACCESSIBLE_PROCTOR ) , ( $ proctoredByDefau... | Listen create event for delivery |
49,527 | public function onDeliveryUpdated ( DeliveryUpdatedEvent $ event ) { $ data = $ event -> jsonSerialize ( ) ; $ deliveryData = ! empty ( $ data [ 'data' ] ) ? $ data [ 'data' ] : [ ] ; $ delivery = $ this -> getResource ( $ event -> getDeliveryUri ( ) ) ; if ( isset ( $ deliveryData [ ProctorService :: ACCESSIBLE_PROCTO... | Listen update event for delivery |
49,528 | public function getData ( ) { $ awaiting = $ this -> getNumberOfAssessments ( DeliveryExecution :: STATE_AWAITING ) ; $ authorized = $ this -> getNumberOfAssessments ( DeliveryExecution :: STATE_AUTHORIZED ) ; $ paused = $ this -> getNumberOfAssessments ( DeliveryExecution :: STATE_PAUSED ) ; $ active = $ this -> getNu... | Return comprehensive activity monitoring data . |
49,529 | public function assessmentActivity ( ) { $ service = $ this -> getServiceLocator ( ) -> get ( ActivityMonitoringService :: SERVICE_ID ) ; $ this -> setData ( 'reason_categories' , DeliveryHelper :: getAllReasonsCategories ( ) ) ; $ config = [ ActivityMonitoringService :: OPTION_USER_ACTIVITY_WIDGETS => $ service -> get... | Show assessment activity dashboard |
49,530 | public function assessmentActivityData ( ) { $ service = $ this -> getServiceLocator ( ) -> get ( ActivityMonitoringService :: SERVICE_ID ) ; $ data = $ service -> getData ( ) ; $ this -> returnJson ( [ 'success' => true , 'data' => $ data ] ) ; } | Show assessment activity data as json |
49,531 | public function completedAssessmentsData ( ) { $ timePeriod = $ this -> getRequestParameter ( 'interval' ) ; $ eventLog = $ this -> getServiceLocator ( ) -> get ( \ oat \ taoEventLog \ model \ eventLog \ LoggerService :: SERVICE_ID ) ; $ tz = new \ DateTimeZone ( \ common_session_SessionManager :: getSession ( ) -> get... | Get completed assessments data |
49,532 | public function pauseActiveExecutions ( ) { if ( ! $ this -> isRequestPost ( ) ) { throw new \ common_exception_BadRequest ( 'Invalid request. Only POST method allowed.' ) ; } $ reason = $ this -> hasRequestParameter ( 'reason' ) ? $ this -> getRequestParameter ( 'reason' ) : [ 'reasons' => [ 'category' => 'Technical' ... | Action pauses all the active delivery executions |
49,533 | private static function createErrorMessage ( $ deliveryExecution , $ action ) { if ( $ deliveryExecution -> getState ( ) -> getUri ( ) === DeliveryExecution :: STATE_FINISHED ) { $ errorMsg = __ ( '%s could not be %s because it is finished. Please refresh your data.' , $ deliveryExecution -> getLabel ( ) , $ action ) ;... | Creates a standard error message with different actions |
49,534 | public static function getCurrentDeliveryExecutions ( core_kernel_classes_Resource $ delivery , core_kernel_classes_Resource $ testCenter , array $ options = array ( ) ) { $ deliveryService = ServiceManager :: getServiceManager ( ) -> get ( DeliveryMonitoringService :: SERVICE_ID ) ; return self :: adjustDeliveryExecut... | Gets the aggregated data for a filtered set of delivery executions of a given delivery This is performance critical would need to find a way to optimize to obtain such information |
49,535 | public static function pauseExecutions ( $ deliveryExecutions , $ reason = null ) { $ deliveryExecutionStateService = ServiceManager :: getServiceManager ( ) -> get ( DeliveryExecutionStateService :: SERVICE_ID ) ; $ result = [ 'processed' => [ ] , 'unprocessed' => [ ] ] ; foreach ( $ deliveryExecutions as $ deliveryEx... | Pauses a list of delivery executions |
49,536 | public static function adjustColumnName ( $ column ) { if ( isset ( self :: $ columnsMap [ $ column ] ) ) { $ column = self :: $ columnsMap [ $ column ] ; } return $ column ; } | Converts a frontend column name into database column name . Useful to translate the name of a column to sort . |
49,537 | private static function _getUserExtraFields ( ) { if ( ! self :: $ extraFields ) { $ proctoringExtension = \ common_ext_ExtensionsManager :: singleton ( ) -> getExtensionById ( 'taoProctoring' ) ; $ userExtraFields = $ proctoringExtension -> getConfig ( 'monitoringUserExtraFields' ) ; $ userExtraFieldsSettings = $ proc... | Get array of user specific extra fields to be displayed in the monitoring data table |
49,538 | public static function getExtraFields ( ) { return array_map ( function ( $ field ) { $ extra = [ 'id' => $ field [ 'id' ] , 'label' => $ field [ 'label' ] , 'filterable' => array_key_exists ( 'filterable' , $ field ) ? $ field [ 'filterable' ] : false , ] ; if ( array_key_exists ( 'columnPosition' , $ field ) ) { $ ex... | Return array of extra fields to be displayed in the monitoring data table |
49,539 | public static function getAllReasonsCategories ( $ hasAccessToReactivate = false ) { $ categoryService = ServiceManager :: getServiceManager ( ) -> get ( ReasonCategoryService :: SERVICE_ID ) ; $ response = array ( 'authorize' => array ( ) , 'pause' => $ categoryService -> getIrregularities ( ) , 'terminate' => $ categ... | Get the list of all available categories sorted by action names |
49,540 | public function getResponsibleService ( User $ user , $ deliveryId = null ) { if ( ! isset ( $ this -> service ) ) { foreach ( $ this -> getOption ( self :: SERVICE_HANDLERS ) as $ handler ) { if ( ! is_a ( $ handler , DelegatedServiceHandler :: class ) ) { throw new \ common_exception_NoImplementation ( 'Handler shoul... | Returns applicable service |
49,541 | protected function getTextConverterService ( ) { if ( ! $ this -> textConverterService ) { $ this -> textConverterService = ServiceManager :: getServiceManager ( ) -> get ( ProctoringTextConverter :: SERVICE_ID ) ; } return $ this -> textConverterService ; } | Get the TextConverterService |
49,542 | public function index ( ) { $ formContainer = new IrregularitiesExportForm ( $ this -> getRequestParameter ( 'uri' ) ) ; $ myForm = $ formContainer -> getForm ( ) ; if ( $ myForm -> isValid ( ) && $ myForm -> isSubmited ( ) ) { $ delivery = $ this -> getResource ( \ tao_helpers_Uri :: decode ( $ this -> getRequestParam... | Displays the form to export irregularities and handles it after submit |
49,543 | protected function getLayout ( ) { $ this -> setData ( 'homeUrl' , $ this -> getServiceManager ( ) -> get ( DefaultUrlService :: SERVICE_ID ) -> getUrl ( 'ProctoringHome' ) ) ; $ this -> setData ( 'logout' , $ this -> getServiceManager ( ) -> get ( DefaultUrlService :: SERVICE_ID ) -> getUrl ( 'ProctoringLogout' ) ) ; ... | Gets the path to the layout |
49,544 | protected function getRequestOptions ( array $ defaults = [ ] ) { $ defaults = array_merge ( $ this -> getDefaultOptions ( ) , $ defaults ) ; $ page = $ this -> hasRequestParameter ( 'page' ) ? $ this -> getRequestParameter ( 'page' ) : $ defaults [ 'page' ] ; $ rows = $ this -> hasRequestParameter ( 'rows' ) ? $ this ... | Gets the data table request options |
49,545 | public function terminateExecution ( DeliveryExecution $ deliveryExecution , $ reason = null ) { $ executionState = $ deliveryExecution -> getState ( ) -> getUri ( ) ; $ result = false ; if ( ProctoredDeliveryExecution :: STATE_TERMINATED !== $ executionState && ProctoredDeliveryExecution :: STATE_FINISHED !== $ execut... | Terminates a delivery execution |
49,546 | public function pause ( DeliveryExecution $ deliveryExecution , $ reason = null ) { $ executionState = $ deliveryExecution -> getState ( ) -> getUri ( ) ; $ result = false ; if ( ProctoredDeliveryExecution :: STATE_TERMINATED !== $ executionState && ProctoredDeliveryExecution :: STATE_FINISHED !== $ executionState ) { ... | Pauses a delivery execution |
49,547 | public function reportExecution ( DeliveryExecution $ deliveryExecution , $ reason ) { $ deliveryLog = $ this -> getDeliveryLogService ( ) ; $ data = [ 'reason' => $ reason , 'timestamp' => microtime ( true ) , 'itemId' => $ this -> getCurrentItemId ( $ deliveryExecution ) , 'context' => $ this -> getContext ( $ delive... | Report irregularity to a delivery execution |
49,548 | protected function canBeAuthorised ( DeliveryExecution $ deliveryExecution ) { $ result = false ; $ user = \ common_session_SessionManager :: getSession ( ) -> getUser ( ) ; $ stateUri = $ deliveryExecution -> getState ( ) -> getUri ( ) ; if ( $ stateUri === ProctoredDeliveryExecution :: STATE_AWAITING ) { $ result = t... | Whether delivery execution can be moved to authorised state . |
49,549 | protected function getCurrentItemId ( DeliveryExecution $ deliveryExecution ) { $ result = null ; $ session = $ this -> getTestSessionService ( ) -> getTestSession ( $ deliveryExecution ) ; if ( $ session ) { $ item = $ session -> getCurrentAssessmentItemRef ( ) ; if ( $ item ) { $ result = $ item -> getIdentifier ( ) ... | Get identifier of current item . |
49,550 | public function catchSessionPause ( TestExecutionPausedEvent $ event ) { $ deliveryExecution = ServiceProxy :: singleton ( ) -> getDeliveryExecution ( $ event -> getTestExecutionId ( ) ) ; $ requestParams = \ Context :: getInstance ( ) -> getRequest ( ) -> getParameters ( ) ; $ reason = null ; if ( isset ( $ requestPar... | Pause delivery execution if test session was paused . |
49,551 | public function isExpired ( DeliveryExecution $ deliveryExecution ) { $ result = false ; $ executionState = $ deliveryExecution -> getState ( ) -> getUri ( ) ; $ lastTestTakersEvent = $ this -> getLastTestTakersEvent ( $ deliveryExecution ) ; if ( in_array ( $ executionState , [ DeliveryExecutionState :: STATE_AWAITING... | Checks if delivery execution was abandoned after authorization |
49,552 | public function import ( $ filePath , $ extraProperties = [ ] , $ options = [ ] ) { $ extraProperties [ UserRdf :: PROPERTY_ROLES ] = ProctorService :: ROLE_PROCTOR ; $ extraProperties [ 'roles' ] = ProctorService :: ROLE_PROCTOR ; return parent :: import ( $ filePath , $ extraProperties , $ options ) ; } | Add test taker role to user to import |
49,553 | public function getResultsData ( DeliveryExecutionInterface $ deliveryExecution ) { $ result = [ ] ; $ resultService = $ this -> getResultService ( $ deliveryExecution -> getDelivery ( ) ) ; $ itemsData = $ resultService -> getItemVariableDataFromDeliveryResult ( $ deliveryExecution -> getIdentifier ( ) , 'lastSubmitte... | Get session results |
49,554 | public function getDeliveryData ( DeliveryExecutionInterface $ deliveryExecution ) { $ result = [ 'start' => $ deliveryExecution -> getStartTime ( ) , 'end' => $ deliveryExecution -> getFinishTime ( ) , 'label' => $ deliveryExecution -> getLabel ( ) ] ; return $ result ; } | Get delivery execution data |
49,555 | protected function getResultService ( \ core_kernel_classes_Resource $ delivery ) { $ ResultServiceWrapper = $ this -> getServiceManager ( ) -> get ( ResultServiceWrapper :: SERVICE_ID ) ; $ resultsService = $ ResultServiceWrapper -> getService ( ) ; $ implementation = $ resultsService -> getReadableImplementation ( $ ... | Get result service instance . |
49,556 | public function getTextRegistry ( ) { return array ( 'Assign administrator' => __ ( 'Assign administrator' ) , 'Assign proctors' => __ ( 'Assign proctors' ) , 'Please select one or more test site to manage proctors' => __ ( 'Please select one or more test site to manage proctors' ) , 'Create Proctor' => __ ( 'Create Pr... | Return the translation of key |
49,557 | protected function action ( $ deliveryExecution , $ executionId , $ isEndDate = false ) { $ this -> getDeliveryStateService ( ) -> terminateExecution ( $ deliveryExecution , [ 'reasons' => [ 'category' => 'Technical' ] , 'comment' => $ isEndDate ? 'The assessment was automatically terminated because end time expired.' ... | Terminate delivery execution |
49,558 | protected function actionBasedOnEndDate ( DateTimeImmutable $ endDateTime , $ executionId ) { try { $ deliveryExecution = $ this -> getServiceProxy ( ) -> getDeliveryExecution ( $ executionId ) ; $ lastInteraction = $ this -> getLastInteractionDateTime ( $ deliveryExecution ) ; if ( $ lastInteraction === null ) { $ thi... | Run an action if the end date matches the condition |
49,559 | protected function actionBasedOnTTL ( $ executionId ) { try { $ deliveryExecution = $ this -> getServiceProxy ( ) -> getDeliveryExecution ( $ executionId ) ; $ lastInteraction = $ this -> getLastInteractionDateTime ( $ deliveryExecution ) ; if ( $ lastInteraction === null ) { $ this -> report -> add ( Report :: createF... | Run an action if TTL matches the condition |
49,560 | private function getDeliveryEndDateProperty ( ) { $ this -> propertyDeliveryEndDate = $ this -> propertyDeliveryEndDate ? : $ this -> getProperty ( DeliveryAssemblyService :: PROPERTY_END ) ; return $ this -> propertyDeliveryEndDate ; } | Caching property to avoid multiple generations |
49,561 | protected function breadcrumbsIndex ( $ route , $ parsedRoute ) { $ urlContext = [ ] ; if ( isset ( $ parsedRoute [ 'params' ] ) ) { if ( isset ( $ parsedRoute [ 'params' ] [ 'session' ] ) ) { $ session = $ parsedRoute [ 'params' ] [ 'session' ] ; $ urlContext [ 'session' ] = is_array ( $ session ) ? implode ( ',' , $ ... | Gets the breadcrumbs for the sessionHistory page |
49,562 | protected function isExpired ( DeliveryExecution $ deliveryExecution ) { $ result = false ; $ executionState = $ deliveryExecution -> getState ( ) -> getUri ( ) ; if ( in_array ( $ executionState , [ DeliveryExecutionState :: STATE_PAUSED , DeliveryExecutionState :: STATE_ACTIVE , ] ) ) { $ deliveryExecutionStateServic... | Checks if delivery execution was expired after pausing |
49,563 | protected function getLastPause ( DeliveryExecution $ deliveryExecution ) { $ deliveryLogService = $ this -> getServiceLocator ( ) -> get ( DeliveryLog :: SERVICE_ID ) ; $ pauses = array_reverse ( $ deliveryLogService -> get ( $ deliveryExecution -> getIdentifier ( ) , 'TEST_PAUSE' ) ) ; return isset ( $ pauses [ 0 ] )... | Get time of last pause |
49,564 | public function getDeliveryTimer ( $ deliveryExecution ) { if ( is_string ( $ deliveryExecution ) ) { $ deliveryExecution = $ this -> getDeliveryExecutionById ( $ deliveryExecution ) ; } $ testSessionService = $ this -> getServiceLocator ( ) -> get ( TestSessionService :: SERVICE_ID ) ; $ testSession = $ testSessionSer... | Gets the delivery time counter |
49,565 | public function getTimeLimits ( $ testSession ) { $ seconds = null ; if ( $ item = $ testSession -> getCurrentAssessmentItemRef ( ) ) { $ seconds = $ this -> getPartTimeLimits ( $ item ) ; } if ( ! $ seconds && $ section = $ testSession -> getCurrentAssessmentSection ( ) ) { $ seconds = $ this -> getPartTimeLimits ( $ ... | Gets the actual time limits for a test session |
49,566 | public function getTokenAndUser ( ) { $ adapter = $ this -> getAdapter ( ) ; $ isOAuth2 = $ this -> version === self :: OAUTH_VERSION_2 ; $ token = $ adapter -> getAccessToken ( $ this -> provider ) ; $ user = $ this -> provider -> getUser ( $ token ) ; return [ 'adapterKey' => $ this -> provider -> getProviderName ( )... | To compatible with old version |
49,567 | public function debug ( $ logPath ) { $ adapter = $ this -> getAdapter ( ) ; $ adapter -> getEmitter ( ) -> attach ( new LogSubscriber ( $ logPath , Formatter :: DEBUG ) ) ; return $ this ; } | Enable debug mode Guzzle will print all request and response on screen |
49,568 | public function createTraverser ( ContextInterface $ context ) { $ traverser = new PhpParser \ NodeTraverser ; $ stack = new ContextStack ( $ context ) ; $ traverser -> addVisitor ( new NodeVisitors \ ClassVisitor ( $ stack , $ context ) ) ; $ traverser -> addVisitor ( new NodeVisitors \ InterfaceVisitor ( $ stack , $ ... | Create a node traverser object |
49,569 | public function generate ( ) { $ startTime = microtime ( true ) ; if ( ! is_dir ( $ this -> reportDir ) ) { echo "Creating new directory {$this->reportDir}... " ; mkdir ( $ this -> reportDir ) ; echo "OK\n" ; } echo "Generating HTML report to {$this->reportDir} ... " ; $ this -> iterate ( $ this -> report ) ; $ totalTi... | Generate HTML report |
49,570 | protected function iterate ( ContextInterface $ root ) { $ this -> generateIndexFile ( $ root ) ; foreach ( $ root -> getChildren ( ) as $ item ) { if ( $ item instanceof FileContext ) { $ this -> generateFile ( $ item ) ; } elseif ( $ item instanceof DirectoryContext ) { $ this -> iterate ( $ item ) ; } } } | Iterate the report |
49,571 | public function scan ( FileContext $ file ) { $ filename = $ file -> getName ( ) ; $ code = file_get_contents ( $ filename ) ; try { $ stmts = $ this -> parser -> parse ( $ code ) ; $ traverser = $ this -> factory -> createTraverser ( $ file ) ; $ traverser -> traverse ( $ stmts ) ; } catch ( PhpParser \ Error $ e ) { ... | Scan a php file |
49,572 | protected function addChild ( ContextInterface $ child ) { $ length = count ( $ this -> stack ) ; $ this -> stack [ $ length - 1 ] -> addChild ( $ child ) ; } | Add a child to current context |
49,573 | public function addIssue ( IssueInterface $ issue ) { $ length = count ( $ this -> stack ) ; $ this -> stack [ $ length - 1 ] -> addIssue ( $ issue ) ; } | Add an issue to current context |
49,574 | public function findContextOfType ( ContextSpecificationInterface $ filter ) { foreach ( $ this -> stack as $ context ) { if ( $ filter -> isSatisfiedBy ( $ context ) ) { return $ context ; } } return false ; } | Find context in stack matching specification |
49,575 | public function isAllowedOnGlobalSpace ( PhpParser \ Node $ node ) { return ( $ node instanceof Stmt \ Class_ || $ node instanceof Stmt \ Function_ || $ node instanceof Stmt \ Trait_ || ( $ node instanceof Stmt \ UseUse || $ node instanceof Stmt \ Use_ ) || ( $ node instanceof Stmt \ Namespace_ || $ node instanceof Nod... | Is node allowed on global space? |
49,576 | public function isClassSafeForInstantiation ( $ className ) { $ className = strtolower ( $ className ) ; if ( FALSE !== strpos ( $ className , '\\' ) ) { return false ; } if ( $ className === 'parent' ) { return true ; } if ( in_array ( $ className , $ this -> unsafeForInstantiation ) ) { return false ; } elseif ( in_a... | Is this a php internal class? |
49,577 | public function generate ( ) { $ startTime = microtime ( true ) ; if ( ! is_dir ( $ this -> reportDir ) ) { echo "Creating new directory {$this->reportDir}... " ; mkdir ( $ this -> reportDir ) ; echo "OK\n" ; } echo "Generating CSV report to {$this->reportDir} ... " ; $ this -> generateCsvForDirectory ( $ this -> repor... | Generate CSV report |
49,578 | public function getChildren ( ContextSpecificationInterface $ filter = null ) { if ( $ filter === null ) { return $ this -> children ; } else { return array_filter ( $ this -> children , [ $ filter , 'isSatisfiedBy' ] ) ; } } | Filter and list children |
49,579 | public function getChildrenRecursively ( ContextSpecificationInterface $ filter = null ) { $ list = $ this -> getChildren ( $ filter ) ; foreach ( $ this -> getChildren ( ) as $ child ) { if ( $ child -> hasChildren ( ) ) { $ list = array_merge ( $ list , $ child -> getChildrenRecursively ( $ filter ) ) ; } } return $ ... | Return all children recursively |
49,580 | public function hasIssues ( $ recursive = false , ContextSpecificationInterface $ filter = null ) { if ( $ recursive === true ) { foreach ( $ this -> getChildrenRecursively ( $ filter ) as $ child ) { if ( $ child -> hasIssues ( false , $ filter ) ) { return true ; } } } return ( count ( $ this -> issues ) > 0 ) ; } | Are there any issues? |
49,581 | public function getIssues ( $ recursive = false , ContextSpecificationInterface $ filter = null ) { $ list = $ this -> issues ; if ( $ recursive === true ) { foreach ( $ this -> getChildrenRecursively ( $ filter ) as $ child ) { foreach ( $ child -> getIssues ( false , $ filter ) as $ issue ) { $ list [ ] = $ issue ; }... | Return all issues |
49,582 | public function getIssuesCount ( ContextSpecificationInterface $ filter = null ) { $ count = count ( $ this -> issues ) ; foreach ( $ this -> getChildren ( $ filter ) as $ child ) { $ count += $ child -> getIssuesCount ( $ filter ) ; } return $ count ; } | Counts all issues recursively |
49,583 | public function isValid ( $ email ) { if ( ! $ this -> isEmail ( $ email ) ) { return false ; } if ( $ this -> isExample ( $ email ) ) { return false ; } if ( $ this -> isDisposable ( $ email ) ) { return false ; } if ( $ this -> isRole ( $ email ) ) { return false ; } if ( ! $ this -> hasMx ( $ email ) ) { return fals... | Validate an email address using ALL the functions of this library . |
49,584 | public function isSendable ( $ email ) { if ( ! $ this -> isEmail ( $ email ) ) { return false ; } if ( $ this -> isExample ( $ email ) ) { return false ; } if ( ! $ this -> hasMx ( $ email ) ) { return false ; } return true ; } | Validate an email address using isEmail isExample and hasMx . |
49,585 | public function isDisposable ( $ email ) { if ( ! $ this -> isEmail ( $ email ) ) { return null ; } $ hostname = $ this -> hostnameFromEmail ( $ email ) ; if ( $ hostname ) { if ( is_null ( $ this -> disposable ) ) { $ data = new \ EmailData \ Data ( ) ; $ file = $ data -> getPathToDataFile ( 'php' ) ; $ this -> dispos... | Detected disposable email domains |
49,586 | public function isRole ( $ email ) { if ( ! $ this -> isEmail ( $ email ) ) { return null ; } $ user = $ this -> userFromEmail ( $ email ) ; if ( $ user ) { if ( is_null ( $ this -> role ) ) { $ this -> role = include ( 'data/role.php' ) ; } if ( in_array ( $ user , $ this -> role ) ) { return true ; } return false ; }... | Detected role based email addresses |
49,587 | public function hasMx ( $ email ) { if ( ! $ this -> isEmail ( $ email ) ) { return null ; } $ hostname = $ this -> hostnameFromEmail ( $ email ) ; if ( $ hostname ) { return checkdnsrr ( $ hostname , 'MX' ) ; } return null ; } | Test email address for MX records |
49,588 | private function userFromEmail ( $ email ) { $ parts = explode ( '@' , $ email ) ; if ( count ( $ parts ) == 2 ) { return strtolower ( $ parts [ 0 ] ) ; } return null ; } | Get the user form an email address |
49,589 | private function hostnameFromEmail ( $ email ) { $ parts = explode ( '@' , $ email ) ; if ( count ( $ parts ) == 2 ) { return strtolower ( $ parts [ 1 ] ) ; } return null ; } | Get the hostname form an email address |
49,590 | public function isDirExcluded ( $ path ) { foreach ( $ this -> excludedDirs as $ needle ) { if ( empty ( $ needle ) ) { continue ; } $ needleLen = strlen ( $ needle ) ; $ pathChunk = substr ( $ path , - $ needleLen , $ needleLen ) ; if ( $ pathChunk == $ needle ) { return true ; } } return false ; } | Is this path excluded from the scan? |
49,591 | public static function current ( ) { $ token = Request :: header ( 'X-Auth-Token' , Input :: get ( 'X-Auth-Token' ) ) ; if ( static :: $ _current === null && $ token ) { static :: $ _current = static :: where ( 'token' , $ token ) -> where ( 'expire_at' , '>=' , Carbon :: now ( ) ) -> first ( ) ; } return static :: $ _... | current - get current active AuthToken instance |
49,592 | public function forgotPassword ( ) { $ data = $ this -> getData ( ) ; $ auth = Auth :: where ( 'email' , $ data [ 'email' ] ) -> first ( ) ; if ( ! $ auth ) { throw new Exceptions \ NotFoundException ( "invalid_user" ) ; } if ( ! isset ( $ data [ 'subject' ] ) ) { $ data [ 'subject' ] = 'Forgot your password?' ; } $ bo... | Trigger forgot password email |
49,593 | public function resetPassword ( ) { $ data = $ this -> getData ( ) ; if ( ! isset ( $ data [ 'token' ] ) === 0 ) { throw new Exceptions \ BadRequestException ( "you must provide a 'token'." ) ; } if ( ! isset ( $ data [ 'password' ] ) || strlen ( $ data [ 'password' ] ) === 0 ) { throw new Exceptions \ BadRequestExcept... | Reset auth password |
49,594 | public function toArray ( ) { $ array = parent :: toArray ( ) ; if ( isset ( $ this -> schema [ 'attributes' ] ) ) { foreach ( $ this -> schema [ 'attributes' ] as $ attribute ) { @ settype ( $ array [ $ attribute [ 'name' ] ] , $ attribute [ 'type' ] ) ; } } $ observer = static :: getObserver ( $ this -> getTable ( ) ... | toArray . Modules may define a custom toArray method . |
49,595 | public static function message ( $ template_body = null , $ options = array ( ) ) { $ message = new Message ( ) ; MailHelper :: setMessage ( $ message ) ; if ( $ template_body ) { $ template = Module :: template ( $ template_body ) ; $ message -> body ( $ template -> compile ( $ options ) ) ; } return $ message ; } | Create a new Message . |
49,596 | public static function attachment ( $ path_or_data = null , $ filename = null , $ contentType = null ) { $ from_path = realpath ( $ path_or_data ) ; if ( $ from_path ) { $ attachment = Swift_Attachment :: fromPath ( $ path_or_data , $ contentType ) ; $ attachment -> setFilename ( $ filename ) ; } else { $ attachment = ... | Create a new Attachment . |
49,597 | public function open ( $ savePath , $ sessionName ) { try { $ this -> _tableRestProxy -> getTable ( $ this -> _sessionContainer ) ; } catch ( ServiceException $ e ) { $ this -> _tableRestProxy -> createTable ( $ this -> _sessionContainer ) ; } return TRUE ; } | Callback function for session handler . It s invoked while the session is being opened . |
49,598 | public function read ( $ sessionId ) { try { $ result = $ this -> _tableRestProxy -> getEntity ( $ this -> _sessionContainer , $ this -> _sessionContainerPartition , $ sessionId ) ; $ entity = $ result -> getEntity ( ) ; return unserialize ( base64_decode ( $ entity -> getPropertyValue ( 'data' ) ) ) ; } catch ( Servic... | Callback function for session handler . It s invoked while the session data is being read . |
49,599 | public function write ( $ sessionId , $ sessionData ) { $ serializedData = base64_encode ( serialize ( $ sessionData ) ) ; try { $ result = $ this -> _tableRestProxy -> getEntity ( $ this -> _sessionContainer , $ this -> _sessionContainerPartition , $ sessionId ) ; $ entity = $ result -> getEntity ( ) ; $ entity -> set... | Callback function for session handler . It s invoked while the session data is being written . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.