archive-com.com » COM » S » SOLARPHP.COM

Total: 875

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Solar Framework for PHP 5
    to send itself using that injected transport For Solar Mail Message the config key for the transport injection is transport 9 4 2 1 Injecting From Config Array The easiest way of dependency injection is to pass a config array for the transport Here s an example of injecting the PHP mail adapter into the mail message php create a message object and inject a transport config mail Solar factory Solar Mail Message array transport array adapter Solar Mail Transport Adapter Phpmail compose the message now tell the email to send itself this uses the injected transport mail send Here s a more complex example using the Solar Smtp factory adapter transport with plain authentication Note that the transport itself uses a dependency injection for the Solar Smtp object under the smtp key php create a message object and inject a transport config mail Solar factory Solar Mail Message array transport array adapter Solar Mail Transport Adapter Smtp smtp array adapter Solar Smtp Adapter PlainAuth username pmjones password secret host mail example com compose the message now tell the email to send itself this uses the injected transport mail send This is quite convenient especially since you can set up those arrays in your config file in advance making them the default configs each time you create a Solar Mail Message object In that case you can use the class names instead of the full configuration arrays php config Solar Mail Message array transport Solar Mail Transport Adapter Smtp config Solar Mail Transport Adapter Smtp array transport Solar Smtp Adapter PlainAuth config Solar Smtp Adapter PlainAuth array adapter Solar Smtp Adapter PlainAuth username pmjones password secret host mail example com Using the config file centered process instead of the logic centered process means that you can have all your settings in one place for use throughout your application You can even change adapters from the config file without changing any of the mail sending code as long as you keep the same registry names 9 4 2 2 Injecting From the Registry The only problem with injection using a config array is that the dependency objects get created anew each time you create a Solar Mail Message Sometimes it s better to use registry objects for the dependency so you don t use up resources re creating identical objects over and over again You can register the transport and SMTP objects in your bootstrap file or Solar Controller Page setup so they are available throughout the application php build a Solar Smtp object smtp Solar factory Solar Smtp array adapter Solar Smtp Adapter PlainAuth username pmjones password secret host mail example com register it as smtp Solar Registry set smtp smtp build a Solar Mail Transport object with the SMTP object injected transport Solar factory Solar Mail Transport array adapter Solar Mail Transport Adapter Smtp smtp smtp uses the registered smtp object register the transport as mail transport Solar Registry set mail transport transport Now when you create a new

    Original URL path: http://solarphp.com/manual/mail.sending (2016-02-13)
    Open archived version from archive


  • Solar Framework for PHP 5
    Namespaces A 2 4 Inline Documentation Style A 3 Base Class A 3 1 Extending the Base Class A 4 Universal Constructor A 5 Universal Configuration A 5 1 Config File Settings A 5 2 Instantiation Settings A 5 3 Order of Precedence A 6 Project System A 6 1 The source Directory A 6 2 The include Directory A 6 3 The config Directory A 6 4 The docroot

    Original URL path: http://solarphp.com/manual/appendix-standards (2016-02-13)
    Open archived version from archive

  • Solar Framework for PHP 5
    common coding style guide a shared lightweight base class a universal constructor signature a universal configuration mechanism and a standard project system structure Prev Up Next Appendix A Project Standards Home A 2 Style Guide Local Navigation Home Project Packages

    Original URL path: http://solarphp.com/manual/appendix-standards.intro (2016-02-13)
    Open archived version from archive

  • Solar Framework for PHP 5
    public protected protected in PEAR this would be protected instead private private A 2 2 Problem Solving Style In every Solar class we strive for simple easy to test and easy to explain solutions We like fast execution but prefer to err on the side of slower but simpler instead of faster but obtuse When obtuse or complex code is unavoidable it is thoroughly commented and outlined with inline narrative comments as a teaching exercise We know that some poor guy is going to have to figure out how the code works so we take a little extra time and comment so that others can comprehend what s going on A 2 3 Namespaces Currently Solar uses the PEAR style pseudo namespaces that existed before PHP 5 3 i e using a vendor prefix on each class This does not prevent the use of namespaces in your own Solar based code Future versions of Solar might use PHP 5 3 formal namespaces A 2 4 Inline Documentation Style Solar uses PHP Documentor documentation blocks for every class property and method This makes it easy to auto generate class documentation using the Solar make docs command line tool All inline documentation

    Original URL path: http://solarphp.com/manual/appendix-standards.style (2016-02-13)
    Open archived version from archive

  • Solar Framework for PHP 5
    exception method for finding and returning exceptions with localized message text A locale method for finding and returning localized text strings A 3 1 Extending the Base Class When you extend from the Solar Base class make sure the only constructor parameter is config null this is how it receives instantiation time configuration values and that it calls the parent constructor at some point with the config parameter passed up

    Original URL path: http://solarphp.com/manual/appendix-standards.base-class (2016-02-13)
    Open archived version from archive

  • Solar Framework for PHP 5
    constructors e g if you wanted to specify three pieces of information for a constructor you would do something like the following php class Normal Example protected a null protected b null protected c null public function construct a b c this a a this b b this c c configure and instantiate a Normal Example object example new Normal Example one two three In comparison Solar classes are constructed and instantiated like this php class Solar Example extends Solar Base the default config array is named for the class with an underscore prefix this lets us collect the parent config defaults without them overwriting each other protected Solar Example array a null b null c null public function construct config null let Solar Base merge the config values from the parents and from the config file parent construct config use the merged values in this config to set our property values this a this config a this b this config b this c this config c configure and instantiate an Solar Example object params array a one b two c three example Solar factory Solar Example params Why do things this way The idea is to make it easy

    Original URL path: http://solarphp.com/manual/appendix-standards.constructor (2016-02-13)
    Open archived version from archive

  • Solar Framework for PHP 5
    Instantiation Settings Finally if you specify a configuration array as the second parameter of Solar factory those values override both the default values of the class definition and the Solar config php values php config array opt 2 gir example Solar factory Solar Example config The values of example config are now opt 1 foo as defined by the class opt 2 gir from the Solar factory instantiation config opt

    Original URL path: http://solarphp.com/manual/appendix-standards.config (2016-02-13)
    Open archived version from archive

  • Solar Framework : Class : Solar_Access
    Solar Access destruct Solar Access buildConfig Solar Access exception Solar Access postConfig Solar Access postConstruct Solar Access preConfig Solar Access dump Solar Access factory Solar Access locale Prev Up Next Solar stop Home Overview Local Navigation Home Project Packages Classes

    Original URL path: http://solarphp.com/apidoc/class.Solar_Access (2016-02-13)
    Open archived version from archive



  •