입력된 필드의 길이가 정해진 길이와 다를 경우 exception
@param object $field
@param int $length
@param string $msg
@throws \Ridibooks\Exception\MsgException
973361
public static function checkLength($field, $length, $msg)
    {
        if ((StringUtils::isEmpty($field) === false) && mb_strlen($field) != $length) {
            throw new MsgException($msg);
        }
    }
1294261
public static void d(String msg, Throwable tr) {
    assertInitialization();
    sLogger.d(msg, tr);
  }
1335409
public void f(final String msg, Throwable exception) {
        logMgr.log(tag, LogLevelConst.FATAL, msg, exception);
    }
868116
protected function setto($s,$length)
    {
        $this->b = substr_replace($this->b,$s,$this->j+1);
        $this->k = $this->j+$length;
    }
892246
public function minLength($len, $msg)
    {
        if(strlen(trim($this->_value)) < $len) {
            $this->_errors[] = $msg;
        }
        return $this;
    }
1305702
protected function addException($msg = null, $type = 'info')
    {
        if (null === $msg) {
            return;
        }

        if (!isset($this->exceptionStore[$type])) {
            $this->exceptionStore[$type] = [];
        }

        $this->exceptionStore[$type][] = $msg;
    }
732586
public void writeFieldLength(long length) throws IOException {
    if (length < 251) {

      write((byte) length);

    } else if (length < 65536) {

      if (3 > buf.length - pos) {
        //not enough space remaining
        byte[] arr = new byte[3];
        arr[0] = (byte) 0xfc;
        arr[1] = (byte) length;
        arr[2] = (byte) (length >>> 8);
        write(arr, 0, 3);
        return;
      }

      buf[pos] = (byte) 0xfc;
      buf[pos + 1] = (byte) length;
      buf[pos + 2] = (byte) (length >>> 8);
      pos += 3;

    } else if (length < 16777216) {

      if (4 > buf.length - pos) {
        //not enough space remaining
        byte[] arr = new byte[4];
        arr[0] = (byte) 0xfd;
        arr[1] = (byte) length;
        arr[2] = (byte) (length >>> 8);
        arr[3] = (byte) (length >>> 16);
        write(arr, 0, 4);
        return;
      }

      buf[pos] = (byte) 0xfd;
      buf[pos + 1] = (byte) length;
      buf[pos + 2] = (byte) (length >>> 8);
      buf[pos + 3] = (byte) (length >>> 16);
      pos += 4;

    } else {

      if (9 > buf.length - pos) {
        //not enough space remaining
        byte[] arr = new byte[9];
        arr[0] = (byte) 0xfe;
        arr[1] = (byte) length;
        arr[2] = (byte) (length >>> 8);
        arr[3] = (byte) (length >>> 16);
        arr[4] = (byte) (length >>> 24);
        arr[5] = (byte) (length >>> 32);
        arr[6] = (byte) (length >>> 40);
        arr[7] = (byte) (length >>> 48);
        arr[8] = (byte) (length >>> 54);
        write(arr, 0, 9);
        return;
      }

      buf[pos] = (byte) 0xfe;
      buf[pos + 1] = (byte) length;
      buf[pos + 2] = (byte) (length >>> 8);
      buf[pos + 3] = (byte) (length >>> 16);
      buf[pos + 4] = (byte) (length >>> 24);
      buf[pos + 5] = (byte) (length >>> 32);
      buf[pos + 6] = (byte) (length >>> 40);
      buf[pos + 7] = (byte) (length >>> 48);
      buf[pos + 8] = (byte) (length >>> 54);
      pos += 9;

    }
  }
1036167
public function pack($msg)
    {
        if (!$msg instanceof Message) {
            trigger_error("Given parameter is not a message instance.",
                          E_USER_ERROR);
            return;
        }

        // Set value using serialzed message.
        $this->value = $msg->serializeToString();

        // Set type url.
        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
        $desc = $pool->getDescriptorByClassName(get_class($msg));
        $fully_qualifed_name = $desc->getFullName();
        $this->type_url = GPBUtil::TYPE_URL_PREFIX.substr(
            $fully_qualifed_name, 1, strlen($fully_qualifed_name));
    }
533909
public function error($msg, Exception $e = null) {
		if($e !== null) {
			$msg .= PHP_EOL . get_class($e) . ': (' . $e->getCode() . ') "' . $e->getMessage() . '"' . PHP_EOL;
			$msg .= 'thrown in file: ' . $e->getFile() . ' (Line: ' . $e->getLine() . ')' . PHP_EOL . PHP_EOL;
			$msg .= $e->getTraceAsString();
		}

		$msg .= PHP_EOL . PHP_EOL . '$_SERVER = ' . print_r($_SERVER, true);
		$msg .= PHP_EOL . PHP_EOL . '$_GET = ' . print_r($_GET, true);
		$msg .= PHP_EOL . PHP_EOL . '$_POST = ' . print_r($_POST, true);
		$msg .= PHP_EOL . PHP_EOL . '$_FILES = ' . print_r($_FILES, true);
		$msg .= PHP_EOL . PHP_EOL . '$_COOKIE = ' . print_r($_COOKIE, true);

		$this->mailMessage(self::LEVEL_ERROR, $msg);

		if($this->checkLevel($this->loglevels, self::LEVEL_ERROR) !== true)
			return;

		$this->writeMessage(self::LEVEL_ERROR, $msg);
	}
596154
function error($msg, $section = 'bors', $trace = false, $extra = array())
	{
		static $entered = false;
		if($entered)
			throw new Exception('Reentered logger with '.$msg.' in section '.$section);

		$entered = true;

		try
		{
			$this->logger($section, Logger::ERROR, $trace)->addError($msg, $extra);
		}
		catch(Exception $e)
		{
			echo "Exception while error logging:\n<code><xmp>".$e->getMessage()."</xmp></code>\nFirst error is:\n<xmp>$msg\nin".bors_debug::trace()."</xmp>";
		}

		$entered = false;
	}
792831
public static function checkDatetimeFormat($field, $format, $msg)
    {
        $date = date($format, strtotime($field));
        if ($field !== $date) {
            throw new MsgException($msg);
        }
    }
251207
public function setLength($length)
    {
        if (($length !== null) && (!is_int($length) || ($length <= 0))) {
            throw SchemaException::invalidColumnLength($this->getName());
        }

        $this->length = $length;
    }
141034
public function validateStringMaxLength($value, $maxLength, $errorMessage, $errorField = null)
    {
        if (strlen($value) > $maxLength) {
            $this->error($errorMessage);
            $this->_errorFields[] = $errorField;
        }
    }
1123744
public function error($field, $text = null)
    {
        /** @type Form_Field $form_field */
        $form_field = $this->getElement($field);
        $form_field->displayFieldError($text);
    }
600471
public function throwError($msg = null) {
if ($this->sourceLoc >= 0) {
$this->sourceParser->throwError($msg, $this->sourceLoc);
}
throw new \Exception($msg);
}
161525
protected function add($type, $msg, array $context)
	{
		if (!isset($context['attrName']) && isset($this->attrName))
		{
			$context['attrName'] = $this->attrName;
		}

		if (!isset($context['tag']) && isset($this->tag))
		{
			$context['tag'] = $this->tag;
		}

		$this->logs[] = [$type, $msg, $context];
	}
274566
protected function getNextFragment($string, $length = null, &$pos = null) {
			$state = self::STATE_DATA;
			$buffer = '';

			$length = $length ?: strlen($string);
			$pos = $pos ?: 0;
			$depth = 0;

			while ($pos < $length) {
				$char = $string[$pos++];

				if ($char === self::TOKEN_FIELD_SEPARATOR && $depth === 0 && $state === self::STATE_DATA)
					return $buffer;
				else if ($char === self::TOKEN_SUBFIELD_OPEN) {
					$state = self::STATE_SUBFIELD;

					++$depth;
				} else if ($char === self::TOKEN_SUBFIELD_CLOSE) {
					$state = self::STATE_DATA;

					--$depth;
				}

				$buffer .= $char;
			}

			if ($state !== self::STATE_DATA)
				throw new \Exception('Unexpected end of string');

			return $buffer;
		}