idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
229,900 | protected function insertCMSNavItem ( CMSNavItem $ cms_nav_item , Plugin $ plugin ) { $ cms_nav_item -> PluginID = $ plugin -> PluginID ; $ cms_nav_item -> ModifiedDate = $ plugin -> ModifiedDate ; try { if ( ! $ this -> CMSNavItemService -> slugExists ( $ cms_nav_item -> Slug ) ) { $ this -> CMSNavItemService -> add (... | Inserts the specified CMS Nav Item |
229,901 | protected function processElements ( Plugin $ plugin , & $ log = '' , $ xml = false ) { if ( ! $ xml ) $ xml = $ this -> loadXML ( $ plugin -> Path ) ; if ( ! $ xml ) throw new Exception ( 'Missing plugin.xml file for plugin [' . $ plugin -> Slug . ']' ) ; $ processedSlugs = array ( ) ; $ elements = $ xml -> elements ;... | Add all the elements defined by this plugin |
229,902 | public function processInstallScript ( Plugin $ plugin , & $ log ) { $ script = $ plugin -> Path . '/install.php' ; if ( file_exists ( $ script ) ) { include_once $ script ; } } | Runs the install script from the plugin |
229,903 | public function processUpgradeScript ( Plugin $ plugin , & $ log , $ installedVersion ) { $ script = $ plugin -> Path . '/upgrade.php' ; if ( file_exists ( $ script ) ) include_once $ script ; } | Runs the upgrade script for the plugin |
229,904 | public function autoupgradePlugin ( Plugin $ plugin ) { if ( empty ( $ plugin ) || ! $ plugin -> isInstalled ( ) || ! $ plugin -> isEnabled ( ) ) return ; $ xml = $ this -> loadXML ( $ plugin -> Path ) ; if ( empty ( $ xml ) ) return ; if ( $ plugin -> Version != ( $ newversion = strval ( $ xml -> info -> version ) ) )... | Reruns the aspect installation to upgrade the plugin if needed |
229,905 | public function upgradePlugin ( $ pluginSlug , $ pluginPath , Errors & $ errors ) { $ log = "" ; $ plugin = $ this -> PluginService -> getBySlug ( $ pluginSlug ) ; $ existingPriority = $ plugin -> Priority ; if ( empty ( $ plugin ) || ! $ plugin -> isInstalled ( ) ) { $ log .= "Plugin is not installed." ; return array ... | Force an upgrade of the specified plugin |
229,906 | public function uninstallPlugin ( $ pluginSlug , Errors $ errors , $ purge = false ) { $ log = "" ; $ plugin = $ this -> PluginService -> getBySlug ( $ pluginSlug ) ; if ( empty ( $ plugin ) || ! $ plugin -> isInstalled ( ) ) { $ log .= "Plugin not installed." ; return array ( $ log , 'fail' ) ; } $ pluginPath = $ plug... | Removes the specified plugin |
229,907 | protected function uninstallAspects ( Plugin $ plugin ) { $ dto = new DTO ( array ( 'PluginID' => $ plugin -> PluginID ) ) ; $ aspects = $ this -> AspectService -> findAll ( $ dto ) -> getResults ( ) ; foreach ( $ aspects as $ aspect ) { $ this -> AspectService -> delete ( $ aspect -> Slug ) ; } } | Removes all aspects that were installed by this plugin |
229,908 | protected function uninstallCMSNavItems ( Plugin $ plugin ) { $ dto = new DTO ( array ( 'PluginID' => $ plugin -> PluginID ) ) ; $ navitems = $ this -> CMSNavItemService -> findAll ( $ dto ) -> getResults ( ) ; rsort ( $ navitems ) ; foreach ( $ navitems as $ navitem ) { $ this -> CMSNavItemService -> delete ( $ navite... | Removes all cms nav items that were installed by this plugin |
229,909 | private function attachListeners ( HasEmitterInterface $ object , array $ listeners ) { $ emitter = $ object -> getEmitter ( ) ; foreach ( $ listeners as $ el ) { if ( $ el [ 'once' ] ) { $ emitter -> once ( $ el [ 'name' ] , $ el [ 'fn' ] , $ el [ 'priority' ] ) ; } else { $ emitter -> on ( $ el [ 'name' ] , $ el [ 'f... | Attaches event listeners and properly sets their priorities and whether or not they are are only executed once . |
229,910 | private function buildListener ( $ name , $ data , & $ listeners ) { static $ defaults = [ 'priority' => 0 , 'once' => false ] ; if ( is_callable ( $ data ) ) { $ data = [ 'fn' => $ data ] ; } if ( isset ( $ data [ 'fn' ] ) ) { $ data [ 'name' ] = $ name ; $ listeners [ ] = $ data + $ defaults ; } elseif ( is_array ( $... | Creates a complete event listener definition from the provided array of listener data . Also works recursively if more than one listeners are contained in the provided array . |
229,911 | public function validTimeStr ( $ time ) { if ( $ time === '0000-00-00 00:00:00' ) { return true ; } if ( $ this -> fitNonExistingDates && $ this -> isNonExistingTimeString ( $ time ) ) { $ time = $ this -> getPossibleDateString ( $ time ) ; } return ( is_string ( $ time ) && strlen ( $ time ) == 19 && $ time == date ( ... | validate an string ... only valid datestring will pass |
229,912 | public function setData ( $ data ) { if ( is_array ( $ data ) ) { $ this -> data = $ data ; } $ args = func_get_args ( ) ; $ this -> data [ $ args [ 0 ] ] = $ args [ 1 ] ; return $ this ; } | Sets form data |
229,913 | public function setHolders ( $ holders ) { if ( is_array ( $ holders ) ) { $ this -> holders = $ holders ; } $ args = func_get_args ( ) ; $ this -> holders [ $ args [ 0 ] ] = $ args [ 1 ] ; return $ this ; } | Sets place holders |
229,914 | public function show ( array $ fields ) { $ this -> show = array ( ) ; foreach ( $ fields as $ field ) { $ this -> show [ $ field ] = true ; } return $ this ; } | Shows only the specified in the order specified |
229,915 | public function register ( $ alias , \ Closure $ closure ) { if ( ! is_string ( $ alias ) ) throw new Exception ( 'Application::register() requires a string as the first parameter.' ) ; $ this -> registered [ $ alias ] = $ closure ; return true ; } | Registers a alias and Closure pair in the IoC container . |
229,916 | public function get ( $ alias ) { if ( ! isset ( $ this -> registered [ $ alias ] ) ) return false ; if ( isset ( $ this -> instance [ $ alias ] ) && is_object ( $ this -> instance [ $ alias ] ) ) return $ this -> instance [ $ alias ] ; $ this -> instance [ $ alias ] = $ this -> registered [ $ alias ] ( $ this ) ; if (... | Returns the instance associated with the supplied alias . |
229,917 | public function getNew ( $ alias ) { if ( ! isset ( $ this -> registered [ $ alias ] ) ) return false ; $ object = $ this -> registered [ $ alias ] ( $ this ) ; if ( ! is_object ( $ object ) ) throw new Exception ( 'The alias "' . $ alias . '" does not return an object.' ) ; return $ object ; } | Returns a new instance associated with the supplies alias . |
229,918 | public function validateUserPassword ( $ attributes , $ params ) { $ this -> _user = Users :: model ( ) -> findByPk ( Yii :: app ( ) -> user -> id ) ; if ( $ this -> _user == NULL ) { $ this -> addError ( 'password' , Yii :: t ( 'HybridAuth.main' , 'Unable to identify user.' ) ) ; return false ; } $ hash = Users :: mod... | Ensures that the password entered matches the one provided during registration |
229,919 | public function save ( ) { if ( ! $ this -> validate ( ) ) return false ; $ meta = new UserMetadata ; $ meta -> attributes = array ( 'user_id' => $ this -> _user -> id , 'key' => $ this -> provider . 'Provider' , 'value' => $ this -> adapter -> identifier ) ; return $ meta -> save ( ) ; } | Bind s the user identity to the mdoel |
229,920 | public function hydrate ( $ puppetModules , $ revision ) { if ( $ revision -> hasGroups ( ) ) { foreach ( $ revision -> getGroups ( ) as $ group ) { $ this -> groupHydrator -> hydrate ( $ puppetModules , $ group ) ; } } } | Hydrate revision with the provided puppet modules data . |
229,921 | protected function loadBuffer ( ) { $ this -> buffer = '' ; if ( $ this -> finished ) { return ; } while ( ! $ this -> stream -> eof ( ) && strlen ( $ this -> buffer ) < $ this -> chunkSize ) { $ this -> buffer .= $ this -> stream -> read ( $ this -> chunkSize - strlen ( $ this -> buffer ) ) ; } if ( $ this -> buffer =... | Read data from the underlying input stream into the read buffer . |
229,922 | final public function getMessage ( $ parsed = true ) { return ( $ parsed ) ? $ this -> parseMessages ( $ this -> messages ) : $ this -> messages ; } | Fetches the flash message |
229,923 | final public function getSuccessMessage ( $ parsed = true ) { return ( $ parsed ) ? $ this -> parseMessages ( $ this -> successMessages ) : $ this -> successMessages ; } | Fetches the flash success message |
229,924 | final public function getErrorMessage ( $ parsed = true ) { return ( $ parsed ) ? $ this -> parseMessages ( $ this -> errorMessages ) : $ this -> errorMessages ; } | Fetches the flash error message |
229,925 | public function process ( Request $ request , Result $ result ) { $ this -> setRequest ( $ request ) ; $ this -> setResult ( $ result ) ; $ this -> respond ( ) ; } | Implement the Processor interface . |
229,926 | public function setResponseCode ( int $ code ) { if ( $ code < 100 || $ code > 599 ) { $ err = new \ InvalidArgumentException ( "Attempting to set status code to $code" ) ; self :: $ logger -> critical ( "Invalid status {0}: {1}" , [ $ code , $ err ] ) ; $ this -> response_code = 500 ; } else { $ this -> response_code ... | Set the HTTP Response code |
229,927 | public function endAllOutputBuffers ( $ lvl = 0 ) { $ ob_cnt = 0 ; while ( ob_get_level ( ) > $ lvl ) { ++ $ ob_cnt ; $ contents = ob_get_contents ( ) ; ob_end_clean ( ) ; if ( self :: $ logger instanceof \ Psr \ Log \ NullLogger ) continue ; $ lines = explode ( "\n" , $ contents ) ; foreach ( $ lines as $ n => $ line ... | Close all active output buffers and log their contents |
229,928 | public function respond ( ) { if ( null === $ this -> result ) { $ this -> result = new Result ; $ this -> result -> setResponse ( new Error ( 500 , "No output produced" ) ) ; } $ this -> endAllOutputBuffers ( $ this -> target_ob_level ) ; $ response = $ this -> result -> getResponse ( ) ; $ mime = $ response -> getMim... | Prepare the output before sending it run hooks collect headers and finally call doRespond which produces the output . |
229,929 | protected function doOutput ( string $ mime ) { http_response_code ( $ this -> response_code ) ; if ( ! headers_sent ( ) ) { foreach ( $ this -> headers as $ name => $ value ) header ( $ name . ': ' . $ value ) ; foreach ( $ this -> cookies as $ cookie ) { setcookie ( $ cookie -> getName ( ) , $ cookie -> getValue ( ) ... | This method sends data to the client after all preparational work has been done . |
229,930 | public function namedForm ( $ name , $ data = null , array $ options = array ( ) , $ type = null ) { return $ this [ 'form.factory' ] -> createNamedBuilder ( $ name , $ type ? : FormType :: class , $ data , $ options ) ; } | Creates and returns a named form builder instance . |
229,931 | private function getExportCommand ( array $ parameter , $ file , $ hidePassword = false ) { $ username = $ parameter [ 'username' ] ; $ password = $ parameter [ 'password' ] ; $ database = $ parameter [ 'database' ] ; $ host = $ parameter [ 'host' ] ; $ port = $ parameter [ 'port' ] ; return sprintf ( 'mysqldump -u%s%s... | Returns command to export database . |
229,932 | private function getImportCommand ( array $ parameter , $ file , $ hidePassword = false ) { $ username = $ parameter [ 'username' ] ; $ password = $ parameter [ 'password' ] ; $ database = $ parameter [ 'database' ] ; $ host = $ parameter [ 'host' ] ; $ port = $ parameter [ 'port' ] ; return sprintf ( 'mysql -u%s%s%s%s... | Returns command to import database . |
229,933 | public function setProperties ( array $ properties ) { if ( ! isset ( $ properties [ self :: DATA_PROPERTY_REQUIRED ] ) ) { $ properties [ self :: DATA_PROPERTY_REQUIRED ] = array ( ) ; } if ( ! isset ( $ properties [ self :: DATA_PROPERTY_DEFAULTS ] ) ) { $ properties [ self :: DATA_PROPERTY_DEFAULTS ] = array ( ) ; }... | Set properties for data |
229,934 | protected function configureDefaultData ( ) { if ( isset ( $ this -> properties [ 'defaults' ] ) && is_array ( $ this -> properties [ 'defaults' ] ) ) { foreach ( $ this -> properties [ 'defaults' ] as $ data => $ value ) { if ( ! isset ( $ this -> data [ $ data ] ) ) { $ this -> data [ $ data ] = $ value ; } } } retur... | Configures Data with defaults based on properties array |
229,935 | protected function verifyRequiredData ( ) { $ errors = array ( 'missing' => array ( ) , 'invalid' => array ( ) ) ; $ error = FALSE ; if ( ! empty ( $ this -> properties [ 'required' ] ) ) { foreach ( $ this -> properties [ 'required' ] as $ property => $ type ) { if ( ! isset ( $ this -> data [ $ property ] ) ) { $ err... | Validate Required Data for the Endpoint |
229,936 | public function preCacheTranslateObject ( ModelObject $ obj ) { $ aspectSlugs = $ obj -> getAspectSlugs ( ) ; $ schema = new NodeSchema ( ) ; if ( ! empty ( $ aspectSlugs ) ) { $ aspects = $ this -> AspectDAO -> multiGetBySlug ( $ aspectSlugs ) ; $ newAspects = array ( ) ; foreach ( $ aspects as $ aspect ) { $ aspectSc... | Sets the schema for the element |
229,937 | public function findAll ( DTO $ dto ) { if ( $ dto -> hasParameter ( $ this -> getModel ( ) -> getPrimaryKey ( ) ) || $ dto -> hasParameter ( 'Slug' ) || $ dto -> hasParameter ( 'PluginID' ) || $ dto -> getLimit ( ) != null || $ dto -> getOffset ( ) != null || $ dto -> getOrderBys ( ) != null ) { $ sd = __CLASS__ . ( s... | Finds matching elements |
229,938 | public function cd ( $ directory = null ) { if ( \ ftp_chdir ( $ this -> _stream , $ directory ) ) { return true ; } $ this -> error = "Failed to change directory to \"{$directory}\"" ; return false ; } | Change current directory on FTP server |
229,939 | public function delete ( $ remote_file = null ) { if ( \ ftp_delete ( $ this -> _stream , $ remote_file ) ) { return true ; } $ this -> error = 'Failed to delete file "' . $ remote_file . '"' ; return false ; } | Delete file on FTP server |
229,940 | public function mkdir ( $ directory = null ) { if ( \ ftp_mkdir ( $ this -> _stream , $ directory ) ) { return true ; } $ this -> error = 'Failed to create directory "' . $ directory . '"' ; return false ; } | Create directory on FTP server |
229,941 | public function rmdir ( $ directory = null ) { if ( \ ftp_rmdir ( $ this -> _stream , $ directory ) ) { return true ; } $ this -> error = 'Failed to remove directory "' . $ directory . '"' ; return false ; } | Remove directory on FTP server |
229,942 | public function execute ( ) { $ results = array ( ) ; foreach ( $ this -> benchmarks as $ benchmark ) { $ results += $ benchmark -> execute ( ) ; } return $ results ; } | Execute the registered tests and return the results |
229,943 | public function authorizedAs ( string $ user , string $ password ) : self { $ this -> headers -> putAuthorization ( $ user , $ password ) ; return $ this ; } | authorize with given credentials |
229,944 | public function usingHeader ( string $ key , $ value ) : self { $ this -> headers -> put ( $ key , $ value ) ; return $ this ; } | adds any arbitrary header |
229,945 | public function put ( string $ body , string $ version = HttpVersion :: HTTP_1_1 ) : HttpResponse { return HttpRequest :: create ( $ this -> httpUri , $ this -> headers ) -> put ( $ body , $ this -> timeout , $ version ) ; } | returns response object for given URI after PUT request |
229,946 | public function delete ( string $ version = HttpVersion :: HTTP_1_1 ) : HttpResponse { return HttpRequest :: create ( $ this -> httpUri , $ this -> headers ) -> delete ( $ this -> timeout , $ version ) ; } | returns response object for given URI after DELETE request |
229,947 | protected function registerGuest ( ) { $ this -> app -> bind ( 'guest.roles' , function ( $ app ) { return [ 'guest' ] ; } ) ; $ this -> app -> bind ( 'guest.abilities' , function ( $ app ) { return [ '*.show' ] ; } ) ; $ this -> app -> bind ( 'guest' , function ( $ app ) { return new Guest ( $ app [ 'guest.roles' ] , ... | Register a guest representing user entity which is not persistable . |
229,948 | public function flushTo ( OutputWriter $ outputWriter ) { if ( $ outputWriter === $ this ) { throw new LogicException ( 'Operation not allowed' ) ; } $ minLevel = $ outputWriter -> getLevel ( ) ; while ( ! empty ( $ this -> buffer ) ) { $ item = array_shift ( $ this -> buffer ) ; if ( $ item [ 'level' ] < $ minLevel ) ... | Send all buffered messages to another OutputWriter . Be aware that messages are removed during this process . |
229,949 | public function validateSeedProducerCode ( ErrorElement $ errorElement , $ object ) { $ code = $ object -> getSeedProducerCode ( ) ; $ container = $ this -> getConfigurationPool ( ) -> getContainer ( ) ; $ is_new = empty ( $ object -> getId ( ) ) ; if ( empty ( $ code ) ) { $ app_circles = $ container -> get ( 'librinf... | Seed producer code validator . |
229,950 | public function contains ( $ e ) { if ( ! EnumUtil :: isEnum ( $ e , $ this -> class ) ) throw new InvalidArgumentException ( sprintf ( 'Element must be an instance of %s.' , $ this -> class ) ) ; return ( $ this -> entries & $ this -> universe [ $ e -> ordinal ( ) ] ) !== 0 ; } | Returns true if this set contains the given element . |
229,951 | public function remove ( $ e ) { if ( ! EnumUtil :: isEnum ( $ e , $ this -> class ) ) throw new InvalidArgumentException ( sprintf ( 'Element must be an instance of %s.' , $ this -> class ) ) ; if ( ! $ this -> contains ( $ e ) ) return false ; $ this -> entries &= ~ $ this -> universe [ $ e -> ordinal ( ) ] ; return ... | Removes a single instance of an object from this set if it is present . |
229,952 | public static function complementOf ( EnumSet $ set ) { $ values = array ( ) ; foreach ( call_user_func ( array ( $ set -> class , 'values' ) ) as $ v ) if ( ! $ set -> contains ( $ v ) ) $ values [ ] = $ v ; return new EnumSet ( $ set -> class , $ values ) ; } | Creates a new EnumSet that is the complement of the given EnumSet . Or in other words creates an EnumSet containing all enum values that are not present in the given EnumSet . |
229,953 | public static function of ( $ class ) { if ( ! EnumUtil :: isEnumClass ( $ class ) ) throw new InvalidArgumentException ( $ class . ' is not loaded or does not extend DaybreakStudios\Common\Enum\Enum.' ) ; $ values = func_get_args ( ) ; array_shift ( $ values ) ; return new EnumSet ( $ class , $ values ) ; } | Creates a new EnumSet that contains all of the elements passed to this method after the first . |
229,954 | public static function range ( $ class , Enum $ from , Enum $ to ) { if ( ! EnumUtil :: isEnumClass ( $ class ) ) throw new InvalidArgumentException ( $ class . ' is not loaded or does not extend DaybreakStudios\Common\Enum\Enum.' ) ; else if ( ! EnumUtil :: isEnum ( $ from , $ class ) || ! EnumUtil :: isEnum ( $ to , ... | Creates an EnumSet that initially contains all of the elements between two endpoints . |
229,955 | public function get ( callable $ codeBlock = null ) { $ getValue = function ( Maybe $ value ) { return $ value -> get ( ) ; } ; return array_map ( $ getValue , parent :: get ( $ codeBlock ) ) ; } | Returns the contained collection and applies an optional code - block to each element before returning it . |
229,956 | protected static function loadFilters ( $ filters , $ options = [ ] ) { $ queue = array ( ) ; if ( ! is_array ( $ filters ) ) { $ filters = [ $ filters ] ; $ options = [ $ options ] ; } foreach ( $ filters as $ idx => $ filtername ) { $ classname = __NAMESPACE__ . "\\Types\\" . preg_replace ( "/[^A-z0-9]/" , "" , ucfir... | load needed filters |
229,957 | protected static function execFilterQueue ( $ value , array $ queue , $ type ) { foreach ( $ queue as $ filter ) { $ value = self :: executeValueMethod ( $ value , $ filter , $ type , "filter" ) ; if ( $ value === self :: ERR_INVALID ) return false ; } return $ value ; } | execute filter queue on a value |
229,958 | public function prepareParams ( $ params ) { $ values [ 'street' ] = isset ( $ params [ 'street' ] ) ? trim ( ( string ) $ params [ 'street' ] ) : null ; $ values [ 'number' ] = isset ( $ params [ 'number' ] ) ? trim ( ( string ) $ params [ 'number' ] ) : null ; $ values [ 'latitude' ] = isset ( $ params [ 'latitude' ]... | Prepare parameters . |
229,959 | public function collect ( Table $ table ) { $ this -> createTableQueries = array_merge ( $ this -> createTableQueries , $ this -> platform -> getCreateTableSQLQueries ( $ table , array ( 'foreign_key' => false ) ) ) ; foreach ( $ table -> getForeignKeys ( ) as $ foreignKey ) { $ this -> createForeignKeyQueries = array_... | Collects queries to create tables . |
229,960 | public function categories ( $ blogId , $ includeCount = true , $ onlyPopulated = true ) { $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> select ( 'c.id,c.blog_id,c.slug,c.label' ) ; if ( $ includeCount ) { $ sql = '(SELECT COUNT(DISTINCT bpc.post_id) FROM ' . NAILS_DB_PREFIX . 'blog_post_category bpc JOIN ' ; $ ... | Returns an array of a blog s categories |
229,961 | public function tags ( $ blogId , $ includeCount = true , $ onlyPopulated = true ) { $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> select ( 't.id,t.blog_id,t.slug,t.label' ) ; if ( $ includeCount ) { $ sql = '(SELECT COUNT(DISTINCT bpt.post_id) FROM ' . NAILS_DB_PREFIX . 'blog_post_tag bpt JOIN ' ; $ sql .= NAIL... | Returns an array of a blog s tags |
229,962 | public function withArgument ( $ name , $ description , array $ choices = [ ] ) { $ this -> choices [ $ name ] = $ choices ; return $ this -> addArgument ( $ name , InputArgument :: REQUIRED , $ description ) ; } | With mandatory argument |
229,963 | public function withOption ( $ name , $ description , $ default = '' , array $ choices = [ ] ) { $ this -> choices [ $ name ] = $ choices ; return $ this -> addOption ( $ name , null , InputOption :: VALUE_OPTIONAL , $ description , $ default ) ; } | With optional option |
229,964 | public function exec ( string $ command , array $ remote = [ ] , $ color = 'note-inverted' ) { if ( $ remote ) { $ path = $ remote [ 'path' ] ? $ remote [ 'path' ] : '~' ; $ command = "ssh -t -p {$remote['port']} {$remote['auth']} \"cd {$path} && {$command}\"" ; } $ this -> out -> writeln ( "\n<{$color}> {$command} </{... | Execute an command and display output |
229,965 | public function initialize ( InputInterface $ input , OutputInterface $ output ) { $ this -> in = $ input ; $ this -> out = $ output ; } | Initializes the command after the input has been bound and before the input is validated . |
229,966 | public function filter ( $ sizes ) { $ sizes = apply_filters ( Config :: KATANA_FILTER , $ sizes , $ this -> request_id ( ) ) ; return $ sizes ; } | WP default filter that runs before the images are being generated then appplies the custom filter from Katana . |
229,967 | public function setEmail ( $ email ) { if ( filter_var ( $ email , FILTER_VALIDATE_EMAIL ) ) { $ this -> _options [ 'email' ] = $ email ; $ this -> _options [ 'hash' ] = strtolower ( md5 ( trim ( $ this -> _options [ 'email' ] ) ) ) ; } else { throw new \ Exception ( 'The email is in an invalid format!' ) ; } return $ ... | Sets the email you want to use for image generation . |
229,968 | public function generateUrl ( $ type , $ email , array $ attr = [ ] ) { if ( ! empty ( $ email ) ) { $ this -> setEmail ( $ email ) ; } if ( isset ( $ attr [ 'size' ] ) ) { $ this -> setSize ( $ attr [ 'size' ] ) ; } if ( isset ( $ attr [ 'imgset' ] ) ) { $ this -> setImageSet ( $ attr [ 'imgset' ] ) ; } if ( isset ( $... | Generates the Gravatar URL . |
229,969 | public static function chmod ( $ path , $ mode = null ) { if ( $ mode ) { return chmod ( $ path , $ mode ) ; } return substr ( sprintf ( '%o' , fileperms ( $ path ) ) , - 4 ) ; } | Get or set UNIX mode of a file or directory . |
229,970 | public static function copy ( string $ source , string $ destination ) { if ( is_dir ( $ source ) ) { @ mkdir ( $ destination ) ; $ directory = dir ( $ source ) ; while ( false !== ( $ readdirectory = $ directory -> read ( ) ) ) { if ( $ readdirectory == '.' || $ readdirectory == '..' ) { continue ; } $ PathDir = $ sou... | Copy file or folder |
229,971 | public function sendRecoveryMessage ( $ user , $ token ) { $ mailVars = [ '{token}' => $ token -> url ] ; $ mailTemplate = \ Yii :: $ app -> get ( 'emailTemplates' ) -> getTemplate ( 'recovery' , Language :: getCurrent ( ) -> id ) ; $ mailTemplate -> parseSubject ( $ mailVars ) ; $ mailTemplate -> parseBody ( $ mailVar... | Sends an email to a user with recovery link . |
229,972 | public function getNodeContent ( $ xPath ) { if ( $ this -> content -> xpath ( $ xPath ) !== null ) { return ( string ) trim ( end ( $ this -> content -> xpath ( $ xPath ) ) ) ; } return false ; } | get the content or false of node . in case of fasle there is no node exists |
229,973 | public function getNodeAttribute ( $ xPath , $ atrName ) { $ res = $ this -> content -> xpath ( $ xPath ) ; if ( $ res !== null ) { foreach ( $ res as $ set ) { return ( string ) $ set [ $ atrName ] ; } } return NULL ; } | reads an spcific attribute from node |
229,974 | public function getNodeAttributeBool ( $ xPath , $ atrName , $ failReturn = false ) { $ val = $ this -> getNodeAttribute ( $ xPath , $ atrName ) ; if ( strtolower ( $ val ) === 'false' ) { return false ; } if ( strtolower ( $ val ) === 'true' ) { return true ; } if ( $ val === NULL || ! is_bool ( $ val ) ) { return $ f... | return node attribut value in boolean |
229,975 | protected function getLinks ( ) { $ html = '' ; if ( is_array ( $ this -> window [ 'first' ] ) ) { $ html .= $ this -> getUrlLinks ( $ this -> window [ 'first' ] ) ; } if ( is_array ( $ this -> window [ 'slider' ] ) ) { $ html .= $ this -> getDots ( ) ; $ html .= $ this -> getUrlLinks ( $ this -> window [ 'slider' ] ) ... | Render the actual link slider . |
229,976 | public function index ( ) : View { $ config = [ 'title' => trans ( 'HCResource::resource_grab_property.page_title' ) , 'url' => route ( 'admin.api.resource.grab.property' ) , 'form' => route ( 'admin.api.form-manager' , [ 'resource.grab.property' ] ) , 'headers' => $ this -> getTableColumns ( ) , 'actions' => [ 'search... | Admin panel page view |
229,977 | public function getOptions ( HCResourceGrabPropertyRequest $ request ) : JsonResponse { return response ( ) -> json ( $ this -> service -> getRepository ( ) -> getOptions ( $ request ) ) ; } | Create data list |
229,978 | public function addTypeExtensions ( array $ typeExtensions ) { foreach ( $ typeExtensions as $ typeExtension ) { $ this -> typeExtensions [ $ typeExtension -> getExtendedType ( ) ] [ ] = $ typeExtension ; } return $ this ; } | Adds a list of field type extension to the factory . |
229,979 | public function getSearchFactory ( ) : SearchFactory { $ extensions = $ this -> extensions ; if ( \ count ( $ this -> types ) > 0 || \ count ( $ this -> typeExtensions ) > 0 ) { $ extensions [ ] = new PreloadedExtension ( $ this -> types , $ this -> typeExtensions ) ; } $ resolvedTypeFactory = $ this -> resolvedTypeFac... | Builds and returns the factory . |
229,980 | public function watermark ( ) { $ args = func_get_args ( ) ; if ( ! count ( $ args ) ) { throw new ImageModifierException ( 'Insufficient arguments for watermarking.' ) ; } if ( ! file_exists ( realpath ( $ args [ 0 ] ) ) ) { throw new ImageModifierException ( 'Watermark file not found.' ) ; } $ todo = new \ stdClass (... | adds a watermark - command to queue |
229,981 | protected function getVarcharSQLDeclarationSnippet ( $ length , $ fixed ) { if ( ! is_int ( $ length ) || ( is_int ( $ length ) && ( $ length <= 0 ) ) ) { throw PlatformException :: invalidVarcharLength ( ) ; } if ( ! is_bool ( $ fixed ) ) { throw PlatformException :: invalidVarcharFixedFlag ( ) ; } if ( $ fixed ) { re... | Gets the varchar SQL declaration snippet . |
229,982 | protected function getTransactionIsolationSQLDeclaration ( $ isolation ) { if ( ! $ this -> supportTransactionIsolations ( ) ) { throw PlatformException :: methodNotSupported ( __METHOD__ ) ; } $ availableIsolations = array ( Connection :: TRANSACTION_READ_COMMITTED , Connection :: TRANSACTION_READ_UNCOMMITTED , Connec... | Gets the transaction isolation SQL declaration . |
229,983 | protected function getColumnsSQLDeclaration ( array $ columns ) { $ columnsDeclaration = array ( ) ; foreach ( $ columns as $ column ) { $ columnsDeclaration [ ] = $ this -> getColumnSQLDeclaration ( $ column ) ; } return implode ( ', ' , $ columnsDeclaration ) ; } | Gets the columns SQL declaration . |
229,984 | protected function getColumnSQLDeclaration ( Column $ column ) { $ columnDeclaration = $ column -> getName ( ) . ' ' . $ column -> getType ( ) -> getSQLDeclaration ( $ this , $ column -> toArray ( ) ) ; if ( $ column -> isNotNull ( ) ) { $ columnDeclaration .= ' NOT NULL' ; } if ( $ column -> getDefault ( ) !== null ) ... | Gets the column SQL declaration . |
229,985 | protected function getPrimaryKeySQLDeclaration ( PrimaryKey $ primaryKey ) { if ( ! $ this -> supportPrimaryKeys ( ) ) { throw PlatformException :: methodNotSupported ( __METHOD__ ) ; } return 'CONSTRAINT ' . $ primaryKey -> getName ( ) . ' PRIMARY KEY (' . implode ( ', ' , $ primaryKey -> getColumnNames ( ) ) . ')' ; ... | Gets the primary key SQL declaration . |
229,986 | protected function getForeignKeySQLDeclaration ( ForeignKey $ foreignKey ) { if ( ! $ this -> supportForeignKeys ( ) ) { throw PlatformException :: methodNotSupported ( __METHOD__ ) ; } return 'CONSTRAINT ' . $ foreignKey -> getName ( ) . ' FOREIGN KEY' . ' (' . implode ( ', ' , $ foreignKey -> getLocalColumnNames ( ) ... | Gets the foreign key SQL declaration . |
229,987 | protected function getIndexSQLDeclaration ( Index $ index ) { if ( ! $ this -> supportIndexes ( ) ) { throw PlatformException :: methodNotSupported ( __METHOD__ ) ; } if ( ! $ index -> isUnique ( ) ) { return 'INDEX ' . $ index -> getName ( ) . ' (' . implode ( ', ' , $ index -> getColumnNames ( ) ) . ')' ; } return 'C... | Gets the index SQL declaration . |
229,988 | protected function getCheckSQLDeclaration ( Check $ check ) { if ( ! $ this -> supportChecks ( ) ) { throw PlatformException :: methodNotSupported ( __METHOD__ ) ; } return 'CONSTRAINT ' . $ check -> getName ( ) . ' CHECK (' . $ check -> getDefinition ( ) . ')' ; } | Gets the check constraint SQL declaration . |
229,989 | protected function getCreateColumnCommentsSQLQueries ( array $ columns , $ table ) { $ queries = array ( ) ; foreach ( $ columns as $ column ) { if ( $ this -> hasCustomType ( $ column -> getType ( ) -> getName ( ) ) || ( $ column -> getComment ( ) !== null ) ) { $ queries [ ] = $ this -> getCreateColumnCommentSQLQuery... | Gets the create column comments SQL queries . |
229,990 | protected function getCreateColumnCommentSQLQuery ( Column $ column , $ table ) { return 'COMMENT ON COLUMN ' . $ table . '.' . $ column -> getName ( ) . ' IS ' . $ this -> getColumnCommentSQLDeclaration ( $ column ) ; } | Gets the create column comment SQL query . |
229,991 | protected function getColumnCommentSQLDeclaration ( Column $ column ) { $ comment = $ column -> getComment ( ) ; if ( $ this -> hasCustomType ( $ column -> getType ( ) -> getName ( ) ) ) { $ comment .= '(FridgeType::' . strtoupper ( $ column -> getType ( ) -> getName ( ) ) . ')' ; } return $ this -> quote ( $ comment )... | Gets the column comment SQL declaration . |
229,992 | protected function getAlterTableSQLQuery ( $ table , $ action , $ expression = null ) { $ alterTable = 'ALTER TABLE ' . $ table . ' ' . $ action ; return $ expression !== null ? $ alterTable . ' ' . $ expression : $ alterTable ; } | Gets an alter table SQL query . |
229,993 | public function rollback ( Node $ node , Application $ application , Deployment $ deployment , array $ options = [ ] ) { $ this -> removeFile ( rtrim ( $ application -> getReleasesPath ( ) , '/' ) . '/' . $ this -> getTargetPath ( $ options ) , $ node , $ deployment , $ options ) ; $ this -> removeFile ( rtrim ( $ depl... | Rollback this task . |
229,994 | private function createMedia ( Media $ media ) { $ request = $ this -> getRequest ( ) ; $ thumbSizes = $ this -> container -> getParameter ( 'fulgurio_light_cms.thumbs' ) ; $ form = $ this -> createForm ( new AdminMediaType ( $ this -> container ) , $ media ) ; $ formHandler = new AdminMediaHandler ( ) ; $ formHandler ... | Create form for media entity use for edit or add a media |
229,995 | public function removeAction ( $ mediaId ) { $ media = $ this -> getMedia ( $ mediaId ) ; $ request = $ this -> getRequest ( ) ; if ( $ request -> request -> get ( 'confirm' ) === 'yes' || $ request -> get ( 'confirm' ) === 'yes' ) { $ this -> get ( 'fulgurio_light_cms.media_library' ) -> remove ( $ media ) ; $ em = $ ... | Remove media with confirm form |
229,996 | public function wysiwygMediaAction ( ) { $ form = $ this -> createForm ( new AdminMediaType ( $ this -> container ) , new Media ( ) ) ; return $ this -> render ( 'FulgurioLightCMSBundle:AdminMedia:wysiwygAdd.html.twig' , array ( 'form' => $ form -> createView ( ) , 'wysiwyg' => $ this -> getWysiwyg ( ) ) ) ; } | Wysiwyg media popup |
229,997 | public function wysiwygLinkAction ( ) { $ form = $ this -> createForm ( new AdminMediaType ( $ this -> container ) , new Media ( ) ) ; return $ this -> render ( 'FulgurioLightCMSBundle:AdminMedia:wysiwygAdd.html.twig' , array ( 'form' => $ form -> createView ( ) , 'wysiwyg' => $ this -> getWysiwyg ( ) , 'isLink' => TRU... | Wysiwyg link popup |
229,998 | private function getWysiwyg ( ) { $ wysiwygName = $ this -> container -> getParameter ( 'fulgurio_light_cms.wysiwyg' ) ; if ( $ wysiwygName && $ this -> container -> hasParameter ( $ wysiwygName ) ) { return $ this -> container -> getParameter ( $ wysiwygName ) ; } else { return NULL ; } } | Get specified wysiwig with configuration if set |
229,999 | private function jsonResponse ( $ data ) { $ response = new Response ( json_encode ( $ data ) ) ; $ response -> headers -> set ( 'Content-Type' , 'application/json' ) ; return $ response ; } | Return a JSON response |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.