Ignore:
Timestamp:
Feb 20, 2014 3:03:59 AM (10 years ago)
Author:
anonymous
Message:

Completed integrating /branches/eli_branch into /trunk. Changes include:

  • Removed closing ?> from end of files
  • Upgrade old-style contructor methods to use construct() instead.
  • Class properties and methods defined as public, private, static or protected
  • Ensure code runs under E_ALL with only mysql_* deprecated warnings
  • Search for the '@' symbol anywhere it might be used to supress runtime errors, then replace with proper error recovery.
  • Run the php cli -l option to check files for syntax errors.
  • Bring tests up-to-date with latest version and methods of PHPUnit
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/lib/Prefs.inc.php

    r463 r468  
    5555
    5656    // Namespace of this instance of Prefs.
    57     var $_ns;
     57    private $_ns;
    5858
    5959    // Configuration parameters for this object.
    60     var $_params = array(
     60    private $_params = array(
    6161
    6262        // Enable database storage. If this is false, all prefs will live only as long as the session.
     
    8080     * Prefs constructor.
    8181     */
    82     function Prefs($namespace='')
     82    public function __construct($namespace='')
    8383    {
    8484        $app =& App::getInstance();
     
    104104     * @since   04 Jun 2006 16:41:42
    105105     */
    106     function initDB($recreate_db=false)
     106    public function initDB($recreate_db=false)
    107107    {
    108108        $app =& App::getInstance();
     
    142142     * @param  array $params   Array of param keys and values to set.
    143143     */
    144     function setParam($params=null)
     144    public function setParam($params=null)
    145145    {
    146146        if (isset($params) && is_array($params)) {
     
    157157     * @return mixed               Configured parameter value.
    158158     */
    159     function getParam($param)
     159    public function getParam($param)
    160160    {
    161161        $app =& App::getInstance();
     
    176176     * @param  array $defaults  Array of key-value pairs
    177177     */
    178     function setDefaults($defaults)
     178    public function setDefaults($defaults)
    179179    {
    180180        if (isset($defaults) && is_array($defaults)) {
     
    192192     * @param  bool   $persistent   Save this value forever? Set to false and value will exist as long as the session is in use.
    193193     */
    194     function set($key, $val)
     194    public function set($key, $val)
    195195    {
    196196        $app =& App::getInstance();
     
    223223     * @return string           The value of the preference.
    224224     */
    225     function get($key)
     225    public function get($key)
    226226    {
    227227        $app =& App::getInstance();
     
    244244     * @return boolean          True if the preference isset and not empty false otherwise.
    245245     */
    246     function exists($key)
     246    public function exists($key)
    247247    {
    248248        return array_key_exists($key, $_SESSION['_prefs'][$this->_ns]['saved']);
     
    254254     * @param string $key       The name of the preference to delete.
    255255     */
    256     function delete($key)
     256    public function delete($key)
    257257    {
    258258        unset($_SESSION['_prefs'][$this->_ns]['saved'][$key]);
     
    263263     * as $auth->clear(), such as when logging out.
    264264     */
    265     function clear($focus='all')
     265    public function clear($focus='all')
    266266    {
    267267        switch ($focus) {
     
    295295    * @since    04 Jun 2006 16:56:53
    296296    */
    297     function load($force=false)
     297    public function load($force=false)
    298298    {
    299299        $app =& App::getInstance();
     
    352352    * @since    04 Jun 2006 17:12:44
    353353    */
    354     function _isLoaded()
     354    private function _isLoaded()
    355355    {
    356356        if (isset($_SESSION['_prefs'][$this->_ns]['load_datetime'])
     
    373373    * @since    04 Jun 2006 17:19:56
    374374    */
    375     function save()
     375    public function save()
    376376    {
    377377        $app =& App::getInstance();
     
    424424}
    425425
    426 
    427 ?>
Note: See TracChangeset for help on using the changeset viewer.