Apache Zeta Components Manual :: File Source for options.php

Source for file options.php

Documentation is available at options.php

  1. <?php
  2. /**
  3.  * This file contains the ezcDebugOptions class.
  4.  *
  5.  * Licensed to the Apache Software Foundation (ASF) under one
  6.  * or more contributor license agreements.  See the NOTICE file
  7.  * distributed with this work for additional information
  8.  * regarding copyright ownership.  The ASF licenses this file
  9.  * to you under the Apache License, Version 2.0 (the
  10.  * "License"); you may not use this file except in compliance
  11.  * with the License.  You may obtain a copy of the License at
  12.  * 
  13.  *   http://www.apache.org/licenses/LICENSE-2.0
  14.  * 
  15.  * Unless required by applicable law or agreed to in writing,
  16.  * software distributed under the License is distributed on an
  17.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18.  * KIND, either express or implied.  See the License for the
  19.  * specific language governing permissions and limitations
  20.  * under the License.
  21.  *
  22.  * @package Debug
  23.  * @version //autogentag//
  24.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  25.  * @filesource
  26.  */
  27.  
  28. /**
  29.  * Options class for ezcDebug.
  30.  *
  31.  * @property bool $stackTrace 
  32.  *            Determines if a stack trace is stored and displayed with every
  33.  *            debug message by default. Default is false.
  34.  * @property int $stackTraceDepth 
  35.  *            The number of levels to store for the stack trace. 0 means no
  36.  *            limit and a complete stack trace will always be stored. Not that
  37.  *            this might consume a large amount of memory. Default is 5.
  38.  * @property int $stackTraceMaxData 
  39.  *            Maximum bytes of data to print per variable in a stacktrace. This
  40.  *            option does only affect {@link ezcDebugPhpStacktraceIterator},
  41.  *            {@link ezcDebugXdebugStacktraceIterator} is configured by the
  42.  *            Xdebug INI settings. Default is 512. Set to false to show all data.
  43.  * @property int $stackTraceMaxChildren 
  44.  *            Maximum number of children to dump on 1 level in array and object
  45.  *            structures. This option does only affect {@link }
  46.  *            ezcDebugPhpStacktraceIterator}, {@link }
  47.  *            ezcDebugXdebugStacktraceIterator} is configured by the Xdebug INI
  48.  *            settings. Default is 128. Set to false to show all children.
  49.  * @property int $stackTraceMaxDepth 
  50.  *            Maximum depth to recurse into array and object structures in a
  51.  *            stack trace. This option does only affect {@link }
  52.  *            ezcDebugPhpStacktraceIterator}, {@link }
  53.  *            ezcDebugXdebugStacktraceIterator} is configured by the Xdebug INI
  54.  *            settings. Default is 3. Set to false to recurse fully.
  55.  *
  56.  * @package Debug
  57.  * @version //autogen//
  58.  */
  59. {
  60.     /**
  61.      * Properties.
  62.      * 
  63.      * @var array(string=>mixed) 
  64.      */
  65.     protected $properties = array(
  66.         'stackTrace'            => false,
  67.         'stackTraceDepth'       => 5,
  68.         'stackTraceMaxData'     => 512,
  69.         'stackTraceMaxChildren' => 128,
  70.         'stackTraceMaxDepth'    => 3,
  71.     );
  72.  
  73.     /**
  74.      * Property write access.
  75.      * 
  76.      * @param string $propertyName Name of the property.
  77.      * @param mixed $propertyValue The value for the property.
  78.      *
  79.      * @throws ezcBasePropertyPermissionException
  80.      *          If the property you try to access is read-only.
  81.      * @throws ezcBasePropertyNotFoundException
  82.      *          If the the desired property is not found.
  83.      * @ignore
  84.      */
  85.     public function __set$propertyName$propertyValue )
  86.     {
  87.         switch $propertyName )
  88.         {
  89.             case 'stackTrace':
  90.                 if !is_bool$propertyValue ) )
  91.                 {
  92.                     throw new ezcBaseValueException(
  93.                         $propertyName,
  94.                         $propertyValue,
  95.                         'bool'
  96.                     );
  97.                 }
  98.                 break;
  99.             case 'stackTraceDepth':
  100.                 if !is_int$propertyValue || $propertyValue )
  101.                 {
  102.                     throw new ezcBaseValueException(
  103.                         $propertyName,
  104.                         $propertyValue,
  105.                         'int >= 0'
  106.                     );
  107.                 }
  108.                 break;
  109.             case 'stackTraceMaxData':
  110.             case 'stackTraceMaxChildren':
  111.             case 'stackTraceMaxDepth':
  112.                 if ( ( !is_int$propertyValue || $propertyValue && $propertyValue !== false ) )
  113.                 {
  114.                     throw new ezcBaseValueException(
  115.                         $propertyName,
  116.                         $propertyValue,
  117.                         'int >= 0 or false'
  118.                     );
  119.                 }
  120.                 break;
  121.             default:
  122.                 ezcBasePropertyNotFoundException$propertyName );
  123.         }
  124.         $this->properties[$propertyName$propertyValue;
  125.     }
  126. }
  127.  
  128. ?>
Documentation generated by phpDocumentor 1.4.3