Changeset 199


Ignore:
Timestamp:
Jul 6, 2006 3:31:38 AM (18 years ago)
Author:
scdev
Message:

Q - disabling excessive raised MSG_*s

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/ACL.inc.php

    r189 r199  
    342342        $db->query("UPDATE $tbl SET rgt = rgt - ($rgt - $lft + 1) WHERE rgt > $rgt");
    343343
    344         $app->logMsg(sprintf('Removed %s node %s along with %s children.', $type, $name, $num_deleted_nodes), LOG_DEBUG, __FILE__, __LINE__);
     344        $app->logMsg(sprintf('Removed %s node %s along with %s children.', $type, $name, $num_deleted_nodes - 1), LOG_DEBUG, __FILE__, __LINE__);
    345345        return true;
    346346    }
     
    647647            if (!list($access) = mysql_fetch_row($qid)) {
    648648                $this->cache->set($cache_hash, 'deny');
    649                 $app->logMsg(sprintf('Access denyed: %s -> %s -> %s. No records found.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
     649                // $app->logMsg(sprintf('Access denyed: %s -> %s -> %s. No records found.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
    650650                return false;
    651651            }
     
    654654       
    655655        if ('allow' == $access) {
    656             $app->logMsg(sprintf('Access granted: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
     656            // $app->logMsg(sprintf('Access granted: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
    657657            return true;
    658658        } else {
    659             $app->logMsg(sprintf('Access denyed: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
     659            // $app->logMsg(sprintf('Access denyed: %s -> %s -> %s.', $aro, $aco, $axo), LOG_DEBUG, __FILE__, __LINE__);
    660660            return false;
    661661        }
  • trunk/lib/Auth_SQL.inc.php

    r198 r199  
    260260        $this->initDB();
    261261
    262         if ($this->get('user_id', false)) {           
     262        if ($this->get('user_id', false)) {
     263            // FIX ME: Should we check if the session is active?
    263264            $db->query("
    264265                UPDATE " . $this->_params['db_table'] . " SET
  • trunk/lib/ImageThumb.inc.php

    r154 r199  
    3636        'dest_dir_perms' => 0700,
    3737
    38         // Require file to have one of the following file name extentions.
     38        // Require file to have one of the following file name extensions.
    3939        'valid_file_extensions' => array('jpg', 'jpeg', 'gif', 'png'),
    4040       
     
    6161
    6262        // Destination file types. ('jpg', 'png', 'gif', 'wbmp')
    63         'dest_file_extention' => 'jpg',
     63        'dest_file_extension' => 'jpg',
    6464       
    6565        // Type of scaling to perform, and sizes used to calculate max dimentions.
     
    174174                    $app->logMsg(sprintf('IMG_JPG is not supported by this version of PHP GD.', null), LOG_ERR, __FILE__, __LINE__);
    175175                }
    176                 $spec['dest_file_extention'] = 'jpg';
     176                $spec['dest_file_extension'] = 'jpg';
    177177                break;
    178178            case IMG_PNG :
     
    180180                    $app->logMsg(sprintf('IMG_PNG is not supported by this version of PHP GD.', null), LOG_ERR, __FILE__, __LINE__);
    181181                }
    182                 $spec['dest_file_extention'] = 'png';
     182                $spec['dest_file_extension'] = 'png';
    183183                break;
    184184            case IMG_GIF :
     
    186186                    $app->logMsg(sprintf('IMG_GIF is not supported by this version of PHP GD.', null), LOG_ERR, __FILE__, __LINE__);
    187187                }
    188                 $spec['dest_file_extention'] = 'gif';
     188                $spec['dest_file_extension'] = 'gif';
    189189                break;
    190190            case IMG_WBMP :
     
    192192                    $app->logMsg(sprintf('IMG_WBMP is not supported by this version of PHP GD.', null), LOG_ERR, __FILE__, __LINE__);
    193193                }
    194                 $spec['dest_file_extention'] = 'wbmp';
     194                $spec['dest_file_extension'] = 'wbmp';
    195195                break;
    196196            default :
     
    269269     *
    270270     * @access  public
    271      * @param   string $file_name Name of file with extention.
     271     * @param   string $file_name Name of file with extension.
    272272     * @param   array $runtime_specs Array of specifications that will override all configured specifications.
    273273     * @return  bool true on success, false on failure.
     
    298298        // Confirm source image exists.
    299299        if (!file_exists($source_file)) {
    300             $this->_raiseMsg(sprintf(_("Image resizing failed: source image %s was not found."), $file_name), MSG_ERR, __FILE__, __LINE__);
     300            $this->_raiseMsg(sprintf(_("Image resizing failed: source image <em>%s</em> was not found."), $file_name), MSG_ERR, __FILE__, __LINE__);
    301301            $app->logMsg(sprintf('Source image not found: %s', $source_file), LOG_WARNING, __FILE__, __LINE__);
    302302            return false;
     
    305305        // Confirm source image is readable.
    306306        if (!is_readable($source_file)) {
    307             $this->_raiseMsg(sprintf(_("Image resizing failed: source image %s is not readable."), $file_name), MSG_ERR, __FILE__, __LINE__);
     307            $this->_raiseMsg(sprintf(_("Image resizing failed: source image <em>%s</em> is not readable."), $file_name), MSG_ERR, __FILE__, __LINE__);
    308308            $app->logMsg(sprintf('Source image not readable: %s', $source_file), LOG_WARNING, __FILE__, __LINE__);
    309309            return false;
     
    312312        // Confirm source image contains data.
    313313        if (filesize($source_file) <= 0) {
    314             $this->_raiseMsg(sprintf(_("Image resizing failed: source image %s is zero bytes."), $file_name), MSG_ERR, __FILE__, __LINE__);
     314            $this->_raiseMsg(sprintf(_("Image resizing failed: source image <em>%s</em> is zero bytes."), $file_name), MSG_ERR, __FILE__, __LINE__);
    315315            $app->logMsg(sprintf('Source image is zero bytes: %s', $source_file), LOG_WARNING, __FILE__, __LINE__);
    316316            return false;
     
    319319        // Confirm source image has a valid file extension.
    320320        if (!$this->_validFileExtension($file_name)) {
    321             $this->_raiseMsg(sprintf(_("Image resizing failed: source image %s not a valid type. It must have one of the following file name extensions: %s"), $file_name, join(', ', $this->getParam('valid_file_extensions'))), MSG_ERR, __FILE__, __LINE__);
     321            $this->_raiseMsg(sprintf(_("Image resizing failed: source image <em>%s</em> not a valid type. It must have one of the following file name extensions: %s"), $file_name, join(', ', $this->getParam('valid_file_extensions'))), MSG_ERR, __FILE__, __LINE__);
    322322            $app->logMsg(sprintf('Image resizing failed: source image not of valid type: %s', $source_file), LOG_WARNING, __FILE__, __LINE__);
    323323            return false;
     
    344344            }
    345345           
    346             // Destination filename uses the extention defined by dest_file_extention.
     346            // Destination filename uses the extension defined by dest_file_extension.
    347347            if ('/' == $spec['dest_dir']{0}) {
    348348                // Absolute path.
    349                 $dest_file = sprintf('%s/%s.%s', $spec['dest_dir'], substr($file_name, 0, strrpos($file_name, '.')), $spec['dest_file_extention']);
     349                $dest_file = sprintf('%s/%s.%s', $spec['dest_dir'], substr($file_name, 0, strrpos($file_name, '.')), $spec['dest_file_extension']);
    350350            } else {
    351351                // Relative path.
    352                 $dest_file = sprintf('%s/%s/%s.%s', $this->getParam('source_dir'), $spec['dest_dir'], substr($file_name, 0, strrpos($file_name, '.')), $spec['dest_file_extention']);
     352                $dest_file = sprintf('%s/%s/%s.%s', $this->getParam('source_dir'), $spec['dest_dir'], substr($file_name, 0, strrpos($file_name, '.')), $spec['dest_file_extension']);
    353353            }
    354354                 
     
    440440
    441441        // Format the command that creates the thumbnail.
    442         $command = sprintf('%s %s | %s %s | %s %s > %s/%s',
     442        $command = sprintf('%s %s | %s %s | %s %s > %s',
    443443            escapeshellcmd($this->getParam('anytopnm_binary')),
    444444            escapeshellcmd($source_file),
     
    447447            escapeshellcmd($this->getParam('cjpeg_binary')),
    448448            escapeshellcmd($cjpeg_args),
    449             escapeshellcmd($dest_file),
    450             escapeshellcmd($file_name)
     449            escapeshellcmd($dest_file)
    451450        );
    452451        $app->logMsg(sprintf('ImageThumb Netpbm command: %s', $command), LOG_DEBUG, __FILE__, __LINE__);
     
    609608     *
    610609     * @access  public
    611      * @param   string $file_name The file name to delete, with extention.
     610     * @param   string $file_name The file name to delete, with extension.
    612611     * @return  bool true on success, false on failure.
    613612     */
     
    626625            if ('/' == $spec['dest_dir']{0}) {
    627626                // Absolute path.
    628                 $dest_file = realpath(sprintf('%s/%s.%s', $spec['dest_dir'], substr($file_name, 0, strrpos($file_name, '.')), $spec['dest_file_extention']));               
     627                $dest_file = realpath(sprintf('%s/%s.%s', $spec['dest_dir'], substr($file_name, 0, strrpos($file_name, '.')), $spec['dest_file_extension']));               
    629628            } else {
    630629                // Relative path.
    631                 $dest_file = realpath(sprintf('%s/%s/%s.%s', $this->getParam('source_dir'), $spec['dest_dir'], substr($file_name, 0, strrpos($file_name, '.')), $spec['dest_file_extention']));
     630                $dest_file = realpath(sprintf('%s/%s/%s.%s', $this->getParam('source_dir'), $spec['dest_dir'], substr($file_name, 0, strrpos($file_name, '.')), $spec['dest_file_extension']));
    632631            }
    633632            if (file_exists($dest_file)) {
     
    638637            }
    639638        }
    640         $this->_raiseMsg(sprintf(_("The thumbnails for file %s have been deleted."), $file_name), MSG_SUCCESS, __FILE__, __LINE__);
     639        $app->logMsg(sprintf('THumbnails successfully deleted for file: %s', $file_name), LOG_DEBUG, __FILE__, __LINE__);
    641640        return 0 === $return_val;
    642641    }
     
    646645     *
    647646     * @access  public
    648      * @param   string $file_name The file name to delete, with extention.
     647     * @param   string $file_name The file name to delete, with extension.
    649648     * @return  bool true on success, false on failure.
    650649     */
     
    664663            return false;
    665664        }
    666         $this->_raiseMsg(sprintf(_("The original file %s has been deleted."), $file_name), MSG_SUCCESS, __FILE__, __LINE__);
     665        $app->logMsg(sprintf('Original file successfully deleted: %s', $file_name), LOG_DEBUG, __FILE__, __LINE__);
    667666        return true;
    668667    }
     
    672671     *
    673672     * @access  public
    674      * @param   string $file_name The file name to test, with extention.
     673     * @param   string $file_name The file name to test, with extension.
    675674     * @return  bool true on success, false on failure.
    676675     */
     
    690689
    691690    /**
    692      * Tests if extention of $file_name is in the array valid_file_extensions.
     691     * Tests if extension of $file_name is in the array valid_file_extensions.
    693692     *
    694693     * @access  public
Note: See TracChangeset for help on using the changeset viewer.