New upstream version 0.6.27

This commit is contained in:
geos_one
2025-08-06 18:11:51 +02:00
parent a6b4158f1f
commit 56a986c0ba
563 changed files with 45811 additions and 35282 deletions

41
.gitignore vendored
View File

@@ -1,41 +0,0 @@
autom4te.cache
subst
summary
*Makefile
config.log
config.status
scripts/rc.npcd
scripts/rc.pnp_gearman_worker
scripts/check_pnp_rrds.pl
scripts/process_perfdata.pl
scripts/rrd_modify.pl
src/*.o
src/npcd
include/config.h
*~
sample-config/pnp/config.php
sample-config/pnp/pnp4nagios_release
sample-config/pnp/process_perfdata.cfg-sample
sample-config/pnp/npcd.cfg-sample
sample-config/misccommands.cfg-sample
sample-config/nagios.cfg-sample
share/pnp/application/config/config.php
share/pnp/index.php
share/pnp/install.php
sample-config/httpd.conf
share/pnp/application/logs/*
contrib/ssi/status-header.ssi
helpers/w2h.pl
scripts/verify_pnp_config.pl
sample-config/lighttpd.pnp4nagios.conf
sample-config/nginx.pnp4nagios.conf
share/pnp/media/js/basket.js
scripts/rrd_convert.pl
scripts/rrd_converter.pl
man/npcd.8
*.swp
*.swo

View File

@@ -1,3 +1,3 @@
Authors:
Jörg Linge pitchfork@pnp4nagios.org
Hendrik Bäcker andurin@process-zero.de
Jörg Linge <pitchfork@pnp4nagios.org>
Hendrik Bäcker <andurin@process-zero.de>

View File

@@ -1,4 +1,22 @@
**pnp-0.6.27-4 09/12/2023**
* update URLs and related text
* clean up autoconf stuff
* add scripts/config4rpm_path.sh to test existing rpm installation (tjyang)
**pnp-0.6.27 08/18/2023**
* many php 8.2 fixes to remove 'deprecated' errors:
pre-defining class variables (instead of dynamic),
explicitly re-creating arrays as needed
converting utf8_encode to mbstring
**pnp-0.6.26-2 09/18/2022
* various php8 fixes
* rrdtools needs env XDG_CACHE_HOME for fontconfig
* fix so that 'bucket' display works
* fix so that pdf generation works
**pnp-0.6.?? ??/??/2017**
* Bugfix: Fix for CVE-2017-16834
**pnp-0.6.26 08/21/2017**
* Bugfix: Use complete option arguments for compatibility with rrdtool 1.6.0 (sbraz)

159
Makefile.in Normal file → Executable file
View File

@@ -1,11 +1,13 @@
###############################
# Makefile for PNP
#
# Last Modified: 12-10-2006
# Last Modified: 11-13-2023
###############################
VERSION=@PACKAGE_VERSION@
# Source code directories
srcdir=@srcdir@
SRC_BASE=@srcdir@/src
SRC_SHARE=@srcdir@/share
SRC_LIB=@srcdir@/lib
@@ -22,48 +24,81 @@ LDFLAGS=@LDFLAGS@ @LIBS@
prefix=@prefix@
exec_prefix=@exec_prefix@
LOGDIR=@localstatedir@
CFGDIR=@sysconfdir@
BINDIR=@bindir@
LIBEXECDIR=@libexecdir@
LIBDIR=@libdir@
KOHANA=@KOHANA@
CGIDIR=@sbindir@
INSTALL=@INSTALL@
INSTALL_OPTS=@INSTALL_OPTS@
HTTP_INSTALL_OPTS=@HTTP_INSTALL_OPTS@
DATAROOTDIR=@datarootdir@
NAGIOS_VERSION=@NAGIOS_VER@
CACHE_DIR=@CACHE_DIR@
SELINUX=@SELINUX@
SELINUX_DEVELDIR=@SELINUX_DEVELDIR@
CP=@CP@
PERL=@PERL@
.PHONY: clean rpm dist distclean devclean
none:
@echo "Please supply a command line argument (i.e. 'make all'). Other targets are:"
@echo " clean"
@echo " install install-init install-config install-processperfdata install-html fullinstall"
@echo " install-plugins"
@echo " clean distclean dist"
@echo " install install-init install-selinux fullinstall"
all:
cd $(SRC_BASE) && $(MAKE)
cd $(SRC_SHARE) && $(MAKE)
cd $(SRC_SCRIPTS) && $(MAKE)
cd $(SRC_BASE) && $(MAKE) $@
cd $(SRC_SHARE) && $(MAKE) $@
cd $(SRC_SCRIPTS) && $(MAKE) $@
cd $(SRC_CONFIG) && $(MAKE) $@
chmod a+r $(SRC_CONTRIB)/ssi/status-header.ssi
@echo ""
@echo "*** Compile finished ***"
@echo ""
@echo " make install"
@echo " - This installs the main program and HTML files"
@echo " - This installs directories, binaries and php files"
@echo ""
@echo " make install-selinux"
@echo " - This installs the selinux setup (if you are using selinux)"
@echo ""
@echo ""
@echo " make fullinstall"
@echo " - This installs the main program, runlevel scripts, config and HTML files"
@echo " - install everything "
@echo ""
@echo "Enjoy."
@echo ""
# this section from autoconf doc suggestions
# reautoconf if config changed
configure: configure.ac
autoconf
# autoheader might not change config.h.in, so touch a stamp file.
include/config.h.in: include/stamp-h.in ;
include/stamp-h.in: configure.ac
autoheader
date -Is > 'include/stamp-h.in'
include/config.h: include/stamp-h ;
include/stamp-h: include/config.h.in config.status
./config.status
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status --recheck
scripts:
cd $(SRC_SCRIPTS) && $(MAKE)
cd $(SRC_SCRIPTS) && $(MAKE) $@
share:
cd $(SRC_SHARE) && $(MAKE)
cd $(SRC_SHARE) && $(MAKE) $@
clean:
cd $(SRC_BASE) && $(MAKE) $@
@@ -75,6 +110,8 @@ clean:
-rm -f *.cfg core
-rm -f *~ *.*~ */*~ */*.*~
-rm -f config.log config.status config.cache
@SE@ rm -f pnp4nagios.fc
@SE@ rm -f pnp4nagios.if pnp4nagios.pp* tmp
distclean:
cd $(SRC_BASE) && $(MAKE) $@
@@ -89,56 +126,16 @@ distclean:
rm -f Makefile include/stamp-h1 include/config.h config.status config.log
rm -f subst summary
rm -f $(SRC_CONTRIB)/ssi/status-header.ssi
rm -f $(SRC_CONTRIB)/fedora/pnp4nagios.logrotate.conf
rm -f $(SRC_CONTRIB)/fedora/logwatch/conf/logfiles/pnp4nagios.conf
@SE@ rm -f pnp4nagios.fc pnp4nagios.if pnp4nagios.pp* tmp
devclean: distclean
install-html:
cd $(SRC_SHARE) && $(MAKE) install
install-base:
cd $(SRC_BASE) && $(MAKE) install
install-man:
cd $(SRC_MAN) && $(MAKE) install
install-processperfdata:
cd $(SRC_SCRIPTS) && $(MAKE) install
install-init:
cd $(SRC_SCRIPTS) && $(MAKE) $@
install-config:
cd $(SRC_CONFIG) && $(MAKE) $@
@echo ""
@echo "*** PNP4Nagios sample config files installed ***"
@echo ""
@echo "Please run 'make install-init' if you want to use"
@echo "BULK Mode with NPCD"
@echo ""
@echo ""
@echo ""
install-webconf:
cd $(SRC_CONFIG) && $(MAKE) $@
@echo ""
@echo "*** Apache config file installed ***"
@echo ""
@echo "Restart your apache webserver to activete your changes."
@echo ""
@echo "Please run 'make install-config' to install sample"
@echo "configuration files"
@echo ""
@echo "Please run 'make install-init' if you want to use"
@echo "BULK Mode with NPCD"
@echo ""
@echo ""
@echo ""
install-plugins:
cd $(SRC_SCRIPTS) && $(MAKE) $@
install:
cd $(SRC_BASE) && $(MAKE) $@
@@ -147,37 +144,63 @@ install:
if [ x$(KOHANA) = xyes ]; then \
cd $(SRC_LIB) && $(MAKE) $@; \
fi
cd $(SRC_SCRIPTS) && $(MAKE) $@
cd $(SRC_CONFIG) && $(MAKE) $@
$(INSTALL) $(HTTP_INSTALL_OPTS) -d $(DESTDIR)$(CACHE_DIR)
@echo ""
@echo "*** Main program, Scripts and HTML files installed ***"
@echo ""
@echo "Please run 'make install-webconf' to install the"
@echo "web configuration file"
@echo ""
@echo "Please run 'make install-config' to install sample"
@echo "configuration files"
@echo ""
@echo "Please run 'make install-init' if you want to use"
@echo "BULK Mode with NPCD"
@echo ""
@echo ""
@echo ""
# Nagios might have some pnp4nagios selinux entries
# so mask out duplicates.
install-selinux:
@SE@ -rm nagios.pp
@SE@ -semodule -E nagios 2>/dev/null >/dev/null
@SE@ if [ -e nagios.pp ] ; then \
@SE@ semodule_unpackage nagios.pp nagios.mod nagios.fc ; \
@SE@ for pnpdir in /etc/pnp4nagios /var/log/pnp4nagios /var/lib/pnp4nagios /usr/lib/pnp4nagios ; \
@SE@ do \
@SE@ if grep -q "^$pnpdir" nagios.fc ; \
@SE@ then \
@SE@ sed -i "\\|^$pnpdir|s/^/#/" pnp4nagios.fc ; \
@SE@ fi \
@SE@ done \
@SE@ fi
@SE@ $(MAKE) -f $(SELINUX_DEVELDIR)/Makefile load
@SE@ fixfiles restore @datadir@ @pkgsysconfdir@
@SE@ fixfiles restore @PERFDATA_DIR@ @logdir@
@SE@ fixfiles restore @PERFDATA_SPOOL_DIR@ @piddir@
install-unstripped:
cd $(SRC_BASE) && $(MAKE) $@
cd $(SRC_SHARE) && $(MAKE) $@
cd $(SRC_SCRIPTS) && $(MAKE) $@
$(MAKE) install-basic
fullinstall: install install-webconf install-config install-init
fullinstall:
$(MAKE) install
$(MAKE) install-selinux
$(PERL) summary fullinstall
@echo ""
@echo "*** Main program, Scripts and HTML files installed ***"
@echo "Config files in: @pkgsysconfdir@ might need updating."
@echo ""
@echo ""
@echo "Enjoy."
@echo ""
dist:
ci/maketar.sh $(VERSION)
mv ci/pnp4nagios*.tgz .
mv ci/pnp4nagios*.zip .

10
README
View File

@@ -1,10 +0,0 @@
#########################
# #
# README #
# #
#########################
See our online documentation at:
http://pnp4nagios.sourceforge.net or:
http://docs.pnp4nagios.org/

67
README.md Normal file
View File

@@ -0,0 +1,67 @@
# PNP4Nagios
The new/current place for the pnp4nagios organization is
https://github.com/pnp4nagios
With this *particular* version residing in
https://github.com/pnp4nagios/pnp4nagios
This is a fork of [@lingej's original pnp4nagios package](https://github.com/lingej/pnp4nagios).
As a long-time user of `pnpnagios`, I am trying to give the project a
good home as we work to further develop and enhance this project. Please
contact me if you would like to help.
The original source was retired on commit 5e09f538373ac4310a13355746bb3d3a10eb7bef
(Version pnp-0.6.?? ??/??/2017 on 2022/Jan/16). Many thanks to Joerg Linge and his
awesome contributors for what we have, now!
## Getting Started
For now, I'm advocating installing from source (**my** source), as we move
forward into further developing this project.
Instructions can be found in
[this gist](https://gist.github.com/russellvt/051fa43592778a41e53cb423b791bab6).
## Documentation
The old site for documentation at https://docs.pnp4nagios.org is no longer
up; the replacement is https://github.com/pnp4nagios/docs
It's possible that there are still some references to the old site scattered
here and there.
## About Me
I am a long time Nagios/Icinga/Monitoring/Devops Professional. I've been
"the toolsguy" long from "devops" was even a "new" term.
## build RPM from git
The spec file is in the "ci" subdirectory. Install git-build-rpm (it's on
github, surprise!) and, as an example:
HERE=(main directory of this git package; where this README.md file is located)
cd $HERE
autoconf # builds 'configure'
./configure # builds 'ci/pnp4nagios.spec'
git build-rpm --rpm-dir /home/local/lane/rpmbuild --spec ci/pnp4nagios.spec --dist .fc35
The --rpm-dir option is to keep the .srpm file from the build (it will be
in your usual SRPMS subdirectory in your rpmbuild tree), the
--dist option is to avoid the longwinded "-%{version}-%{release}%{timestamp}.%{dist}..." package name. The rpms will get copied from the rpmbuild tree to
$HERE.
You can also just get the source code, do a
autoconf
./configure
then
make all
etc....but some of us (me) prefers to have a software package, to organize
software installation/update/removal.

2
THANKS
View File

@@ -2,6 +2,8 @@
# PNP Thanks #
###########################################
Russell M. Van Tassell - Taking over from 0.6.26+CVE-2017-16384
Olivier PLATHEY - For providing FPDF
Sven Nierlein - For providing mod_gearman
Michal Wojciechowski - For providing imgAreaSelect

54
aclocal.m4 vendored Executable file
View File

@@ -0,0 +1,54 @@
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ([2.52])dnl
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
m4_include([autoconf-macros/ax_nagios_get_os])
m4_include([autoconf-macros/ax_nagios_get_distrib])
m4_include([autoconf-macros/ax_nagios_get_init])
m4_include([autoconf-macros/ax_nagios_get_paths])
m4_include([autoconf-macros/ax_nagios_get_files])

1
autoconf-macros/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
nbproject/

View File

@@ -0,0 +1,7 @@
1.0.1
-----
* Fix bug determining inetd,xinetd if neither are running (Bryan Heden)
1.0.0
-----
* Initial Release (John Frickson)

264
autoconf-macros/LICENSE Normal file
View File

@@ -0,0 +1,264 @@
The GNU General Public License, Version 2, June 1991 (GPLv2)
============================================================
> Copyright (C) 1989, 1991 Free Software Foundation, Inc.
> 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
--------
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public License is intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users. This General Public License applies to most
of the Free Software Foundation's software and to any other program whose
authors commit to using it. (Some other Free Software Foundation software is
covered by the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom to
distribute copies of free software (and charge for this service if you wish),
that you receive source code or can get it if you want it, that you can change
the software or use pieces of it in new free programs; and that you know you can
do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny
you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of the
software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a
fee, you must give the recipients all the rights that you have. You must make
sure that they, too, receive or can get the source code. And you must show them
these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer
you this license which gives you legal permission to copy, distribute and/or
modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If the
software is modified by someone else and passed on, we want its recipients to
know that what they have is not the original, so that any problems introduced by
others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish
to avoid the danger that redistributors of a free program will individually
obtain patent licenses, in effect making the program proprietary. To prevent
this, we have made it clear that any patent must be licensed for everyone's free
use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
Terms And Conditions For Copying, Distribution And Modification
---------------------------------------------------------------
**0.** This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms of
this General Public License. The "Program", below, refers to any such program or
work, and a "work based on the Program" means either the Program or any
derivative work under copyright law: that is to say, a work containing the
Program or a portion of it, either verbatim or with modifications and/or
translated into another language. (Hereinafter, translation is included without
limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by
this License; they are outside its scope. The act of running the Program is not
restricted, and the output from the Program is covered only if its contents
constitute a work based on the Program (independent of having been made by
running the Program). Whether that is true depends on what the Program does.
**1.** You may copy and distribute verbatim copies of the Program's source code
as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this License
and to the absence of any warranty; and give any other recipients of the Program
a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at
your option offer warranty protection in exchange for a fee.
**2.** You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such
modifications or work under the terms of Section 1 above, provided that you also
meet all of these conditions:
* **a)** You must cause the modified files to carry prominent notices stating
that you changed the files and the date of any change.
* **b)** You must cause any work that you distribute or publish, that in whole
or in part contains or is derived from the Program or any part thereof, to
be licensed as a whole at no charge to all third parties under the terms of
this License.
* **c)** If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use in the
most ordinary way, to print or display an announcement including an
appropriate copyright notice and a notice that there is no warranty (or
else, saying that you provide a warranty) and that users may redistribute
the program under these conditions, and telling the user how to view a copy
of this License. (Exception: if the Program itself is interactive but does
not normally print such an announcement, your work based on the Program is
not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License, and
its terms, do not apply to those sections when you distribute them as separate
works. But when you distribute the same sections as part of a whole which is a
work based on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the entire whole,
and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise the
right to control the distribution of derivative or collective works based on the
Program.
In addition, mere aggregation of another work not based on the Program with the
Program (or with a work based on the Program) on a volume of a storage or
distribution medium does not bring the other work under the scope of this
License.
**3.** You may copy and distribute the Program (or a work based on it, under
Section 2) in object code or executable form under the terms of Sections 1 and 2
above provided that you also do one of the following:
* **a)** Accompany it with the complete corresponding machine-readable source
code, which must be distributed under the terms of Sections 1 and 2 above on
a medium customarily used for software interchange; or,
* **b)** Accompany it with a written offer, valid for at least three years, to
give any third party, for a charge no more than your cost of physically
performing source distribution, a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of Sections 1
and 2 above on a medium customarily used for software interchange; or,
* **c)** Accompany it with the information you received as to the offer to
distribute corresponding source code. (This alternative is allowed only for
noncommercial distribution and only if you received the program in object
code or executable form with such an offer, in accord with Subsection b
above.)
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all the
source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and installation
of the executable. However, as a special exception, the source code distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
If distribution of executable or object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the source code
from the same place counts as distribution of the source code, even though third
parties are not compelled to copy the source along with the object code.
**4.** You may not copy, modify, sublicense, or distribute the Program except as
expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate
your rights under this License. However, parties who have received copies, or
rights, from you under this License will not have their licenses terminated so
long as such parties remain in full compliance.
**5.** You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Program or its derivative works. These actions are prohibited by law if you do
not accept this License. Therefore, by modifying or distributing the Program (or
any work based on the Program), you indicate your acceptance of this License to
do so, and all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
**6.** Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these terms and
conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties to this License.
**7.** If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues), conditions
are imposed on you (whether by court order, agreement or otherwise) that
contradict the conditions of this License, they do not excuse you from the
conditions of this License. If you cannot distribute so as to satisfy
simultaneously your obligations under this License and any other pertinent
obligations, then as a consequence you may not distribute the Program at all.
For example, if a patent license would not permit royalty-free redistribution of
the Program by all those who receive copies directly or indirectly through you,
then the only way you could satisfy both it and this License would be to refrain
entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply and the
section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or
other property right claims or to contest validity of any such claims; this
section has the sole purpose of protecting the integrity of the free software
distribution system, which is implemented by public license practices. Many
people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose that
choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
**8.** If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Program under this License may add an explicit
geographical distribution limitation excluding those countries, so that
distribution is permitted only in or among countries not thus excluded. In such
case, this License incorporates the limitation as if written in the body of this
License.
**9.** The Free Software Foundation may publish revised and/or new versions of
the General Public License from time to time. Such new versions will be similar
in spirit to the present version, but may differ in detail to address new
problems or concerns.
Each version is given a distinguishing version number. If the Program specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Program does not specify a version number of this License, you may choose any
version ever published by the Free Software Foundation.
**10.** If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation,
write to the Free Software Foundation; we sometimes make exceptions for this.
Our decision will be guided by the two goals of preserving the free status of
all derivatives of our free software and of promoting the sharing and reuse of
software generally.
No Warranty
-----------
**11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
**12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

264
autoconf-macros/LICENSE.md Normal file
View File

@@ -0,0 +1,264 @@
The GNU General Public License, Version 2, June 1991 (GPLv2)
============================================================
> Copyright (C) 1989, 1991 Free Software Foundation, Inc.
> 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
Preamble
--------
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public License is intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users. This General Public License applies to most
of the Free Software Foundation's software and to any other program whose
authors commit to using it. (Some other Free Software Foundation software is
covered by the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom to
distribute copies of free software (and charge for this service if you wish),
that you receive source code or can get it if you want it, that you can change
the software or use pieces of it in new free programs; and that you know you can
do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny
you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of the
software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a
fee, you must give the recipients all the rights that you have. You must make
sure that they, too, receive or can get the source code. And you must show them
these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer
you this license which gives you legal permission to copy, distribute and/or
modify the software.
Also, for each author's protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If the
software is modified by someone else and passed on, we want its recipients to
know that what they have is not the original, so that any problems introduced by
others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish
to avoid the danger that redistributors of a free program will individually
obtain patent licenses, in effect making the program proprietary. To prevent
this, we have made it clear that any patent must be licensed for everyone's free
use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
Terms And Conditions For Copying, Distribution And Modification
---------------------------------------------------------------
**0.** This License applies to any program or other work which contains a notice
placed by the copyright holder saying it may be distributed under the terms of
this General Public License. The "Program", below, refers to any such program or
work, and a "work based on the Program" means either the Program or any
derivative work under copyright law: that is to say, a work containing the
Program or a portion of it, either verbatim or with modifications and/or
translated into another language. (Hereinafter, translation is included without
limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by
this License; they are outside its scope. The act of running the Program is not
restricted, and the output from the Program is covered only if its contents
constitute a work based on the Program (independent of having been made by
running the Program). Whether that is true depends on what the Program does.
**1.** You may copy and distribute verbatim copies of the Program's source code
as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this License
and to the absence of any warranty; and give any other recipients of the Program
a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at
your option offer warranty protection in exchange for a fee.
**2.** You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such
modifications or work under the terms of Section 1 above, provided that you also
meet all of these conditions:
* **a)** You must cause the modified files to carry prominent notices stating
that you changed the files and the date of any change.
* **b)** You must cause any work that you distribute or publish, that in whole
or in part contains or is derived from the Program or any part thereof, to
be licensed as a whole at no charge to all third parties under the terms of
this License.
* **c)** If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use in the
most ordinary way, to print or display an announcement including an
appropriate copyright notice and a notice that there is no warranty (or
else, saying that you provide a warranty) and that users may redistribute
the program under these conditions, and telling the user how to view a copy
of this License. (Exception: if the Program itself is interactive but does
not normally print such an announcement, your work based on the Program is
not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License, and
its terms, do not apply to those sections when you distribute them as separate
works. But when you distribute the same sections as part of a whole which is a
work based on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the entire whole,
and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise the
right to control the distribution of derivative or collective works based on the
Program.
In addition, mere aggregation of another work not based on the Program with the
Program (or with a work based on the Program) on a volume of a storage or
distribution medium does not bring the other work under the scope of this
License.
**3.** You may copy and distribute the Program (or a work based on it, under
Section 2) in object code or executable form under the terms of Sections 1 and 2
above provided that you also do one of the following:
* **a)** Accompany it with the complete corresponding machine-readable source
code, which must be distributed under the terms of Sections 1 and 2 above on
a medium customarily used for software interchange; or,
* **b)** Accompany it with a written offer, valid for at least three years, to
give any third party, for a charge no more than your cost of physically
performing source distribution, a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of Sections 1
and 2 above on a medium customarily used for software interchange; or,
* **c)** Accompany it with the information you received as to the offer to
distribute corresponding source code. (This alternative is allowed only for
noncommercial distribution and only if you received the program in object
code or executable form with such an offer, in accord with Subsection b
above.)
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means all the
source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and installation
of the executable. However, as a special exception, the source code distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
If distribution of executable or object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the source code
from the same place counts as distribution of the source code, even though third
parties are not compelled to copy the source along with the object code.
**4.** You may not copy, modify, sublicense, or distribute the Program except as
expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate
your rights under this License. However, parties who have received copies, or
rights, from you under this License will not have their licenses terminated so
long as such parties remain in full compliance.
**5.** You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Program or its derivative works. These actions are prohibited by law if you do
not accept this License. Therefore, by modifying or distributing the Program (or
any work based on the Program), you indicate your acceptance of this License to
do so, and all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
**6.** Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these terms and
conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties to this License.
**7.** If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues), conditions
are imposed on you (whether by court order, agreement or otherwise) that
contradict the conditions of this License, they do not excuse you from the
conditions of this License. If you cannot distribute so as to satisfy
simultaneously your obligations under this License and any other pertinent
obligations, then as a consequence you may not distribute the Program at all.
For example, if a patent license would not permit royalty-free redistribution of
the Program by all those who receive copies directly or indirectly through you,
then the only way you could satisfy both it and this License would be to refrain
entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply and the
section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or
other property right claims or to contest validity of any such claims; this
section has the sole purpose of protecting the integrity of the free software
distribution system, which is implemented by public license practices. Many
people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose that
choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
**8.** If the distribution and/or use of the Program is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Program under this License may add an explicit
geographical distribution limitation excluding those countries, so that
distribution is permitted only in or among countries not thus excluded. In such
case, this License incorporates the limitation as if written in the body of this
License.
**9.** The Free Software Foundation may publish revised and/or new versions of
the General Public License from time to time. Such new versions will be similar
in spirit to the present version, but may differ in detail to address new
problems or concerns.
Each version is given a distinguishing version number. If the Program specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Program does not specify a version number of this License, you may choose any
version ever published by the Free Software Foundation.
**10.** If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Foundation,
write to the Free Software Foundation; we sometimes make exceptions for this.
Our decision will be guided by the two goals of preserving the free status of
all derivatives of our free software and of promoting the sharing and reuse of
software generally.
No Warranty
-----------
**11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
**12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

199
autoconf-macros/README.md Normal file
View File

@@ -0,0 +1,199 @@
autoconf-macros
===============
The purpose of Nagios autoconf-macros is to have a central place for
autoconf macros that can be maintained in one place, but be used by any
of the Nagios software. It is intended to be used as a git subtree.
See the [Usage](#usage) and [References](#references) sections below.
Since this project will be included in several parent projects, any
changes must be as project-neutral as possible.
Make sure to check out the [CHANGELOG](CHANGELOG.md) for relevant
information, as well.
Contents
--------
The collection consists of the following macros:
### AX_NAGIOS_GET_OS alias AC_NAGIOS_GET_OS
> Output Variable : `opsys`
This macro detects the operating system, and transforms it into a generic
label. The most common OS's that use Nagios software are recognized and
used in subsequent macros.
### AX_NAGIOS_GET_DISTRIB_TYPE alias AC_NAGIOS_GET_DISTRIB_TYPE
> Output Variables : `dist_type`, `dist_ver`
This macro detects the distribution type. For Linux, this would be rh
(for Red Hat and derivatives), suse (OpenSUSE, SLES, derivatives), gentoo
(Gentoo and derivatives), debian (Debian and derivatives), and so on.
For BSD, this would be openbsd, netbsd, freebsd, dragonfly, etc. It can
also be aix, solaris, osx, and so on for Unix operating systems.
### AX_NAGIOS_GET_INIT alias AC_NAGIOS_GET_INIT
> Output Variable : `init_type`
This macro detects what software is used to start daemons on bootup
or on request, generally knows as the "init system". The init_type
will generally be one of sysv (many), bsd (Slackware), newbsd (*BSD),
launchd (OS X), smf10 or smf11 (Solaris), systemd (newer Linux),
gentoo (older Gentoo), upstart (several), or unknown.
### AX_NAGIOS_GET_INETD alias AC_NAGIOS_GET_INETD
> Output Variable : `inetd_type`
This macro detects what software is used to start daemons or services
on demand, which historically has been "inetd". The inetd_type
will generally be one of inetd, xinetd, launchd (OS X), smf10 or smf11
(Solaris), systemd (newer Linux), upstart (several), or unknown.
### AX_NAGIOS_GET_PATHS alias AC_NAGIOS_GET_PATHS
> Output Variables : **many!**
This macro determines the installation paths for binaries, config files,
PID files, and so on. For a "standard" install of Nagios, NRPE, NDO Utils,
etc., most will be in the /usr/local/nagios hierarchy with startup files
located in /etc. For distributions or software repositories, the
"--enable-install-method=os" option can be used. This will determine the
O/S dependent directories, such as /usr/bin, /usr/sbin, /var/lib/nagios,
/usr/lib/nagios, etc. or for OS X, /Library/LaunchDaemons.
### AX_NAGIOS_GET_FILES alias AC_NAGIOS_GET_FILES
> Output Variables : `src_init`, `src_inetd`, `src_tmpfile`
Each Nagios project will have a top-level directory named "/startup/".
In that directory will be "*.in" files for the various "init_type" and
"inetd_type" systems. This macro will determine which file(s) from
that directory will be needed.
### AX_NAGIOS_GET_SSL alias AC_NAGIOS_GET_SSL
> Output Variables : `HAVE_KRB5_H`, `HAVE_SSL`, `SSL_INC_DIR`, `SSL_LIB_DIR`, `CFLAGS`, `LDFLAGS`, `LIBS`
This macro checks various directories for SSL libraries and header files.
The searches are based on known install locations on various operating
systems and distributions, for openssl, gnutls-openssl, and nss_compat_ossl.
If it finds the headers and libraries, it will then do an `AC_LINK_IFELSE`
on a simple program to make sure a compile and link will work correctly.
Usage
-----
This repo is intended to be used as a git subtree, so changes will
automatically propagate, and still be reasonably easy to use.
* First, Create, checkout, clone, or branch your project. If you do an
`ls -AF` it might look something like this:
.git/ .gitignore ChangeLog LICENSE Makefile.in
README configure.ac include/ src/
* Then make a reference to _this_ project inside your project.
git remote add autoconf-macros git@github.com:NagiosEnterprises/autoconf-macros
git subtree add --prefix=macros/ autoconf-macros master
* After executing the above two commands, if you do an `ls -AF` now,
it should look like this:
.git/ .gitignore ChangeLog LICENSE Makefile.in
README configure.ac include/ macros/ src/
* The `macros/` directory has been added.
* Now do a `git push` to save everything.
* If you make any changes to autoconf-macros, commit them separately
from any parent-project changes to keep from polluting the commit
history with unrelated comments.
* To submit your changes to autoconf-macros:
git subtree push --prefix=macros autoconf-macros peters-updates
This will create a new branch called `peters-updates`. You then need to
create a _pull request_ to get your changes merged into autoconf-macros
master.
* To get the latest version of `autoconf-macros` into your parent project:
git subtgree pull --squash --prefix=macros autoconf-macros master
References
----------
Now that autoconf-macros is available to your project, you will need to
reference it.
* Create (or add these lines to) file `YourProject/aclocal.m4`
m4_include([macros/ax_nagios_get_os])
m4_include([macros/ax_nagios_get_distrib])
m4_include([macros/ax_nagios_get_init])
m4_include([macros/ax_nagios_get_inetd])
m4_include([macros/ax_nagios_get_paths])
m4_include([macros/ax_nagios_get_files])
m4_include([macros/ax_nagios_get_ssl])
* In your `YourProject/configure.ac` add the following lines. A good place
to put them would be right after any `AC_PROG_*` entries:
AC_NAGIOS_GET_OS
AC_NAGIOS_GET_DISTRIB_TYPE
AC_NAGIOS_GET_INIT
AC_NAGIOS_GET_INETD
AC_NAGIOS_GET_PATHS
AC_NAGIOS_GET_FILES
* If you need SSL functionality, add the following to `YourProject/configure.ac`
where you want to check for SSL:
AC_NAGIOS_GET_SSL
* You will now be able to reference any of the variables in `config.h.in`
and any files listed in the `AC_CONFIG_FILES` macro in `configure.ac`.
License Notice
--------------
Copyright (c) 2016-2017 Nagios Enterprises, LLC
This work is made available to you under the terms of Version 2 of
the GNU General Public License. A copy of that license should have
been provided with this software, but in any event can be obtained
from http://www.fsf.org.
This work is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 or visit their web page on the internet at
http://www.fsf.org.
Questions?
----------
If you have questions about this addon, or problems getting things
working, first try searching the nagios-users mailing list archives.
Details on searching the list archives can be found at
http://www.nagios.org
If you don't find an answer there, post a message in the Nagios
Plugin Development forum at https://support.nagios.com/forum/viewforum.php?f=35

164
autoconf-macros/add_group_user Executable file
View File

@@ -0,0 +1,164 @@
#!/bin/sh
#----------------------
# Initialize variables
#----------------------
dist="$1"
uid="$2"
gid="$3"
rc=0
#------------------------------------------------------------------
# Determine if the user should be created with a shell environment
# 0 = no shell (more secure)
# 1 = shell (less secure but sometimes required)
#------------------------------------------------------------------
shell=0
if [ $# -eq 4 ]; then
if [ x$4 = x1 ]; then
shell=1
fi
fi
#-------------------------------------
# Check if the specified group exists
#-------------------------------------
group_exists(){
case $dist in
osx) rc=`dscl . -read /Groups/$gid >/dev/null 2>&1; echo $?` ;;
hpux) rc=`grget -n $gid >/dev/null 2>&1; echo $?` ;;
aix) rc=`lsgroup -a $gid >/dev/null 2>&1; echo $?` ;;
*) rc=`getent group $gid > /dev/null 2>&1; echo $?` ;;
esac
echo $rc
}
#------------------------
# Add the specified user
#------------------------
add_user(){
rc=`id "$uid" > /dev/null 2>&1; echo $?`
if test $rc -eq 0; then
echo "User $uid already exists" > /dev/stderr
echo 0
return
fi
case $dist in
aix)
echo useradd -g $gid $uid > /dev/stderr
rc=`useradd -g $gid $uid; echo $?`
;;
hpux)
echo useradd -m -g $gid $uid > /dev/stderr
rc=`useradd -m -g $gid $uid; echo $?`
;;
solaris)
echo useradd -m -d /export/home/$uid -g $gid $uid > /dev/stderr
rc=`useradd -m -d /export/home/$uid -g $gid $uid; echo $?`
;;
osx)
newid=`dscl . -list /Users UniqueID | tr -s ' ' | cut -d' ' -f2 | sort -n | tail -1`
newid=`expr 1 + $newid`
echo dscl . -create /Users/$uid > /dev/stderr
dscl . -create /Users/$uid
echo dscl . -create /Users/$uid UniqueID $newid > /dev/stderr
dscl . -create /Users/$uid UniqueID $newid
if [ $shell = 0 ]; then
echo dscl . -create /Users/$uid UserShell /usr/bin/false > /dev/stderr
dscl . -create /Users/$uid UserShell /usr/bin/false
fi
echo dscl . -create /Users/$uid PrimaryGroupID 20 > /dev/stderr
dscl . -create /Users/$uid PrimaryGroupID 20
echo dscl . -append /Groups/$gid GroupMembership $uid > /dev/stderr
rc=`dscl . -append /Groups/$gid GroupMembership $uid; echo $?`
;;
freebsd)
if [ $shell = 0 ]; then
echo pw add user $uid -g $gid -s /usr/bin/false > /dev/stderr
rc=`pw add user $uid -g $gid -s /usr/bin/false; echo $?`
else
echo pw add user $uid -g $gid > /dev/stderr
rc=`pw add user $uid -g $gid; echo $?`
fi
;;
netbsd|openbsd)
echo useradd -g $gid $uid > /dev/stderr
rc=`useradd -g $gid $uid; echo $?`
;;
*)
if [ $shell = 0 ]; then
echo useradd -r -g $gid $uid > /dev/stderr
rc=`useradd -r -g $gid $uid; echo $?`
else
echo useradd -g $gid $uid > /dev/stderr
rc=`useradd -g $gid $uid; echo $?`
fi
;;
esac
echo $rc
}
#-------------------------
# Add the specified group
#-------------------------
add_group(){
rc=`group_exists`
if test $rc -eq 0; then
echo "Group $gid already exists" > /dev/stderr
echo 0
return
fi
case $dist in
aix)
echo mkgroup $gid > /dev/stderr
rc=`mkgroup "$gid"; echo $?`
;;
hpux|solaris)
echo groupadd $gid > /dev/stderr
rc=`groupadd "$gid"; echo $?`
;;
osx)
newid=`dscl . -list /Groups gid | tr -s ' ' | cut -d' ' -f2 | sort -n | tail -1`
newid=`expr 1 + $newid`
echo dscl . -create /Groups/$gid gid $newid > /dev/stderr
rc=`dscl . -create /Groups/$gid gid $newid; echo $?`
;;
freebsd)
echo pw add group $gid > /dev/stderr
rc=`pw add group $gid; echo $?`
;;
netbsd|openbsd)
echo groupadd $gid > /dev/stderr
rc=`groupadd $gid; echo $?`
;;
*)
echo groupadd -r $gid > /dev/stderr
rc=`groupadd -r $gid; echo $?`
;;
esac
echo $rc
}
rc=`add_group`
if test $rc -ne 0; then
exit 1;
fi
rc=`add_user`
exit $rc

View File

@@ -0,0 +1,160 @@
# ===========================================================================
# SYNOPSIS
#
# AX_NAGIOS_GET_DISTRIB_TYPE
#
# DESCRIPTION
#
# This macro determines the O/S distribution of the computer it is run on.
# $dist_type will be set and will be one of:
# unknown (could not be determined)
# freebsd, netbsd, openbsd, dragonfly, etc (The BSDs)
# suse, rh, debian, gentoo (and possibly their descendants)
# Other major Linux distributions (and possibly their descendants)
# The O/S name for the rest
#
# LICENSE
#
# Copyright (c) 2016 Nagios Core Development Team
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
# ===========================================================================
AU_ALIAS([AC_NAGIOS_GET_DISTRIB_TYPE], [AX_NAGIOS_GET_DISTRIB_TYPE])
AC_DEFUN([AX_NAGIOS_GET_DISTRIB_TYPE],
[
AC_SUBST(dist_type)
AC_SUBST(dist_ver)
#
# Get user hints for possible cross-compile
#
AC_MSG_CHECKING(what the distribution type is )
AC_ARG_WITH(dist-type, AS_HELP_STRING([--with-dist-type=type],
[specify distribution type (suse, rh, debian, etc.)]),
[
#
# Run this if --with was specified
#
if test "x$withval" = x -o x$withval = xno; then
dist_type_wanted=yes
else
dist_type_wanted=no
dist_type="$withval"
dist_ver="unknown"
AC_MSG_RESULT($dist_type)
fi
], [
#
# Run this if --with was not specified
#
dist_type_wanted=yes
])
if test x$dist_type = xno; then
dist_type_wanted=yes
elif test x$dist_type = xyes; then
AC_MSG_ERROR([you must enter a distribution type if '--with-dist-type' is specified])
fi
#
# Determine distribution type if it wasn't supplied
#
dist_ver="unknown"
if test $dist_type_wanted=yes; then
dist_type="unknown"
if test "$opsys" != "linux"; then
dist_type="$opsys"
AS_CASE([$opsys],
[bsd],
dist_type=`uname -s | tr ["[A-Z]" "[a-z]"]`
dist_ver=`uname -r`,
[aix],
dist_ver="`uname -v`.`uname -r`",
[hp-ux],
dist_ver=`uname -r | cut -d'.' -f1-3`,
[solaris],
dist_ver=`uname -r | cut -d'.' -f2`,
[*],
dist_ver=$OSTYPE
)
else
if test -r "/etc/gentoo-release"; then
dist_type="gentoo"
dist_ver=`cat /etc/gentoo-release`
elif test -r "/etc/os-release"; then
. /etc/os-release
if test x"$ID_LIKE" != x; then
dist_type=`echo $ID_LIKE | cut -d' ' -f1 | tr ["[A-Z]" "[a-z]"]`
elif test x"$ID" = xol; then
dist_type=rh
else
dist_type=`echo $ID | tr ["[A-Z]" "[a-z]"]`
fi
if test x"$dist_type" = sles; then
dist_type=suse
fi
if test x"$VERSION_ID" != x; then
dist_ver=$VERSION_ID
elif test x"$VERSION" != x; then
dist_ver=`echo $VERSION | cut -d'.' -f1 | tr -d [:alpha:][:blank:][:punct:]`
fi
elif test -r "/etc/redhat-release"; then
dist_type=rh
dist_ver=`cat /etc/redhat-release`
elif test -r "/etc/debian_version"; then
dist_type="debian"
if test -r "/etc/lsb-release"; then
. /etc/lsb-release
dist_ver=`echo "$DISTRIB_RELEASE"`
else
dist_ver=`cat /etc/debian_version`
fi
elif test -r "/etc/SuSE-release"; then
dist_type=suse
dist_ver=`grep VERSION /etc/SuSE-release`
fi
fi
if test "$dist_ver" != "unknown"; then
dist_ver=`echo "$dist_ver" | cut -d'.' -f1 | tr -d [:alpha:][:blank:][:punct:]`
fi
fi
AC_MSG_RESULT($dist_type)
])

View File

@@ -0,0 +1,131 @@
# ===========================================================================
# SYNOPSIS
#
# AX_NAGIOS_GET_FILES
#
# DESCRIPTION
#
# This macro figures out which init and/or inetd files to use based
# on the results of the AX_NAGIOS_GET_OS, AX_NAGIOS_GET_DISTRIB_TYPE,
# AX_NAGIOS_GET_INIT and AX_NAGIOS_GET_INETD macros. It will select
# the appropriate files(s) from the 'startup' directory and copy it.
#
# LICENSE
#
# Copyright (c) 2016 Nagios Core Development Team
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
# ===========================================================================
AU_ALIAS([AC_NAGIOS_GET_FILES], [AX_NAGIOS_GET_FILES])
AC_DEFUN([AX_NAGIOS_GET_FILES],
[
AC_SUBST(src_init)
AC_SUBST(src_inetd)
AC_SUBST(src_tmpfile)
AC_SUBST(bsd_enable)
src_inetd=""
src_init=""
bsd_enable=""
AC_MSG_CHECKING(for which init file to use )
AS_CASE([$init_type],
[sysv],
src_init=default-init,
[systemd],
src_tmpfile=tmpfile.conf
src_init=default-service,
[bsd],
src_init=bsd-init,
[newbsd],
if test $dist_type = freebsd ; then
bsd_enable="_enable"
src_init=default-init
elif test $dist_type = openbsd ; then
bsd_enable="_flags"
src_init=openbsd-init
elif test $dist_type = netbsd ; then
bsd_enable=""
src_init=newbsd-init
fi,
# [gentoo],
[openrc],
src_init=openrc-init,
[smf*],
src_init="solaris-init.xml"
src_inetd="solaris-inetd.xml",
[upstart],
if test $dist_type = rh ; then
src_init=rh-upstart-init
else
src_init=upstart-init
fi,
[launchd],
src_init="mac-init.plist",
[*],
src_init="unknown"
)
AC_MSG_RESULT($src_init)
AC_MSG_CHECKING(for which inetd files to use )
if test x$src_inetd = x; then
AS_CASE([$inetd_type],
[inetd*],
src_inetd=default-inetd,
[xinetd],
src_inetd=default-xinetd,
[systemd],
src_inetd=default-socket,
[launchd],
src_inetd="mac-inetd.plist",
[*],
src_inetd="unknown"
)
fi
AC_MSG_RESULT($src_inetd)
])

View File

@@ -0,0 +1,200 @@
# ===========================================================================
# SYNOPSIS
#
# AX_NAGIOS_GET_INIT
#
# DESCRIPTION
#
# This macro determines the O/S distribution of the computer it is run on.
# $init_type will be set and will be one of:
# unknown (could not be determined)
# launchd (Mac OS X)
# bsd (Slackware Linux)
# newbsd (FreeBSD, OpenBSD, NetBSD, Dragonfly, etc)
# smf10 (Solaris)
# smf11 (Solaris)
# systemd (Linux SystemD)
# gentoo (Older Gentoo)
# openrc (Recent Gentoo and some others)
# upstart (Older Debian)
# sysv (The rest)
#
# LICENSE
#
# Copyright (c) 2016 Nagios Core Development Team
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
# ===========================================================================
AU_ALIAS([AC_NAGIOS_GET_INIT], [AX_NAGIOS_GET_INIT])
AC_DEFUN([AX_NAGIOS_GET_INIT],
[
AC_SUBST(init_type)
#
# Get user hints for possible cross-compile
#
AC_MSG_CHECKING(what init system is being used )
AC_ARG_WITH(init_type,AS_HELP_STRING([--with-init-type=type],
[specify init type (bsd, sysv, systemd, launchd, smf10, smf11, upstart,
openrc, etc.)]),
[
#
# Run this if --with was specified
#
if test "x$withval" = x -o x$withval = xno; then
init_type_wanted=yes
else
init_type_wanted=no
init_type="$withval"
AC_MSG_RESULT($init_type)
fi
], [
#
# Run this if --with was not specified
#
init_type_wanted=yes
])
if test x$init_type = xno; then
init_type_wanted=yes
elif test x$init_type = xyes; then
AC_MSG_ERROR([you must enter an init type if '--with-init-type' is specified])
fi
#
# Determine init type if it wasn't supplied
#
if test $init_type_wanted = yes; then
init_type=""
if test x"$opsys" = x; then
init_type="unknown"
init_type_wanted=no
elif test x"$dist_type" = x; then
init_type="unknown"
init_type_wanted=no
elif test "$opsys" = "osx"; then
init_type="launchd"
init_type_wanted=no
elif test "$opsys" = "bsd"; then
init_type="newbsd"
init_type_wanted=no
elif test "$dist_type" = "solaris"; then
if test -d "/lib/svc/manifest"; then
init_type="smf11"
init_type_wanted=no
elif test -d "/lib/svc/monitor"; then
init_type="smf10"
init_type_wanted=no
else
init_type="sysv"
init_type_wanted=no
fi
elif test "$dist_type" = "slackware"; then
init_type="bsd"
init_type_wanted=no
elif test "$dist_type" = "aix"; then
init_type="bsd"
init_type_wanted=no
elif test "$dist_type" = "hp-ux"; then
init_type="unknown"
init_type_wanted=no
fi
fi
PSCMD="ps -p1 -o args"
if test $dist_type = solaris; then
PSCMD="env UNIX95=1; ps -p1 -o args"
fi
if test "$init_type_wanted" = yes; then
pid1=`$PSCMD | grep -vi COMMAND | cut -d' ' -f1`
if test x"$pid1" = "x"; then
init_type="unknown"
init_type_wanted=no
fi
if `echo $pid1 | grep "systemd" > /dev/null`; then
init_type="systemd"
init_type_wanted=no
fi
if test "$init_type_wanted" = yes; then
if test "$pid1" = "init"; then
if test -e "/sbin/init"; then
pid1="/sbin/init";
elif test -e "/usr/sbin/init"; then
pid1="/usr/sbin/init"
else
init_type="unknown"
init_type_wanted=no
fi
fi
if test -L "$pid1"; then
pid1=`readlink "$pid1"`
fi
fi
if test "$init_type_wanted" = yes; then
if `echo $pid1 | grep "systemd" > /dev/null`; then
init_type="systemd"
init_type_wanted=no
elif test -f "/sbin/rc"; then
if test -f /sbin/runscript; then
init_type_wanted=no
if `/sbin/start-stop-daemon -V | grep "OpenRC" > /dev/null`; then
init_type="openrc"
else
init_type="gentoo"
fi
fi
fi
fi
if test "$init_type_wanted" = yes; then
if test "$pid1" = "/sbin/init" -o "$pid1" = "/usr/sbin/init"; then
if `$pid1 --version 2>/dev/null | grep "upstart" >/dev/null`; then
init_type="upstart"
init_type_wanted=no
elif test -f "/etc/rc" -a ! -L "/etc/rc"; then
init_type="newbsd"
init_type_wanted=no
else
init_type="sysv"
init_type_wanted=no
fi
fi
fi
if test "$init_type_wanted" = yes; then
init_type="unknown"
fi
fi
AC_MSG_RESULT($init_type)
])

View File

@@ -0,0 +1,101 @@
# ===========================================================================
# SYNOPSIS
#
# AX_NAGIOS_GET_OS
#
# DESCRIPTION
#
# This macro determines the operating system of the computer it is run on.
#
# LICENSE
#
# Copyright (c) 2016 Nagios Core Development Team
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
# ===========================================================================
AU_ALIAS([AC_NAGIOS_GET_OS], [AX_NAGIOS_GET_OS])
AC_DEFUN([AX_NAGIOS_GET_OS],
[
AC_SUBST(opsys)
AC_SUBST(arch)
#
# Get user hints
#
AC_MSG_CHECKING(what the operating system is )
AC_ARG_WITH(opsys, AS_HELP_STRING([--with-opsys=OS],
[specify operating system (linux, osx, bsd, solaris, irix, cygwin,
aix, hp-ux, etc.)]),
[
#
# Run this if --with was specified
#
if test "x$withval" = x -o x$withval = xno; then
opsys_wanted=yes
else
opsys_wanted=no
opsys="$withval"
AC_MSG_RESULT($opsys)
fi
], [
#
# Run this if --with was not specified
#
opsys_wanted=yes
])
if test x$opsys = xno; then
opsys=""
opsys_wanted=yes
elif test x$opsys = xyes; then
AC_MSG_ERROR([you must enter an O/S type if '--with-opsys' is specified])
fi
#
# Determine operating system if it wasn't supplied
#
if test $opsys_wanted=yes; then
opsys=`uname -s | tr ["[A-Z]" "[a-z]"]`
if test x"$opsys" = "x"; then opsys="unknown"; fi
AS_CASE([$opsys],
[darwin*], opsys="osx",
[*bsd*], opsys="bsd",
[dragonfly], opsys="bsd",
[sunos], opsys="solaris",
[gnu/hurd], opsys="linux",
[irix*], opsys="irix",
[cygwin*], opsys="cygwin",
[mingw*], opsys="mingw",
[msys*], opsys="msys")
fi
arch=`uname -m | tr ["[A-Z]" "[a-z]"]`
AC_MSG_RESULT($opsys)
])

View File

@@ -0,0 +1,783 @@
# ===========================================================================
# SYNOPSIS
#
# AX_NAGIOS_GET_PATHS
#
# DESCRIPTION
#
# This macro figures out the installation & run paths for various systems
# The argument are:
# the O/S determined by the AX_NAGIOS_GET_OS macro.
# the distribution type as determined by AX_NAGIOS_GET_DISTRIB_TYPE
# the init type as determined by AX_NAGIOS_GET_INIT
# the inetd type as determined by AX_NAGIOS_GET_INETD
#
# LICENSE
#
# Copyright (c) 2016 Nagios Core Development Team
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
# ===========================================================================
AU_ALIAS([AC_NAGIOS_GET_PATHS], [AX_NAGIOS_GET_PATHS])
AC_DEFUN([AX_NAGIOS_GET_PATHS],
[
AC_SUBST(pkgsysconfdir)
AC_SUBST(objsysconfdir)
AC_SUBST(initname)
AC_SUBST(inetdname)
AC_SUBST(pluginsdir)
AC_SUBST(brokersdir)
AC_SUBST(cgibindir)
AC_SUBST(webdir)
AC_SUBST(privatesysconfdir)
AC_SUBST(pkglocalstatedir)
AC_SUBST(logdir)
AC_SUBST(piddir)
AC_SUBST(pipedir)
AC_SUBST(spooldir)
AC_SUBST(initdir)
AC_SUBST(initdiroverridden)
AC_SUBST(inetddir)
AC_SUBST(tmpfilesd)
AC_SUBST(subsyslockdir)
AC_SUBST(subsyslockfile)
if test x$DBG_PATHS != x; then
echo
echo Incoming paths:
echo " prefix $prefix"
echo " exec_prefix $exec_prefix"
echo " bindir $bindir"
echo " libexecdir $libexecdir"
echo " sysconfdir $sysconfdir"
echo " localstatedir $localstatedir"
echo " datarootdir $datarootdir"
echo " datadir $datadir"
echo " localedir $localedir"
echo
fi
AC_MSG_CHECKING(for which paths to use )
AC_ARG_ENABLE(install_method,
AS_HELP_STRING([--enable-install-method=<method>],
[sets the install method to use: 'default' (the default) will install to
/usr/local/nagios, 'os' will try to determine which method to use based
on OS type and distribution. Fine tuning using the '--bindir', etc.
overrides above will still work]),
install_method=$enableval,
install_method=default
)
AC_ARG_ENABLE(showdirs_only,
AS_HELP_STRING([--enable-showdirs-only=yes],
[This option will cause 'configure' to stop after determining the install
locations based on '--enable-install-method', so you can see the
destinations before a full './configure', 'make', 'make install'
process.]),
showdirs_only=$enableval,
showdirs_only=no
)
AS_CASE([$install_method],
[yes], install_method="os",
[no], install_method="default",
[default|os], :,
[*], echo >&6; AC_MSG_ERROR(['--enable-install-method=$install_method' is invalid])
)
if test $showdirs_only != "no"; then showdirs_only="yes"; fi
AS_CASE([$dist_type],
[*solaris*|*hp-ux*|*aix*|*osx*], opsys=unix)
# Does this package need to know:
need_cgi=no # where the cgi-bin directory is
need_web=no # where the website directory is
need_brk=no # where the event broker modules directory is
need_plg=no # where the plugins directory is
need_pipe=no # where the pipe directory is
need_spl=no # where the spool directory is
need_loc=no # where the locale directory is
need_log_subdir=no # where the loc sub-directory is
need_etc_subdir=no # where the etc sub-directory is
need_pls_dir=no # where the package locate state directory is
if test x"$INIT_PROG" = x; then
INIT_PROG="$PKG_NAME"
fi
AS_CASE([$PKG_NAME],
[nagios],
need_log_subdir=yes
need_etc_subdir=yes
need_pls_dir=yes
need_brk=yes
need_pipe=yes
need_spl=yes
need_loc=yes
need_cgi=yes
need_web=yes,
[ndoutils],
need_brk=yes
need_spl=yes,
[nrpe],
need_plg=yes,
[nsca],
need_cgi=no,
[plugins],
need_loc=yes
need_plg=yes
)
AC_ARG_WITH(pkgsysconfdir, AS_HELP_STRING([--with-pkgsysconfdir=DIR],
[where configuration files should be placed]),
if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
pkgsysconfdir="$withval"
fi)
AC_ARG_WITH(objsysconfdir, AS_HELP_STRING([--with-objsysconfdir=DIR],
[where object configuration files should be placed]),
if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
objsysconfdir="$withval"
fi)
AC_ARG_WITH(privatesysconfdir, AS_HELP_STRING([--with-privatesysconfdir=DIR],
[where private configuration files should be placed]),
if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
privatesysconfdir="$withval"
fi)
AC_ARG_WITH(webdir, AS_HELP_STRING([--with-webdir=DIR],
[where the website files should be placed]),
if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
webdir="$withval"
fi)
AC_ARG_WITH(pluginsdir, AS_HELP_STRING([--with-pluginsdir=DIR],
[where the plugins should be placed]),
if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
pluginsdir="$withval"
fi)
AC_ARG_WITH(brokersdir, AS_HELP_STRING([--with-brokersdir=DIR],
[where the broker modules should be placed]),
if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
brokersdir="$withval"
fi)
AC_ARG_WITH(cgibindir, AS_HELP_STRING([--with-cgibindir=DIR],
[where the CGI programs should be placed]),
if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
cgibindir="$withval"
fi)
AC_ARG_WITH(logdir, AS_HELP_STRING([--with-logdir=DIR],
[where log files should be placed]),
if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
logdir="$withval"
fi)
AC_ARG_WITH(piddir, AS_HELP_STRING([--with-piddir=DIR],
[where the PID file should be placed]),
if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
piddir="$withval"
fi)
AC_ARG_WITH(pipedir, AS_HELP_STRING([--with-pipedir=DIR],
[where socket and pipe files should be placed]),
if test x$withval != x -a x$withval != xno -a x$withval != xyes; then
pipedir="$withval"
fi)
#
# Setup the base directory
#
if test $install_method = "default"; then
if test $opsys = "unix"; then
if test x"$prefix" = "xNONE"; then prefix="/usr/local/nagios"; fi
else
if test x"$prefix" = "xNONE"; then prefix=${ac_default_prefix}; fi
fi
datarootdir=${datarootdir="$prefix"}
else
if test x"$datadir" = x'${datarootdir}'; then AS_UNSET(datadir); fi
if test x"$sysconfdir" = x'${prefix}/etc'; then AS_UNSET(sysconfdir); fi
if test x"$prefix" = "xNONE"; then
if test $dist_type = freebsd -o $dist_type = openbsd -o $dist_type = osx; then
prefix="/usr/local"
elif test $dist_type = netbsd; then
prefix="/usr/pkg"
else
prefix="/usr"
fi
fi
if test x"$exec_prefix" = "xNONE"; then exec_prefix=$prefix; fi
if test x"$localstatedir" = x'${prefix}/var'; then
if test $dist_type = "osx"; then
localstatedir="/private/var"
else
localstatedir="/var"
fi
fi
if test $opsys = "unix"; then
if test x"$datarootdir" = x'${prefix}/share'; then
if test $dist_type = "hp-ux"; then
datarootdir="/usr/local/share"
if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
libexecdir="/usr/nagios"
fi
elif test $dist_type = "osx"; then
datarootdir="/usr/local/share"
if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
libexecdir="/usr/local/nagios"
fi
elif test x"$libexecdir" = x'${exec_prefix}/libexec'; then
libexecdir="/usr/lib/nagios"
fi
fi
if test $dist_type = "osx"; then
if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
libexecdir="/usr/local/libexec/nagios"
fi
fi
elif test $opsys = "bsd"; then
if test x"$libexecdir" = x'${exec_prefix}/libexec'; then
libexecdir=${exec_prefix}/libexec/nagios;
fi
elif test x"$libexecdir" = x'${exec_prefix}/lib'; then
libexecdir=${libexecdir}/nagios;
elif test x"$libexecdir" = x'${exec_prefix}/libexec'; then
libexecdir=${exec_prefix}/lib/nagios;
fi
fi
if test x"$exec_prefix" = "xNONE"; then exec_prefix=${prefix}; fi
tmpfilesd=${tmpfilesd="/usr/lib/tmpfiles.d"}
if test ! -d "$tmpfilesd"; then
tmpfilesd="N/A"
else
tmpfilesd="$tmpfilesd/$INIT_PROG.conf"
fi
subsyslockdir=${subsyslockdir="/run"}
if test ! -d "$subsyslockdir"; then
subsyslockdir="N/A"
subsyslockfile="N/A"
else
subsyslockfile="$subsyslockdir/$INIT_PROG.lock"
fi
if test "$need_loc" = no; then
localedir="N/A"
fi
if test $install_method = "default" ; then
#
# Do the default setup
#
datadir=${datadir="$datarootdir"}
if test $need_web = yes; then
webdir=${webdir="$datadir"}
else
webdir="N/A"
fi
if test $opsys = "unix"; then
sysconfdir=${sysconfdir="/etc/opt"}
fi
pkgsysconfdir=${pkgsysconfdir="$sysconfdir"}
if test $need_etc_subdir = yes; then
objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
else
objsysconfdir="N/A"
fi
privatesysconfdir=${privatesysconfdir="$pkgsysconfdir"}
logdir=${logdir="$localstatedir"}
piddir=${piddir="$localstatedir"}
if test "$need_pipe" = yes; then
pipedir=${pipedir="$localstatedir/rw"}
else
pipedir="N/A"
fi
if test "$need_pls_dir" = yes; then
pkglocalstatedir=${pkglocalstatedir="$localstatedir"}
else
pkglocalstatedir="N/A"
fi
if test "$need_spl" = yes; then
spooldir=${spooldir="$localstatedir/var"}
else
spooldir="N/A"
fi
if test $need_brk = yes; then
brokersdir=${brokersdir="$bindir"}
else
brokersdir="N/A"
fi
if test $need_plg = yes; then
pluginsdir=${pluginsdir="$libexecdir"}
else
pluginsdir="N/A"
fi
if test $need_cgi = yes; then
cgibindir=${cgibindir="$prefix/sbin"}
else
cgibindir="N/A"
fi
elif test $opsys = "linux"; then
#
# Linux "Standard" install
#
install_method="$install_method : FHS"
datadir=${datadir="$datarootdir/nagios"}
if test $need_web = yes; then
webdir=${webdir="$datadir/html"}
else
webdir="N/A"
fi
sysconfdir=${sysconfdir="/etc"}
pkgsysconfdir=${pkgsysconfdir="$sysconfdir/nagios"}
if test $need_etc_subdir = yes; then
objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
else
objsysconfdir="N/A"
fi
privatesysconfdir=${privatesysconfdir="$pkgsysconfdir/private"}
if test $need_log_subdir = yes; then
logdir=${logdir="$localstatedir/log/$INIT_PROG"}
else
logdir=${logdir="$localstatedir/log"}
fi
piddir=${piddir="$localstatedir/run/${INIT_PROG}"}
if test "$need_pipe" = yes; then
pipedir=${pipedir="$localstatedir/run/${INIT_PROG}"}
else
pipedir="N/A"
fi
if test "$need_pls_dir" = yes; then
pkglocalstatedir=${pkglocalstatedir="$localstatedir/lib/$INIT_PROG"}
else
pkglocalstatedir="N/A"
fi
if test "$need_spl" = yes; then
spooldir=${spooldir="$localstatedir/spool/$INIT_PROG"}
else
spooldir="N/A"
fi
if test $need_brk = yes; then
brokersdir=${brokersdir="$libexecdir/brokers"}
else
brokersdir="N/A"
fi
if test $need_plg = yes; then
pluginsdir=${pluginsdir="$libexecdir/plugins"}
else
pluginsdir="N/A"
fi
if test $need_cgi = yes; then
cgibindir=${cgibindir="$libexecdir/cgi-bin"}
else
cgibindir="N/A"
fi
elif test $opsys = "unix"; then
#
# "Standard" Unix install
#
install_method="$install_method : Unix Standard"
if test $dist_type = osx; then
install_method="$install_method : OS X Standard"
fi
datadir=${datadir="$datarootdir/nagios"}
if test $need_web = yes; then
webdir=${webdir="$datadir/html"}
else
webdir="N/A"
fi
if test $dist_type = osx; then
sysconfdir=${sysconfdir="/private/etc"}
else
sysconfdir=${sysconfdir="/etc"}
fi
pkgsysconfdir=${pkgsysconfdir="$sysconfdir/nagios"}
if test $need_etc_subdir = yes; then
objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
else
objsysconfdir="N/A"
fi
privatesysconfdir=${privatesysconfdir="$pkgsysconfdir/private"}
if test "$need_pls_dir" = yes; then
pkglocalstatedir=${pkglocalstatedir="$localstatedir/lib/$INIT_PROG"}
else
pkglocalstatedir="N/A"
fi
if test "$need_loc" = yes; then
localedir=${localedir="/usr/local/share/locale/<lang>/LC_MESSAGES/nagios-plugins.mo"}
fi
if test "$need_spl" = yes; then
spooldir=${spooldir="$localstatedir/spool/$INIT_PROG"}
else
spooldir="N/A"
fi
if test $need_brk = yes; then
brokersdir=${brokersdir="$libexecdir/brokers"}
else
brokersdir="N/A"
fi
if test $need_plg = yes; then
pluginsdir=${pluginsdir="$libexecdir/plugins"}
else
pluginsdir="N/A"
fi
if test $need_cgi = yes; then
cgibindir=${cgibindir="$libexecdir/cgi-bin"}
else
cgibindir="N/A"
fi
AS_CASE([$dist_type],
[*hp-ux*],
piddir=${piddir="$pkgsysconfdir"}
pipedir=${pipedir="$pkglocalstatedir"}
logdir=${logdir="$pkglocalstatedir/log"},
[*],
piddir=${piddir="$localstatedir/run/${INIT_PROG}"}
if test "$need_pipe" = yes; then
pipedir=${pipedir="$localstatedir/run/${INIT_PROG}"}
else
pipedir="N/A"
fi
if test $need_log_subdir = yes; then
logdir=${logdir="$localstatedir/log/$INIT_PROG"}
else
logdir=${logdir="$localstatedir/log"}
fi
)
elif test $opsys = "bsd"; then
#
# "Standard" BSD install
#
install_method="$install_method : BSD"
if test $dist_type = freebsd -o $dist_type = openbsd; then
prefix=${prefix="/usr/local"}
exec_prefix=${exec_prefix="/usr/local"}
if test $dist_type = freebsd; then
install_method="$install_method : FreeBSD"
else
install_method="$install_method : OpenBSD"
fi
elif test $dist_type = netbsd; then
prefix=${prefix="/usr/pkg"}
exec_prefix=${exec_prefix="/usr/pkg"}
install_method="$install_method : NetBSD"
fi
datadir=${datadir="$datarootdir/nagios"}
if test $need_web = yes -o $need_cgi = yes; then
if test $dist_type = freebsd; then
webdir=${webdir="$prefix/www/nagios"}
elif test $dist_type = netbsd; then
webdir=${webdir="$prefix/share/nagios"}
elif test $dist_type = openbsd; then
webdir=${webdir="/var/www/nagios"}
fi
else
webdir="N/A"
fi
if test $dist_type = freebsd; then
sysconfdir=${sysconfdir="/usr/local/etc"}
else
sysconfdir=${sysconfdir="/etc"}
fi
pkgsysconfdir=${pkgsysconfdir="$sysconfdir/nagios"}
if test $need_etc_subdir = yes; then
objsysconfdir=${objsysconfdir="$pkgsysconfdir/objects"}
else
objsysconfdir="N/A"
fi
privatesysconfdir=${privatesysconfdir="$pkgsysconfdir/private"}
if test "$need_pls_dir" = yes; then
pkglocalstatedir=${pkglocalstatedir="$localstatedir/lib/$INIT_PROG"}
else
pkglocalstatedir="N/A"
fi
if test "$need_loc" = yes; then
localedir=${localedir="/usr/local/share/locale/<lang>/LC_MESSAGES/nagios-plugins.mo"}
fi
if test "$need_spl" = yes; then
spooldir=${spooldir="$localstatedir/spool/$INIT_PROG"}
else
spooldir="N/A"
fi
if test $need_brk = yes; then
brokersdir=${brokersdir="$libexecdir/brokers"}
else
brokersdir="N/A"
fi
if test $need_plg = yes; then
pluginsdir=${pluginsdir="$libexecdir/plugins"}
else
pluginsdir="N/A"
fi
if test $need_cgi = yes; then
if test $dist_type = freebsd; then
cgibindir=${cgibindir="$webdir/cgi-bin"}
elif test $dist_type = netbsd; then
cgibindir=${pluginsdir="$libexecdir/cgi-bin"}
elif test $dist_type = openbsd; then
cgibindir=${pluginsdir="/var/www/cgi-bin/nagios"}
fi
else
cgibindir="N/A"
fi
piddir=${piddir="$localstatedir/run/${INIT_PROG}"}
if test "$need_pipe" = yes; then
pipedir=${pipedir="$localstatedir/run/${INIT_PROG}"}
else
pipedir="N/A"
fi
if test $need_log_subdir = yes; then
logdir=${logdir="$localstatedir/log/$INIT_PROG"}
else
logdir=${logdir="$localstatedir/log"}
fi
else
#
# Unknown install
#
install_method="unknown"
webdir=unknown
pkgsysconfdir=unknown
objsysconfdir=unknown
privatesysconfdir=unknown
logdir=unknown
piddir=unknown
pipedir=unknown
pkglocalstatedir=unknown
spooldir=unknown
brokersdir=unknown
pluginsdir=unknown
cgibindir=unknown
fi
eval prefix=$prefix
eval exec_prefix=$exec_prefix
eval bindir=$bindir
eval datarootdir=$datarootdir
eval datadir=$datadir
eval libexecdir=$libexecdir
eval brokersdir=$brokersdir
eval pluginsdir=$pluginsdir
eval cgibindir=$cgibindir
eval localstatedir=$localstatedir
eval pkglocalstatedir=$pkglocalstatedir
eval webdir=$webdir
eval localedir=$localedir
eval sysconfdir=$sysconfdir
eval pkgsysconfdir=$pkgsysconfdir
eval piddir=$piddir
# We test systemd first because in case
# someone tries to install Nagios on a
# system with a newer version, that doesn't
# have the defined versions ..we can just
# (hopefully) fall back to SysV
# And if that doesn't work, well...
AS_CASE([$init_type],
[systemd],
if test -d "/lib/systemd/system"; then
initdir=${initdir="/lib/systemd/system"}
elif test -d "/usr/lib/systemd/system"; then
initdir=${initdir="/usr/lib/systemd/system"}
elif test -d "/usr/local/lib/systemd/system"; then
initdir=${initdir="/usr/local/lib/systemd/system"}
elif test -d "/run/systemd/system"; then
initdir=${initdir="/run/systemd/system"}
elif test -d "/etc/systemd/system"; then
initdir=${initdir="/etc/systemd/system"}
elif test -d "/etc/systemd/user"; then
initdir=${initdir="/etc/systemd/user"}
elif test -d "/run/systemd/user"; then
initdir=${initdir="/run/systemd/user"}
elif test -d "/usr/lib/systemd/user"; then
initdir=${initdir="/usr/lib/systemd/user"}
elif test -d "/usr/local/lib/systemd/user"; then
initdir=${initdir="/usr/local/lib/systemd/user"}
elif test -d "/usr/share/systemd/user"; then
initdir=${initdir="/usr/share/systemd/user"}
elif test -d "/usr/local/share/systemd/user"; then
initdir=${initdir="/usr/local/share/systemd/user"}
elif test -d "$HOME/.config/systemd/user"; then
initdir=${initdir="$HOME/.config/systemd/user"}
elif test -d "$HOME/.local/share/systemd/user"; then
initdir=${initdir="$HOME/.local/share/systemd/user"}
elif test -d "$XDG_CONFIG_HOME/systemd/user/"; then
initdir=${initdir="$XDG_CONFIG_HOME/systemd/user/"}
elif test -d "$XDG_RUNTIME_DIR/systemd/user/"; then
initdir=${initdir="$XDG_RUNTIME_DIR/systemd/user/"}
elif test -d "$XDG_DATA_HOME/systemd/user/"; then
initdir=${initdir="$XDG_DATA_HOME/systemd/user/"}
else
init_type="sysv"
fi
initname=${initname="$INIT_PROG.service"},
)
#
# Init scripts/files
#
AS_CASE([$init_type],
[sysv],
if test $dist_type = "hp-ux"; then
initdir=${initdir="/sbin/init.d"}
else
initdir=${initdir="/etc/init.d"}
fi
initname=${initname="$INIT_PROG"}
initconfdir=${initconfdir="/etc/conf.d"}
initconf=${initconf="$initconfdir/$INIT_PROG"},
[bsd],
if test $dist_type = "aix"; then
initdir=${initdir="/sbin/rc.d/init.d"}
initname=${initname="$INIT_PROG"}
else
initdir=${initdir="/etc/rc.d"}
initname=${initname="rc.$INIT_PROG"}
fi,
[newbsd],
initdir=${initdir="/usr/local/etc/rc.d"}
initname=${initname="$INIT_PROG"},
[gentoo],
initdir=${initdir="/etc/init.d"}
initname=${initname="$INIT_PROG"}
initconfdir=${initconfdir="/etc/init.d"}
initconf=${initconf="$initconfdir/$INIT_PROG"},
[openrc],
initdir=${initdir="/etc/init.d"}
initname=${initname="$INIT_PROG"}
initconfdir=${initconfdir="/etc/conf.d"}
initconf=${initconf="$initconfdir/$INIT_PROG"},
[smf*],
if test $init_type = smf10; then
initdir=${initdir="/var/svc/manifest/network/nagios"}
else
initdir=${initdir="/lib/svc/manifest/network/nagios"}
fi
initname=${initname="$INIT_PROG.xml"}
initconfdir=unknown
initconf=unknown,
[upstart],
initdir=${initdir="/etc/init"}
initname=${initname="$INIT_PROG.conf"}
initconfdir=${initconfdir="/etc/default"}
initconf=${initconf="$initconfdir/$INIT_PROG"},
[launchd],
initdir=${initdir="/Library/LaunchDaemons"}
initname=${initname="org.nagios.$INIT_PROG.plist"},
# initconfdir=${initconfdir="/private/etc"}
# initconf=${initconf="$initconfdir/$INIT_PROG"},
[systemd],
init_type=systemd,
[*],
initdir=unknown
initname=unknown)
# Now see if they supplied any overwriting values
initdiroverridden=no
AC_ARG_WITH(initdir,
AS_HELP_STRING([--with-initdir=<path>],
[overrides path for initdir]),
initdir=$withval
initdiroverridden=yes,
initdir=$initdir
)
#
# Inetd (per connection) scripts/files
#
AS_CASE([$inetd_type],
[inetd*],
inetddir=${inetddir="/etc"}
inetdname=${inetdname="inetd.conf"},
[xinetd],
inetddir=${inetddir="/etc/xinetd.d"}
inetdname=${inetdname="$INIT_PROG"},
[systemd],
if test $dist_type = "debian"; then
inetddir=${inetddir="/lib/systemd/system"}
else
inetddir=${inetddir="/usr/lib/systemd/system"}
fi
netdname=${inetdname="$INIT_PROG.socket"},
[smf*],
if test $init_type = smf10; then
inetddir=${inetddir="/var/svc/manifest/network/nagios"}
else
inetddir=${inetddir="/lib/svc/manifest/network/nagios"}
fi
inetdname=${inetdname="$INIT_PROG.xml"},
# [upstart],
# inetddir=${inetddir="/etc/init.d"}
# inetdname=${inetdname="$INIT_PROG"},
[launchd],
inetddir=${inetddir="/Library/LaunchDaemons"}
inetdname=${inetdname="org.nagios.$INIT_PROG.plist"},
[*],
inetddir=${inetddir="unknown"}
inetdname=${inetdname="unknown"})
AC_MSG_RESULT($install_method)
])

6
ci/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
*~
\#*
#pnp4nagios.spec need for github build, dammit
outputs
*.tgz
*.zip

117
ci/maketar.sh Executable file
View File

@@ -0,0 +1,117 @@
#!/bin/sh
# collect up all the "base" files into a tar file
# exclude the stuff that gets created during a build
# usage: maketar.sh [version] [release] [releasedate]
# defaults from configure.ac if not provided
# also makes a zip file
startdir=$(pwd)
me=$(realpath -e -L $0)
distdir=$(dirname $me)
basedir=$(realpath -e -L $distdir/..)
#echo "distdir $distdir"
#echo "basedir $basedir"
VERSION=$1
CVER=$(awk -F, '/^AC_INIT/ {print $2}' $basedir/configure.ac|tr -d '[]')
if test "x${VERSION}" = "x" ;
then
VERSION=$CVER
echo "VERSION ($VERSION) from configure.ac"
elif test "${VERSION}" != "${CVER}" ;
then
echo "$0 version requested $VERSION mismatch configure.ac $CVER"
exit 1
fi
RELEASE=$2
if test "x${RELEASE}" = "x" ;
then
RELEASE=$(awk -F'"' '/^PACKAGE_RELEASE=/{print $2}' $basedir/configure.ac)
echo "RELEASE ($RELEASE) from configure.ac"
fi
RELDATE=$3
if test "x${RELDATE}" = "x" ;
then
RELDATE=$(awk -F'"' '/^PKG_REL_DATE=/{print $2}' $basedir/configure.ac)
echo "RELDATE ($RELDATE) from configure.ac"
fi
echo "Version $VERSION Release $RELEASE Date $RELDATE"
tdir=$(mktemp -p "/tmp" -d "pnp4nagiosDIST_XXXXXXXX")
#echo "tempdir $tdir"
cd $tdir
#directory for dist
mkdir pnp4nagios-${VERSION}
#populate with symbolic links from main code directory
cd pnp4nagios-${VERSION}
for f in AUTHORS ChangeLog ci config.guess config.sub contrib \
configure aclocal.m4 autoconf-macros \
pnp4nagios.te pnp4nagios.fc.in \
COPYING helpers include INSTALL install-sh lib \
Makefile.in man README.md sample-config scripts \
share src subst.in summary.in THANKS ;
do
# echo "ln -s $basedir/$f ."
ln -s $basedir/$f .
done
# update version/release/release_date
cp $basedir/configure.ac .
touch configure.ac
rm ci/pnp4nagios.spec
cp ci/pnp4nagios.spec.in ci/pnp4nagios.spec
sed -i "s/@PACKAGE_VERSION@/${VERSION}/" ci/pnp4nagios.spec
sed -i "s/@PACKAGE_RELEASE@/${RELEASE}/" ci/pnp4nagios.spec
sed -i "s/PACKAGE_RELEASE=\"[^\"]*\"/PACKAGE_RELEASE=\"${RELEASE}\"/" \
configure.ac
sed -i "s/PKG_REL_DATE=\"[^\"]*\"/PKG_REL_DATE=\"${RELDATE}\"/" \
configure.ac
cd ..
# any file that is a 'FILE.in' is kept, but the
# resulting 'FILE' is not.
find -L pnp4nagios-${VERSION} -name '*.in' >dist.exclude
sed -i 's/.in$//' dist.exclude
# .. no object files
find -L pnp4nagios-${VERSION} -name '*.o' >>dist.exclude
# .. no binaries
echo "./pnp4nagios-${VERSION}/src/npcd" >>dist.exclude
echo "./pnp4nagios-${VERSION}/src/utils" >>dist.exclude
echo "./pnp4nagios-${VERSION}/src/pnpsender" >>dist.exclude
# ...and no archives in dist, either
find -L pnp4nagios-${VERSION} -name 'pnp4nagios-*.tgz' >>dist.exclude
find -L pnp4nagios-${VERSION} -name 'pnp4nagios-*.zip' >>dist.exclude
find -L pnp4nagios-${VERSION} -path '*/ci/outputs' >>dist.exclude
find -L pnp4nagios-${VERSION} -path '*/ci/outputs/*' >>dist.exclude
# exception is pnp4nagios.spec
grep -v ci/pnp4nagios.spec dist.exclude >dist.x
mv dist.x dist.exclude
#GNU makefile 'dist' guideline is that files in the archive
#should have world rx permissions
chmod 0755 -R pnp4nagios-${VERSION}
#make the tar archive, rereferencing symbolic links
tar chzf pnp4nagios-${VERSION}.tgz -X dist.exclude --exclude-backups pnp4nagios-${VERSION}
mv pnp4nagios-${VERSION}.tgz $distdir
zip -r -q pnp4nagios-${VERSION}.zip pnp4nagios-${VERSION}/ -x\*~ -x\*\# -x\@dist.exclude
mv pnp4nagios-${VERSION}.zip $distdir
cd $startdir
# clean up temp directory
rm -rf $tdir

44
ci/mockbuild.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/sh
NAME=pnp4nagios
VERSION=$(grep '^Version: ' ${NAME}.spec | cut -d ':' -f2 | awk -F'%' '{print $1}' | tr -d ' ')
RELEASE=$(grep '^Release: ' ${NAME}.spec | cut -d ':' -f2 | awk -F'%' '{print $1}' | tr -d ' ')
dnf install -y epel-release
dnf install -y mock
cp ${NAME}.spec ${NAME}.spec.base
echo "VERSION = ${VERSION}"
echo "RELEASE = ${RELEASE}"
mkdir outputs
# want to use the plain-vanilla pnp4nagios.spec so that
# it's the one that is included in the srpm
BREL="${RELEASE}.alma%{?dist}"
sed "/^Release:/c\
Release: ${BREL}" <${NAME}.spec.base >${NAME}.spec
config='alma+epel-8-x86_64'
mock -v -r $config \
--additional-package=selinux-policy-targeted \
--additional-package=selinux-policy-devel \
--additional-package=perl-Time-HiRes \
--additional-package=rrdtool \
--spec=${NAME}.spec \
--sources=${NAME}-${VERSION}.tgz \
--resultdir=./outputs -N
cp ${NAME}.spec.base ${NAME}.spec
config='fedora-38-x86_64'
mock -v -r $config \
--additional-package=selinux-policy-targeted \
--additional-package=selinux-policy-devel \
--additional-package=perl-Time-HiRes \
--additional-package=rrdtool \
--spec=${NAME}.spec \
--sources=${NAME}-${VERSION}.tgz --resultdir=./outputs -N
ls -lR .

498
ci/pnp4nagios.spec Executable file
View File

@@ -0,0 +1,498 @@
%global debug_package %{nil}
%global with_selinux 1
%global _libdir %{_prefix}/lib64
Name: pnp4nagios
Version: 0.6.27
Release: 5%{?dist}
Summary: Nagios performance data analysis tool
Group: Applications/System
License: GPLv2
URL: https://github.com/pnp4nagios/pnp4nagios
Source0: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: autoconf, automake, libtool
Requires: rrdtool-perl
Requires: perl(Time::HiRes)
Requires: nagios
Requires: httpd
Requires: rrdtool-perl
Requires: php >= 5.6
Requires: php-gd
Requires: php-xml
Requires: php-mbstring
# This ensures that the *-selinux package and all its dependencies are not pulled
# into containers and other systems that do not use SELinux
%if 0%{?fedora} || 0%{?rhel} >= 8
Requires: (%{name}-selinux if selinux-policy-%{selinuxtype})
%else
Requires: %{name}-selinux
%endif
%if 0%{?rhel} > 6 || 0%{?fedora} > 20
# For necessary macros
BuildRequires: systemd
%else
Requires(preun): initscripts, chkconfig
Requires(post): initscripts, chkconfig
Requires(postun): initscripts
%endif
%description
PNP is an addon to nagios which analyzes performance data provided by plugins
and stores them automatically into RRD-databases.
%if 0%{?with_selinux}
# SELinux subpackage
%package selinux
Summary: SELinux context for %{name}
BuildArch: noarch
%global selinuxtype targeted
%global modulename pnp4nagios
Requires: selinux-policy-%{selinuxtype}
Requires(post): selinux-policy-%{selinuxtype}
Requires: checkpolicy, selinux-policy-devel, bzip2
%{?selinux_requires}
%description selinux
SElinux security policy for %{name}.
%endif
%prep
%setup -q
#autoreconf
cp contrib/fedora/pnp4nagios-README.fedora README.fedora
sed -i -e 's/^INSTALL_OPTS="-o $nagios_user -g $nagios_grp"/INSTALL_OPTS=""/' \
configure
sed -i -e '/^\t$(MAKE) strip-post-install$/d' src/Makefile.in
%build
autoconf
%configure --prefix='' \
--bindir=%{_sbindir} \
--libexecdir=%{_libexecdir}/%{name} \
--sysconfdir=%{_sysconfdir}/%{name} \
--localstatedir=%{_localstatedir}/log/%{name} \
--datadir=%{_datadir}/nagios/html/%{name} \
--datarootdir=%{_datadir}/nagios/html/%{name} \
%if 0%{with_selinux}
--enable-selinux=yes \
%else
--with-selinux=no \
%endif
--with-dist-type=rh \
--with-init-type=systemd \
--with-initdir=%{_unitdir} \
--with-http_server=apache \
--with-http_server_base=%{_sysconfdir}/httpd \
--with-http_user=apache \
--with-http_group=apache \
--with-kohana_system=%{_datadir}/nagios/html/%{name}/kohana/system \
--with-nagios_user=nagios \
--with-nagios_group=nagios \
--with-nagios_unit=nagios \
--with-cache_dir=%{_localstatedir}/cache/pnp4nagios \
--with-perfdata-dir=%{_localstatedir}/lib/%{name} \
--with-perfdata-spool-dir=%{_localstatedir}/spool/%{name} \
--with-pnp-logdir=%{_localstatedir}/log/%{name}
%{__make} %{?_smp_mflags} all
%install
if [ "$RPM_BUILD_ROOT" != "/" ]; then
rm -rf $RPM_BUILD_ROOT
fi
%{__make} install DESTDIR=$RPM_BUILD_ROOT INSTALL_OPTS="" HTTP_INSTALL_OPTS="" MIX_OPTS="" INIT_OPTS="" NOSAMPLES=1
# NO...do NOT remove -sample from filename suffix
#for i in $RPM_BUILD_ROOT/%{_sysconfdir}/pnp4nagios/*-sample \
# $RPM_BUILD_ROOT/%{_sysconfdir}/pnp4nagios/*/*-sample
#do
# mv ${i} ${i%%-sample}
#done
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.php.*
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config_local.php
chmod a-x $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.php
chmod a-x $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/*.cfg
chmod a-x $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/*.md
chmod a-x $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/check_commands/*.cfg-sample
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}/stats
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}/kohana
#
install -Dp -m 0644 contrib/fedora/pnp4nagios.logrotate.conf \
$RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pnp4nagios
#
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logwatch/scripts/services
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logwatch/conf/services
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logwatch/conf/logfiles
install -m 0666 contrib/fedora/logwatch/scripts/services/pnp4nagios \
$RPM_BUILD_ROOT%{_sysconfdir}/logwatch/scripts/services/
install -m 0644 contrib/fedora/logwatch/conf/services/pnp4nagios.conf \
$RPM_BUILD_ROOT%{_sysconfdir}/logwatch/conf/services/
install -m 0644 contrib/fedora/logwatch/conf/logfiles/pnp4nagios.conf \
$RPM_BUILD_ROOT%{_sysconfdir}/logwatch/conf/logfiles/
#
#mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
#sed 's|/usr/local/nagios/etc/htpasswd.users|@NAGIOS_PWD@|' \
# sample-config/httpd.conf \
# > $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
install -Dp -m 0644 scripts/npcd.service \
$RPM_BUILD_ROOT%{_unitdir}/npcd.service
#### broker api changed
#mkdir -p $RPM_BUILD_ROOT%{_libdir}/nagios/brokers
#mv $RPM_BUILD_ROOT%{_libdir}/npcdmod.o \
# $RPM_BUILD_ROOT%{_libdir}/nagios/brokers/npcdmod.o
## rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/npcmod.o
#mv $RPM_BUILD_ROOT/man $RPM_BUILD_ROOT%{_datadir}/
# Move kohana to pnp4nagios, there is another kohana in fedore/EPEL,
# which can be installed.
#mv $RPM_BUILD_ROOT%{_libdir}/kohana \
# $RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/kohana
#sed -i 's|%{_libdir}/pnp4nagios/kohana|%{_datadir}/nagios/html/%{name}/kohana|' \
# $RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/index.php
mv $RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/install.ignore.not \
$RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/install.ignore
rm $RPM_BUILD_ROOT%{_sysconfdir}/pnp4nagios/background.pdf
%if 0%{with_selinux}
install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/selinux/tmp/%{name}
install -m 0644 %{name}.fc $RPM_BUILD_ROOT%{_localstatedir}/lib/selinux/tmp/%{name}/%{modulename}.fc
install -m 0644 %{name}.te $RPM_BUILD_ROOT%{_localstatedir}/lib/selinux/tmp/%{name}/%{modulename}.te
%endif
%package logrotate
Summary: config for rotating pnp4nagios logs
Requires: logrotate
Group: Applications/System
%description logrotate
config file used by logrotate, set up for pnp4nagios logs
%package logwatch
Summary: config and scripts for checking pnp4nagios log files
Requires: logwatch
Group: Applications/System
%description logwatch
config files and log scanning script for checking pnp4nagios log
files for errors, and flagging them for attention.
%clean
#if [ "$RPM_BUILD_ROOT" != "/" ]; then
# rm -rf $RPM_BUILD_ROOT
#fi
%files
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog COPYING
%doc INSTALL README.md README.fedora
%doc THANKS contrib/
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/%{name}/pages/background-*.pdf
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/%{name}/config.php
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/%{name}/*.cfg
%attr(755,root,root) %{_sysconfdir}/%{name}/SetLogLevels
%attr(755,root,root) %{_sysconfdir}/%{name}/verify_pnp_config
%attr(644,root,root) %{_sysconfdir}/%{name}/README_config.md
%{_sysconfdir}/%{name}/check_commands/*
%{_sysconfdir}/%{name}/contrib/*
%dir %{_sysconfdir}/%{name}/config.d
%dir %attr(744,apache,apache) /var/cache/pnp4nagios
%attr(755,root,root) %{_sysconfdir}/%{name}/config_tools/NagiosCfgMod.pl
%attr(755,root,root) %{_sysconfdir}/%{name}/config_tools/TemplateMod.pl
%{_sysconfdir}/%{name}/config_samples/*
%{_sysconfdir}/%{name}/pnp4nagios_release
%attr(755,root,root) %{_sbindir}/npcd
%config(noreplace) %attr(644,root,root) %{_unitdir}/npcd.service
%dir %{_libexecdir}/%{name}
%attr(755,root,root) %{_libexecdir}/%{name}/*
%attr(755,nagios,nagios) %{_localstatedir}/lib/%{name}
%dir %attr(755,nagios,nagios) %{_localstatedir}/log/%{name}
%dir %attr(755,nagios,nagios) %{_localstatedir}/log/%{name}/stats
%dir %attr(755,nagios,nagios) %{_localstatedir}/log/%{name}/lock
%dir %attr(755,apache,apache) %{_localstatedir}/log/%{name}/kohana
%dir %attr(755,nagios,nagios) %{_localstatedir}/spool/%{name}
%{_datadir}/nagios/html/%{name}/
%{_mandir}/man8/*
%files logrotate
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%files logwatch
%defattr(644,root,root)
%config(noreplace) %{_sysconfdir}/logwatch/scripts/services/%{name}
%config(noreplace) %{_sysconfdir}/logwatch/conf/services/%{name}.conf
%config(noreplace) %{_sysconfdir}/logwatch/conf/logfiles/%{name}.conf
%if 0%{?with_selinux}
%files selinux
%{_localstatedir}/lib/selinux/tmp/%{name}/%{modulename}.te
%{_localstatedir}/lib/selinux/tmp/%{name}/%{modulename}.fc
%pre selinux
%selinux_relabel_pre -s %{selinuxtype}
%post selinux
pushd %{_localstatedir}/lib/selinux/tmp/%{name} >/dev/null
if semodule -E nagios 2>/dev/null >/dev/null ;
then
semodule_unpackage nagios.pp nagios.mod nagios.fc
for pnpdir in /etc/pnp4nagios /var/log/pnp4nagios /var/lib/pnp4nagios /usr/lib/pnp4nagios
do
if grep -q $pnpdir nagios.fc ;
then
sed -i "\\|$pnpdir|s/^/#/" %{modulename}.fc
fi
done
fi
rm nagios.*
%{__make} %{?_smp_mflags} -f /usr/share/selinux/devel/Makefile all
bzip2 %{name}.pp
install -m 0600 %{modulename}.pp.bz2 %{_datadir}/selinux/packages/%{selinuxtype}/
popd >/dev/null
rm -rf /var/lib/selinux/tmp/%{name}
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
%postun selinux
if [ $1 -eq 0 ]; then
%selinux_modules_uninstall -s %{selinuxtype} %{modulename}
fi
%posttrans selinux
%selinux_relabel_post -s %{selinuxtype}
%endif
%post
# config sample update
pushd %{_sysconfdir}/pnp4nagios >/dev/null
if [ -e %{_sysconfdir}/nagios/objects/templates.cfg ] ;
then
perl %{_sysconfdir}/pnp4nagios/config_tools/TemplateMod.pl -i %{_sysconfdir}/nagios/objects/templates.cfg -o config_samples/nagios/objects/templates.cfg
fi
if [ -e %{_sysconfdir}/nagios/nagios.cfg ] ;
then
nagver=`nagios --version | gawk '/^Nagios /' | gawk -v RS=' ' '/^[0-9]/'`
perl %{_sysconfdir}/pnp4nagios/config_tools/NagiosCfgMod.pl -i %{_sysconfdir}/nagios/nagios.cfg -m sync -o config_samples/nagios/nagios-sync.cfg -n $nagver
perl %{_sysconfdir}/pnp4nagios/config_tools/NagiosCfgMod.pl -i %{_sysconfdir}/nagios/nagios.cfg -m bulk -o config_samples/nagios/nagios-bulk.cfg -n $nagver
perl %{_sysconfdir}/pnp4nagios/config_tools/NagiosCfgMod.pl -i %{_sysconfdir}/nagios/nagios.cfg -m npcd -o config_samples/nagios/nagios-npcd.cfg -n $nagver
fi
# determine default paper size based on locale
if test -e "/etc/locale.conf" ; then
localefile=/etc/locale.conf
elif test -e "/etc/default/coale" ; then
localefile=/etc/default/locale
else
localefile=""
fi
if test "x${localefile}" = "x" ; then
PAPERSIZE=A4
else
country=`grep "_..\." -o ${localefile} | sed 's/[\._]//g'`
if echo 'BZ,CA,CL,CO,CR,SV,GT,MX,NI,PA,PH,PR,US,VE' | grep -q ${country} ; then
PAPERSIZE=letter
else
PAPERSIZE=A4
fi
fi
if [ ! -e %{_sysconfdir}/pnp4nagios/background.pdf ] ; then
ln -rs %{_sysconfdir}/pnp4nagios/pages/background-${PAPERSIZE}.pdf %{_sysconfdir}/pnp4nagios/background.pdf
fi
popd >/dev/null
%systemd_post npcd.service
%preun
%systemd_preun npcd.service
%postun
%systemd_postun_with_restart npcd.service
%changelog
* Mon Feb 19 2024 Chuck Lane <lane@dchooz.org> - 0.6.27-6
- get rpm in sync with 'build-from-source' autoconf setup
* Thu Nov 23 2023 Chuck Lane <lane@dchooz.org> - 0.6.27-5
- add selinux info, improved packaging
* Mon Sep 11 2023 Chuck Lane <lane@dchooz.org> - 0.6.27-4
- change to defining XDG_CACHE_HOME in php, many links in docs fixed
* Mon Aug 28 2023 Chuck Lane <lane@dchooz.org> - 0.6.27-3
- one more pnp8.2 fix, update release number
* Fri Aug 18 2023 Chuck Lane <lane@dhooz.org> - 0.6.27-1
- many pnp8.2 deprecation fixes, get XDG_CACHE_HOME in systemd setup
* Tue Dec 20 2022 Chuck Lane <lane@dchooz.org> - 0.6.26-14
- minor config cleanups, add logwatch and logrotate subpackages
* Sun Sep 11 2022 Chuck Lane <lane@dchooz.org> - 0.6.26-3
- upgrade to php8
* Mon Jun 08 2015 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.25-1
- Update to upstream.
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.22-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Fri Jul 04 2014 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.22-2
- Fix two URL Cross-Site Scripting Vulnerabilities (bz#1115983)
* Thu Jul 03 2014 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.22-1
- Update to upstream (fixes XSS flaw in an error page - bz#1115770)
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.21-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.21-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 0.6.21-3
- Perl 5.18 rebuild
* Wed Jul 03 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.21-2
- Broken configuration for httpd 2.4 fixed (bz#871465)
- fixed dates in changelog items
* Tue Jun 04 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.21-1
- update to upstream
* Sat Mar 23 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.20-2
- added autoreconf to prep section (bz#926359)
* Sun Mar 03 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.20-1
- update to upstream
* Sun Feb 17 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.19-2
- updated hostextinfo URL for pnp4nagios 0.6
- spec file cleanup
* Sat Feb 16 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.19-1
- update to upstream
* Mon Sep 03 2012 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.16-4
- CVE-2012-3457 - process_perfdata.cfg world readable
* Thu Apr 05 2012 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.16-2
- Removed double slashes fro directories (BZ#810212).
* Thu Nov 24 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.16-1
- update to upstream
* Mon Nov 21 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.15-4
- add back kohana, it's a different version
- added BR: perl(Time::HiRes)
* Mon Nov 21 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.15-2
- exclude kohana sources and require php-Kohana package
* Wed Nov 16 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.15-1
- update to upstream
- remove /usr/share/nagios/html/pnp4nagios/install.php
- added /etc/httpd/conf.d/pnp4nagios.conf
- removed -sample suffix from rest of sample files
* Tue Oct 11 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.1-3
- Updated renaming of "-sample" config files.
* Wed Sep 14 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.1-1
- Update to 0.6.1.
* Tue Sep 13 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.4.14-7
- added perl-Time-HiRes to build requires
* Tue Sep 13 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.4.14-6
- rebuilt for EPEL-6
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.14-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Sep 27 2010 Xavier Bachelot <xavier@bachelot.org> 0.4.14-4
- Bump release for rebuild.
* Sun Jul 18 2010 Xavier Bachelot <xavier@bachelot.org> 0.4.14-3
- Add patch to fix PHP deprecated warnings with PHP 5.3.
(Patch from Jan Ondrej - RHBZ#572851)
* Thu Aug 27 2009 Xavier Bachelot <xavier@bachelot.org> 0.4.14-2
- Ship contrib directory as doc.
* Thu Aug 27 2009 Xavier Bachelot <xavier@bachelot.org> 0.4.14-1
- Update to 0.4.14 (RHBZ#518069).
- Fix typo in README.fedora (RHBZ#490664).
- Move npcdmod.o to a better place.
- BR: rrdtool-perl
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.12-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Thu Dec 4 2008 Michael Schwendt <mschwendt@fedoraproject.org> 0.4.12-2
- Include /usr/libexec/pnp4nagios directory.
* Tue Oct 21 2008 Robert M. Albrecht <romal@gmx.de> 0.4.12-1
- Upstream released 0.4.12
* Tue Sep 02 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.10-3
- Fix logrotate conf (RHBZ#460861).
* Fri Jul 18 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.10-2
- Fix typo in logrotate conf.
* Wed Jul 09 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.10-1
- Update to 0.4.10.
* Tue May 27 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.9-3
- Fix npcd init script to use /etc/pnp4nagios.
* Tue May 27 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.9-2
- Install npcd unstripped to let rpm do it.
* Sat May 24 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.9-1
- Update to 0.4.9.
- Rename to pnp4nagios to match other distros packages.
* Mon Apr 14 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.7-5
- Log to file by default.
- Kill pnpsender man page.
* Mon Apr 07 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.7-4
- Install inside of nagios html dir.
* Mon Apr 07 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.7-3
- Provide properly named config files.
- Add missing Requires:.
- Add a logrotate conf file.
* Fri Apr 04 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.7-2
- Add an initscript for npcd.
* Wed Mar 19 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.7-1
- Initial build.

498
ci/pnp4nagios.spec.in Executable file
View File

@@ -0,0 +1,498 @@
%global debug_package %{nil}
%global with_selinux 1
%global _libdir %{_prefix}/lib64
Name: pnp4nagios
Version: @PACKAGE_VERSION@
Release: @PACKAGE_RELEASE@%{?dist}
Summary: Nagios performance data analysis tool
Group: Applications/System
License: GPLv2
URL: https://github.com/pnp4nagios/pnp4nagios
Source0: %{name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: autoconf, automake, libtool
Requires: rrdtool-perl
Requires: perl(Time::HiRes)
Requires: nagios
Requires: httpd
Requires: rrdtool-perl
Requires: php >= 5.6
Requires: php-gd
Requires: php-xml
Requires: php-mbstring
# This ensures that the *-selinux package and all its dependencies are not pulled
# into containers and other systems that do not use SELinux
%if 0%{?fedora} || 0%{?rhel} >= 8
Requires: (%{name}-selinux if selinux-policy-%{selinuxtype})
%else
Requires: %{name}-selinux
%endif
%if 0%{?rhel} > 6 || 0%{?fedora} > 20
# For necessary macros
BuildRequires: systemd
%else
Requires(preun): initscripts, chkconfig
Requires(post): initscripts, chkconfig
Requires(postun): initscripts
%endif
%description
PNP is an addon to nagios which analyzes performance data provided by plugins
and stores them automatically into RRD-databases.
%if 0%{?with_selinux}
# SELinux subpackage
%package selinux
Summary: SELinux context for %{name}
BuildArch: noarch
%global selinuxtype targeted
%global modulename pnp4nagios
Requires: selinux-policy-%{selinuxtype}
Requires(post): selinux-policy-%{selinuxtype}
Requires: checkpolicy, selinux-policy-devel, bzip2
%{?selinux_requires}
%description selinux
SElinux security policy for %{name}.
%endif
%prep
%setup -q
#autoreconf
cp contrib/fedora/pnp4nagios-README.fedora README.fedora
sed -i -e 's/^INSTALL_OPTS="-o $nagios_user -g $nagios_grp"/INSTALL_OPTS=""/' \
configure
sed -i -e '/^\t$(MAKE) strip-post-install$/d' src/Makefile.in
%build
autoconf
%configure --prefix='' \
--bindir=%{_sbindir} \
--libexecdir=%{_libexecdir}/%{name} \
--sysconfdir=%{_sysconfdir}/%{name} \
--localstatedir=%{_localstatedir}/log/%{name} \
--datadir=%{_datadir}/nagios/html/%{name} \
--datarootdir=%{_datadir}/nagios/html/%{name} \
%if 0%{with_selinux}
--enable-selinux=yes \
%else
--with-selinux=no \
%endif
--with-dist-type=rh \
--with-init-type=systemd \
--with-initdir=%{_unitdir} \
--with-http_server=apache \
--with-http_server_base=%{_sysconfdir}/httpd \
--with-http_user=apache \
--with-http_group=apache \
--with-kohana_system=%{_datadir}/nagios/html/%{name}/kohana/system \
--with-nagios_user=nagios \
--with-nagios_group=nagios \
--with-nagios_unit=nagios \
--with-cache_dir=%{_localstatedir}/cache/pnp4nagios \
--with-perfdata-dir=%{_localstatedir}/lib/%{name} \
--with-perfdata-spool-dir=%{_localstatedir}/spool/%{name} \
--with-pnp-logdir=%{_localstatedir}/log/%{name}
%{__make} %{?_smp_mflags} all
%install
if [ "$RPM_BUILD_ROOT" != "/" ]; then
rm -rf $RPM_BUILD_ROOT
fi
%{__make} install DESTDIR=$RPM_BUILD_ROOT INSTALL_OPTS="" HTTP_INSTALL_OPTS="" MIX_OPTS="" INIT_OPTS="" NOSAMPLES=1
# NO...do NOT remove -sample from filename suffix
#for i in $RPM_BUILD_ROOT/%{_sysconfdir}/pnp4nagios/*-sample \
# $RPM_BUILD_ROOT/%{_sysconfdir}/pnp4nagios/*/*-sample
#do
# mv ${i} ${i%%-sample}
#done
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.php.*
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config_local.php
chmod a-x $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.php
chmod a-x $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/*.cfg
chmod a-x $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/*.md
chmod a-x $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/check_commands/*.cfg-sample
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}/stats
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}/kohana
#
install -Dp -m 0644 contrib/fedora/pnp4nagios.logrotate.conf \
$RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/pnp4nagios
#
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logwatch/scripts/services
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logwatch/conf/services
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logwatch/conf/logfiles
install -m 0666 contrib/fedora/logwatch/scripts/services/pnp4nagios \
$RPM_BUILD_ROOT%{_sysconfdir}/logwatch/scripts/services/
install -m 0644 contrib/fedora/logwatch/conf/services/pnp4nagios.conf \
$RPM_BUILD_ROOT%{_sysconfdir}/logwatch/conf/services/
install -m 0644 contrib/fedora/logwatch/conf/logfiles/pnp4nagios.conf \
$RPM_BUILD_ROOT%{_sysconfdir}/logwatch/conf/logfiles/
#
#mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
#sed 's|/usr/local/nagios/etc/htpasswd.users|@NAGIOS_PWD@|' \
# sample-config/httpd.conf \
# > $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
install -Dp -m 0644 scripts/npcd.service \
$RPM_BUILD_ROOT%{_unitdir}/npcd.service
#### broker api changed
#mkdir -p $RPM_BUILD_ROOT%{_libdir}/nagios/brokers
#mv $RPM_BUILD_ROOT%{_libdir}/npcdmod.o \
# $RPM_BUILD_ROOT%{_libdir}/nagios/brokers/npcdmod.o
## rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/npcmod.o
#mv $RPM_BUILD_ROOT/man $RPM_BUILD_ROOT%{_datadir}/
# Move kohana to pnp4nagios, there is another kohana in fedore/EPEL,
# which can be installed.
#mv $RPM_BUILD_ROOT%{_libdir}/kohana \
# $RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/kohana
#sed -i 's|%{_libdir}/pnp4nagios/kohana|%{_datadir}/nagios/html/%{name}/kohana|' \
# $RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/index.php
mv $RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/install.ignore.not \
$RPM_BUILD_ROOT%{_datadir}/nagios/html/%{name}/install.ignore
rm $RPM_BUILD_ROOT%{_sysconfdir}/pnp4nagios/background.pdf
%if 0%{with_selinux}
install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/selinux/tmp/%{name}
install -m 0644 %{name}.fc $RPM_BUILD_ROOT%{_localstatedir}/lib/selinux/tmp/%{name}/%{modulename}.fc
install -m 0644 %{name}.te $RPM_BUILD_ROOT%{_localstatedir}/lib/selinux/tmp/%{name}/%{modulename}.te
%endif
%package logrotate
Summary: config for rotating pnp4nagios logs
Requires: logrotate
Group: Applications/System
%description logrotate
config file used by logrotate, set up for pnp4nagios logs
%package logwatch
Summary: config and scripts for checking pnp4nagios log files
Requires: logwatch
Group: Applications/System
%description logwatch
config files and log scanning script for checking pnp4nagios log
files for errors, and flagging them for attention.
%clean
#if [ "$RPM_BUILD_ROOT" != "/" ]; then
# rm -rf $RPM_BUILD_ROOT
#fi
%files
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog COPYING
%doc INSTALL README.md README.fedora
%doc THANKS contrib/
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/%{name}/pages/background-*.pdf
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/%{name}/config.php
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/%{name}/*.cfg
%attr(755,root,root) %{_sysconfdir}/%{name}/SetLogLevels
%attr(755,root,root) %{_sysconfdir}/%{name}/verify_pnp_config
%attr(644,root,root) %{_sysconfdir}/%{name}/README_config.md
%{_sysconfdir}/%{name}/check_commands/*
%{_sysconfdir}/%{name}/contrib/*
%dir %{_sysconfdir}/%{name}/config.d
%dir %attr(744,apache,apache) /var/cache/pnp4nagios
%attr(755,root,root) %{_sysconfdir}/%{name}/config_tools/NagiosCfgMod.pl
%attr(755,root,root) %{_sysconfdir}/%{name}/config_tools/TemplateMod.pl
%{_sysconfdir}/%{name}/config_samples/*
%{_sysconfdir}/%{name}/pnp4nagios_release
%attr(755,root,root) %{_sbindir}/npcd
%config(noreplace) %attr(644,root,root) %{_unitdir}/npcd.service
%dir %{_libexecdir}/%{name}
%attr(755,root,root) %{_libexecdir}/%{name}/*
%attr(755,nagios,nagios) %{_localstatedir}/lib/%{name}
%dir %attr(755,nagios,nagios) %{_localstatedir}/log/%{name}
%dir %attr(755,nagios,nagios) %{_localstatedir}/log/%{name}/stats
%dir %attr(755,nagios,nagios) %{_localstatedir}/log/%{name}/lock
%dir %attr(755,apache,apache) %{_localstatedir}/log/%{name}/kohana
%dir %attr(755,nagios,nagios) %{_localstatedir}/spool/%{name}
%{_datadir}/nagios/html/%{name}/
%{_mandir}/man8/*
%files logrotate
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%files logwatch
%defattr(644,root,root)
%config(noreplace) %{_sysconfdir}/logwatch/scripts/services/%{name}
%config(noreplace) %{_sysconfdir}/logwatch/conf/services/%{name}.conf
%config(noreplace) %{_sysconfdir}/logwatch/conf/logfiles/%{name}.conf
%if 0%{?with_selinux}
%files selinux
%{_localstatedir}/lib/selinux/tmp/%{name}/%{modulename}.te
%{_localstatedir}/lib/selinux/tmp/%{name}/%{modulename}.fc
%pre selinux
%selinux_relabel_pre -s %{selinuxtype}
%post selinux
pushd %{_localstatedir}/lib/selinux/tmp/%{name} >/dev/null
if semodule -E nagios 2>/dev/null >/dev/null ;
then
semodule_unpackage nagios.pp nagios.mod nagios.fc
for pnpdir in /etc/pnp4nagios /var/log/pnp4nagios /var/lib/pnp4nagios /usr/lib/pnp4nagios
do
if grep -q $pnpdir nagios.fc ;
then
sed -i "\\|$pnpdir|s/^/#/" %{modulename}.fc
fi
done
fi
rm nagios.*
%{__make} %{?_smp_mflags} -f /usr/share/selinux/devel/Makefile all
bzip2 %{name}.pp
install -m 0600 %{modulename}.pp.bz2 %{_datadir}/selinux/packages/%{selinuxtype}/
popd >/dev/null
rm -rf /var/lib/selinux/tmp/%{name}
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{modulename}.pp.bz2
%postun selinux
if [ $1 -eq 0 ]; then
%selinux_modules_uninstall -s %{selinuxtype} %{modulename}
fi
%posttrans selinux
%selinux_relabel_post -s %{selinuxtype}
%endif
%post
# config sample update
pushd %{_sysconfdir}/pnp4nagios >/dev/null
if [ -e %{_sysconfdir}/nagios/objects/templates.cfg ] ;
then
perl %{_sysconfdir}/pnp4nagios/config_tools/TemplateMod.pl -i %{_sysconfdir}/nagios/objects/templates.cfg -o config_samples/nagios/objects/templates.cfg
fi
if [ -e %{_sysconfdir}/nagios/nagios.cfg ] ;
then
nagver=`nagios --version | gawk '/^Nagios /' | gawk -v RS=' ' '/^[0-9]/'`
perl %{_sysconfdir}/pnp4nagios/config_tools/NagiosCfgMod.pl -i %{_sysconfdir}/nagios/nagios.cfg -m sync -o config_samples/nagios/nagios-sync.cfg -n $nagver
perl %{_sysconfdir}/pnp4nagios/config_tools/NagiosCfgMod.pl -i %{_sysconfdir}/nagios/nagios.cfg -m bulk -o config_samples/nagios/nagios-bulk.cfg -n $nagver
perl %{_sysconfdir}/pnp4nagios/config_tools/NagiosCfgMod.pl -i %{_sysconfdir}/nagios/nagios.cfg -m npcd -o config_samples/nagios/nagios-npcd.cfg -n $nagver
fi
# determine default paper size based on locale
if test -e "/etc/locale.conf" ; then
localefile=/etc/locale.conf
elif test -e "/etc/default/coale" ; then
localefile=/etc/default/locale
else
localefile=""
fi
if test "x${localefile}" = "x" ; then
PAPERSIZE=A4
else
country=`grep "_..\." -o ${localefile} | sed 's/[\._]//g'`
if echo 'BZ,CA,CL,CO,CR,SV,GT,MX,NI,PA,PH,PR,US,VE' | grep -q ${country} ; then
PAPERSIZE=letter
else
PAPERSIZE=A4
fi
fi
if [ ! -e %{_sysconfdir}/pnp4nagios/background.pdf ] ; then
ln -rs %{_sysconfdir}/pnp4nagios/pages/background-${PAPERSIZE}.pdf %{_sysconfdir}/pnp4nagios/background.pdf
fi
popd >/dev/null
%systemd_post npcd.service
%preun
%systemd_preun npcd.service
%postun
%systemd_postun_with_restart npcd.service
%changelog
* Mon Feb 19 2024 Chuck Lane <lane@dchooz.org> - 0.6.27-6
- get rpm in sync with 'build-from-source' autoconf setup
* Thu Nov 23 2023 Chuck Lane <lane@dchooz.org> - 0.6.27-5
- add selinux info, improved packaging
* Mon Sep 11 2023 Chuck Lane <lane@dchooz.org> - 0.6.27-4
- change to defining XDG_CACHE_HOME in php, many links in docs fixed
* Mon Aug 28 2023 Chuck Lane <lane@dchooz.org> - 0.6.27-3
- one more pnp8.2 fix, update release number
* Fri Aug 18 2023 Chuck Lane <lane@dhooz.org> - 0.6.27-1
- many pnp8.2 deprecation fixes, get XDG_CACHE_HOME in systemd setup
* Tue Dec 20 2022 Chuck Lane <lane@dchooz.org> - 0.6.26-14
- minor config cleanups, add logwatch and logrotate subpackages
* Sun Sep 11 2022 Chuck Lane <lane@dchooz.org> - 0.6.26-3
- upgrade to php8
* Mon Jun 08 2015 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.25-1
- Update to upstream.
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.22-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Fri Jul 04 2014 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.22-2
- Fix two URL Cross-Site Scripting Vulnerabilities (bz#1115983)
* Thu Jul 03 2014 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.22-1
- Update to upstream (fixes XSS flaw in an error page - bz#1115770)
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.21-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.21-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 0.6.21-3
- Perl 5.18 rebuild
* Wed Jul 03 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.21-2
- Broken configuration for httpd 2.4 fixed (bz#871465)
- fixed dates in changelog items
* Tue Jun 04 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.21-1
- update to upstream
* Sat Mar 23 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.20-2
- added autoreconf to prep section (bz#926359)
* Sun Mar 03 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.20-1
- update to upstream
* Sun Feb 17 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.19-2
- updated hostextinfo URL for pnp4nagios 0.6
- spec file cleanup
* Sat Feb 16 2013 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.19-1
- update to upstream
* Mon Sep 03 2012 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.16-4
- CVE-2012-3457 - process_perfdata.cfg world readable
* Thu Apr 05 2012 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.16-2
- Removed double slashes fro directories (BZ#810212).
* Thu Nov 24 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.16-1
- update to upstream
* Mon Nov 21 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.15-4
- add back kohana, it's a different version
- added BR: perl(Time::HiRes)
* Mon Nov 21 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.15-2
- exclude kohana sources and require php-Kohana package
* Wed Nov 16 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.15-1
- update to upstream
- remove /usr/share/nagios/html/pnp4nagios/install.php
- added /etc/httpd/conf.d/pnp4nagios.conf
- removed -sample suffix from rest of sample files
* Tue Oct 11 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.1-3
- Updated renaming of "-sample" config files.
* Wed Sep 14 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.6.1-1
- Update to 0.6.1.
* Tue Sep 13 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.4.14-7
- added perl-Time-HiRes to build requires
* Tue Sep 13 2011 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 0.4.14-6
- rebuilt for EPEL-6
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.14-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Sep 27 2010 Xavier Bachelot <xavier@bachelot.org> 0.4.14-4
- Bump release for rebuild.
* Sun Jul 18 2010 Xavier Bachelot <xavier@bachelot.org> 0.4.14-3
- Add patch to fix PHP deprecated warnings with PHP 5.3.
(Patch from Jan Ondrej - RHBZ#572851)
* Thu Aug 27 2009 Xavier Bachelot <xavier@bachelot.org> 0.4.14-2
- Ship contrib directory as doc.
* Thu Aug 27 2009 Xavier Bachelot <xavier@bachelot.org> 0.4.14-1
- Update to 0.4.14 (RHBZ#518069).
- Fix typo in README.fedora (RHBZ#490664).
- Move npcdmod.o to a better place.
- BR: rrdtool-perl
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.12-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Thu Dec 4 2008 Michael Schwendt <mschwendt@fedoraproject.org> 0.4.12-2
- Include /usr/libexec/pnp4nagios directory.
* Tue Oct 21 2008 Robert M. Albrecht <romal@gmx.de> 0.4.12-1
- Upstream released 0.4.12
* Tue Sep 02 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.10-3
- Fix logrotate conf (RHBZ#460861).
* Fri Jul 18 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.10-2
- Fix typo in logrotate conf.
* Wed Jul 09 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.10-1
- Update to 0.4.10.
* Tue May 27 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.9-3
- Fix npcd init script to use /etc/pnp4nagios.
* Tue May 27 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.9-2
- Install npcd unstripped to let rpm do it.
* Sat May 24 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.9-1
- Update to 0.4.9.
- Rename to pnp4nagios to match other distros packages.
* Mon Apr 14 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.7-5
- Log to file by default.
- Kill pnpsender man page.
* Mon Apr 07 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.7-4
- Install inside of nagios html dir.
* Mon Apr 07 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.7-3
- Provide properly named config files.
- Add missing Requires:.
- Add a logrotate conf file.
* Fri Apr 04 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.7-2
- Add an initscript for npcd.
* Wed Mar 19 2008 Xavier Bachelot <xavier@bachelot.org> 0.4.7-1
- Initial build.

12529
configure vendored

File diff suppressed because it is too large Load Diff

1016
configure.ac Normal file → Executable file

File diff suppressed because it is too large Load Diff

4
contrib/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
fedora/logwatch/conf/logfiles/pnp4nagios.conf
fedora/logwatch/scripts/services/pnp4nagios
fedora/pnp4nagios.logrotate.conf
ssi/status-header.ssi

View File

@@ -0,0 +1,25 @@
##########################################################################
# $Id$
##########################################################################
########################################################
# This was written and is maintained by:
# Chuck Lane <lane@dchooz.org>
#
########################################################
# What actual file? Defaults to LogPath if not absolute path....
LogFile = @PERFDATA_LOG@
Logfile = @logdir@/npcd.log
# If the archives are searched, here is one or more line
# (optionally containing wildcards) that tell where they are...
#If you use a "-" in naming add that as well -mgt
Archive = @PERFDATA_LOG@?[0-9]+
Archive = @PERFDATA_LOG@?[0-9]+.gz
Archive = @logdir@/npcd.log.[0-9]+
Archive = @logdir@/npcd.log.[0-9]+.gz
*ApplyEuroDate =
# vi: shiftwidth=3 tabstop=3 et

View File

@@ -0,0 +1,21 @@
# You can put comments anywhere you want to. They are effective for the
# rest of the line.
# this is in the format of <name> = <value>. Whitespace at the beginning
# and end of the lines is removed. Whitespace before and after the = sign
# is removed. Everything is case *insensitive*.
# Yes = True = On = 1
# No = False = Off = 0
Title = pnp4nagios-messages
# Which logfile group...
LogFile = pnp4nagios
# *OnlyService = vsftpd
#*RemoveHeaders =
# vi: shiftwidth=3 tabstop=3 et

View File

@@ -0,0 +1,71 @@
#!@PERL@
##########################################################################
# $Id: $
##########################################################################
# $Log: $
# Rev for pnp4nagios 0.6.26 2022/10/23 lane@dchooz.org
##########################################################################
use strict;
use Logwatch ':all';
my $Debug = $ENV{'LOGWATCH_DEBUG'} || 0;
my $DebugCounter = 0;
my @OtherList = ();
if ( $Debug >= 5 ) {
print STDERR "\n\nDEBUG: Inside pnp4nagios Filter \n\n";
$DebugCounter = 1;
}
my $line = 0;
#my $date = '\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \[\d+\] \[\d+\]';
while (defined(my $ThisLine = <STDIN>)) {
if ( $Debug >= 5 ) {
print STDERR "DEBUG($DebugCounter): $ThisLine";
$DebugCounter++;
}
chomp($ThisLine);
$ThisLine =~ s/^File truncated// if $line == 0;
$line++;
if (
($ThisLine =~ /Found Performance Data for/) or
($ThisLine =~ /\d+ lines processed/) or
($ThisLine =~ /\/var\/spool\/pnp4nagios\/service-perfdata\.\d+-PID-\d+ deleted/) or
($ThisLine =~ /\/var\/spool\/pnp4nagios\/host-perfdata\.\d+-PID-\d+ deleted/) or
($ThisLine =~ /PNP exiting \(runtime/) or
($ThisLine =~ /process_perfdata.pl-[\.\d]+ starting in BULK Mode called by (NPCD|Nagios)/) or
($ThisLine =~ /process_perfdata.pl-[\.\d]+ starting in SYNC Mode/) or
($ThisLine =~ /process_perfdata.pl-[\.\d]+ starting in STDIN Mode/) or
($ThisLine =~ /NPCD: Found \d+ files in/) or
($ThisLine =~ /NPCD: ThreadCounter \d+\/\d+ File is/) or
($ThisLine =~ /NPCD: Regular File: (host|service)-perfdata\.\d+/) or
($ThisLine =~ /NPCD: A thread was started on thread_counter = \d+/) or
($ThisLine =~ /NPCD: Processing file (host|service)-perfdata\.\d+ with ID \d+ - going to exec/) or
($ThisLine =~ /NPCD: Have to wait: Filecounter = \d+ - thread_counter = \d+/) or
($ThisLine =~ /NPCD: No more files to process\.\.\. waiting for \d+ seconds/) or
0 # this line prevents blame-shifting as lines are added above
)
{
if ( $Debug >= 6 ) {
print STDERR "DEBUG($DebugCounter): line ignored\n";
}
} else
{
# Report any unmatched entries...
push @OtherList, "$ThisLine\n";
}
}
###########################################################
if ($#OtherList >= 0) {
print "\n**Unmatched Entries**\n";
print @OtherList;
}
exit(0);
# vi: shiftwidth=3 tabstop=3 syntax=perl et

View File

@@ -0,0 +1,17 @@
[Unit]
Description=npcd rrd processor for pnp4nagios
Documentation=http://docs.pnp4nagios.org/
After=network.target local-fs.target
[Service]
Type=forking
User=nagios
Group=nagios
PIDFile=/run/nagios/npcd.pid
Environment="CONFIG_FILE=/etc/pnp4nagios/npcd.cfg"
EnvironmentFile=-/etc/sysconfig/npcd
ExecStart=/usr/sbin/npcd -d -f ${CONFIG_FILE}
ExecStop=/bin/kill -s QUIT $MAINPID
[Install]
WantedBy=nagios.service

View File

@@ -0,0 +1,5 @@
#
#
# if the config file is in a different location, change it here
#
#CONFIG_FILE=/etc/pnp4nagios/npcd.cfg

View File

@@ -0,0 +1,89 @@
(For Fedora and other redhat-ish variants)
**** httpd integration ****
pnp4nagios.httpd.plugin.conf -> /etc/systemd/system/httpd.service.d/pnp4nagios.conf
systemctl daemon-reload
...this sets the XDG_CACHE_HOME environment variable needed by
fontconfig that is in turn needed by rrdtool graph generation
it should be an apache-writable directory, typically /var/cache/httpd
**** nagios integration *****
* Default Mode
/etc/nagios/nagios.cfg
process_performance_data=1
service_perfdata_command=process-service-perfdata
/etc/nagios/commands.cfg
define command {
command_name process-service-perfdata
command_line /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl
}
define command {
command_name process-host-perfdata
command_line /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl -d HOSTPERFDATA
}
* Bulk Mode
/etc/nagios/nagios.cfg :
process_performance_data=1
#
# service performance data
#
service_perfdata_file=/var/spool/nagios/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file
/etc/nagios/commands.cfg :
define command{
command_name process-service-perfdata-file
command_line $USER1$/process_perfdata.pl --bulk=/var/spool/nagios/service-perfdata
}
define command{
command_name process-host-perfdata-file
command_line $USER1$/process_perfdata.pl --bulk=/var/spool/nagios/host-perfdata
}
* Bulk Mode with NPCD
npcd daemon needs to be started :
service npcd start
chkconfig npcd on
The configuration is identical to the bulk mode except for the used command.
/etc/nagios/commands.cfg :
define command{
command_name process-service-perfdata-file
command_line /bin/mv /var/spool/nagios/service-perfdata /var/spool/pnp4nagios/service-perfdata.$TIMET$
}
define command{
command_name process-host-perfdata-file
command_line /bin/mv /var/spool/nagios/host-perfdata /var/spool/pnp4nagios/service-perfdata.$TIMET$
}
* Nagios integration
/etc/nagios/hostextinfo.cfg :
define hostextinfo {
host_name localhost
action_url /pnp4nagios/graph?host=$HOSTNAME$
}

View File

@@ -0,0 +1,103 @@
#!/bin/sh
#
# npcd Nagios Performancedata C Daemon
#
# chkconfig: - 98 02
# description: Nagios Performancedata C Daemon
### BEGIN INIT INFO
# Provides:
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description:
# Description:
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/usr/sbin/npcd"
prog="npcd"
config="/etc/pnp4nagios/npcd.cfg"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
daemon $exec -f $config -d
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@@ -0,0 +1,7 @@
@logdir@/*.log {
compress
missingok
notifempty
rotate 5
size 100k
}

View File

@@ -1,128 +0,0 @@
# $Id:$
# Upstream: pnp4nagios-devel@lists.sourceforge.net
Name: pnp4nagios
Version: 0.6.16
Release: 1
Summary: PNP is not PerfParse. A Nagios/Icinga perfdata graphing solution
Group: Applications/System
License: GPLv2
URL: http://www.pnp4nagios.org/
Source: http://downloads.sourceforge.net/pnp4nagios/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: rrdtool-devel
BuildRequires: perl-rrdtool
Requires: rrdtool
Requires: perl-rrdtool
Obsoletes: pnp
%description
PNP is an addon to Nagios/Icinga which analyzes performance data provided by plugins and stores them automatically into RRD-databases.
%prep
%setup
%build
sed -i -e 's/INSTALL_OPTS="-o $nagios_user -g $nagios_grp"/INSTALL_OPTS=""/' configure
sed -i -e 's/INIT_OPTS=-o root -g root/INIT_OPTS=/' scripts/Makefile.in
# hardcode that until a proper fix is upstream
sed -i -e 's/MANDIR=@mandir@/MANDIR=\/usr\/share\/man/' man/Makefile.in
%configure --with-perfdata-logfile=%{_localstatedir}/log/nagios/perfdata.log \
--sysconfdir=%{_sysconfdir}/%{name} \
--datarootdir=%{_datadir}/%{name} \
--with-perfdata-dir=%{_datadir}/%{name}/perfdata \
--with-perfdata-spool-dir=%{_localstatedir}/spool/nagios \
--mandir=%{_mandir} \
--libdir=%{_libdir}/%{name} # only kohana is installed there and maybe we have a system wide kohana already
make %{?_smp_mflags} all
%install
rm -rf %{buildroot}
%{__mkdir} -p %{buildroot}%{_sysconfdir}/httpd/conf.d/
make fullinstall DESTDIR=%{buildroot}
mv %{buildroot}%{_sysconfdir}/%{name}/check_commands/check_nwstat.cfg-sample %{buildroot}%{_sysconfdir}/%{name}/check_commands/check_nwstat.cfg
mv %{buildroot}%{_sysconfdir}/%{name}/pages/web_traffic.cfg-sample %{buildroot}%{_sysconfdir}/%{name}/pages/web_traffic.cfg
mv %{buildroot}%{_sysconfdir}/%{name}/rra.cfg-sample %{buildroot}%{_sysconfdir}/%{name}/rra.cfg
sed -i -e 's*log_file = /var/npcd.log*log_file = /var/log/nagios/npcd.log*' %{buildroot}%{_sysconfdir}/%{name}/npcd.cfg
# drop local versioning, we already provide our own upgrade safety
rm -f %{buildroot}%{_sysconfdir}/%{name}/config.php.%{version}
rm -f %{buildroot}%{_sysconfdir}/%{name}/config_local.php
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,nagios,nagios,-)
%doc AUTHORS
%doc ChangeLog
%doc COPYING
%doc INSTALL
%doc README
%doc THANKS
%config(noreplace) %{_sysconfdir}/%{name}/check_commands/check_all_local_disks.cfg-sample
%config(noreplace) %{_sysconfdir}/%{name}/check_commands/check_nrpe.cfg-sample
%config(noreplace) %{_sysconfdir}/%{name}/check_commands/check_nwstat.cfg
%config(noreplace) %{_sysconfdir}/%{name}/npcd.cfg
%config(noreplace) %{_sysconfdir}/%{name}/pages/web_traffic.cfg
%config(noreplace) %{_sysconfdir}/%{name}/process_perfdata.cfg
%config(noreplace) %{_sysconfdir}/%{name}/rra.cfg
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
%{_sysconfdir}/%{name}/background.pdf
%{_sysconfdir}/%{name}/config.php
%{_sysconfdir}/%{name}/misccommands.cfg-sample
%{_sysconfdir}/%{name}/nagios.cfg-sample
%{_sysconfdir}/%{name}/pnp4nagios_release
%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/npcd
%attr(755,root,root) %{_sysconfdir}/rc.d/init.d/pnp_gearman_worker
%{_bindir}/npcd
%{_libdir}/pnp4nagios/npcdmod.o
%{_libdir}/%{name}
%{_libexecdir}/check_pnp_rrds.pl
%{_libexecdir}/process_perfdata.pl
%{_libexecdir}/rrd_convert.pl
%{_datadir}/%{name}
%{_mandir}/man8/npcd.8.gz
%changelog
* Mon Feb 06 2012 Michael Friedrich <michael.friedrich@univie.ac.at> - 0.6.16-1
- Updated to version 0.6.16.
- drop (Build)Requires nagios, we can use other core(s) as well
- verify_pnp_config.pl => verify_pnp_config_v2.pl not installed anymore
- npcd.cfg and process_perfdata.cfg get now installed by make install w/o -sample suffix
- recognize new initscript for pnp_gearman_worker
- autoremove versionized config.php, we use config(noreplace)
- drop config_local.php which would override default settings
- fix npcd.8 man page prefix install
* Tue Feb 15 2011 Christoph Maser <cmr@financial.com> - 0.6.11-1
- Updated to version 0.6.11.
* Tue Aug 31 2010 Christoph Maser <cmr@financial.com> - 0.6.6-1
- Updated to version 0.6.6.
* Thu Dec 24 2009 Christoph Maser <cmr@financial.com> - 0.6.2 - 2
- add --with-perfdata-spool-dir and --with-perfdata--dir
- mark httpd-config snippet as config file
* Thu Dec 24 2009 Christoph Maser <cmr@financial.com> - 0.6.2 - 1
- Update to version 0.6.2
- Rename to pnp4nagios
* Mon Mar 23 2009 Christoph Maser <cmr@financial.com> - 0.4.14 - 2
- Update to version 0.4.14
* Mon Mar 23 2009 Christoph Maser <cmr@financial.com> - 0.4.13 - 2
- modify log path
- add documentation files
* Mon Mar 23 2009 Christoph Maser <cmr@financial.com> - 0.4.13 - 1
- Initial package (using brain ;)

View File

@@ -1,5 +1,5 @@
<script src="@BASE_URL@/media/js/jquery-min.js" type="text/javascript"></script>
<script src="@BASE_URL@/media/js/jquery.cluetip.js" type="text/javascript"></script>
<script src="@PNP_URL@/media/js/jquery-min.js" type="text/javascript"></script>
<script src="@PNP_URL@/media/js/jquery.cluetip.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {

View File

@@ -39,4 +39,4 @@ for L in $LANG; do
((lindex++))
done
rm de_DE/dwnld.html
ln -s en_US/dwnld.html de_DE/dwnld.html
ln -s ../en_US/dwnld.html de_DE/dwnld.html

2
include/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
config.h
stamp-h

View File

@@ -12,9 +12,6 @@
/* Define to 1 if you have the `bzero' function. */
#undef HAVE_BZERO
/* Define to 1 if you have the `getloadavg' function. */
#undef HAVE_GETLOADAVG
/* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
@@ -27,6 +24,9 @@
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define to 1 if you have the `getloadavg' function. */
#undef HAVE_GETLOADAVG
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
@@ -43,9 +43,6 @@
to 0 otherwise. */
#undef HAVE_MALLOC
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
@@ -89,7 +86,7 @@
/* Define to 1 if you have the `strspn' function. */
#undef HAVE_STRSPN
/* Define to 1 if `d_type' is member of `struct dirent'. */
/* Define to 1 if `d_type' is a member of `struct dirent'. */
#undef HAVE_STRUCT_DIRENT_D_TYPE
/* Define to 1 if you have the <syslog.h> header file. */
@@ -99,6 +96,12 @@
*/
#undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/loadavg.h> header file. */
#undef HAVE_SYS_LOADAVG_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
@@ -118,9 +121,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
@@ -149,13 +149,15 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Define to 1 if you have the ANSI C header files. */
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
/* Define to empty if `const' does not conform to ANSI C. */
@@ -167,7 +169,7 @@
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
/* Define to `int' if <sys/types.h> does not define. */
/* Define as a signed integer type capable of holding a process identifier. */
#undef pid_t
/* Define to `int' if <sys/types.h> doesn't define. */

1
include/stamp-h.in Normal file
View File

@@ -0,0 +1 @@
2023-10-09T09:17:20-04:00

1
lib/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
Makefile

View File

@@ -1,7 +1,6 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
LOGDIR=@localstatedir@
CFGDIR=@sysconfdir@
BINDIR=@bindir@
CGIDIR=@sbindir@
LIBDIR=@libdir@
@@ -22,284 +21,285 @@ devclean: distclean
install:
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/controllers
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/helpers
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Image
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Session
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/config
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/core
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/views
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/views/pagination
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBDIR)/kohana/system/fonts
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/controllers/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/controllers/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/controllers/template.php $(DESTDIR)$(LIBDIR)/kohana/system/controllers/template.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/de_DE/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/nl_NL/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/es_ES/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/ru_RU/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/en_US/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/fr_FR/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/validation.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/core.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/orm.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/image.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/session.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/database.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/event.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/errors.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/swift.php $(DESTDIR)$(LIBDIR)/kohana/system/i18n/it_IT/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/remote.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/remote.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/url.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/url.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/feed.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/feed.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/expires.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/expires.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/text.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/text.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/email.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/email.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/download.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/download.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/format.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/format.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/form.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/form.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/arr.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/arr.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/html.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/html.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/valid.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/valid.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/date.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/date.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/file.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/file.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/request.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/request.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/cookie.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/cookie.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/security.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/security.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/num.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/num.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/inflector.php $(DESTDIR)$(LIBDIR)/kohana/system/helpers/inflector.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM_Tree.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/ORM_Tree.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Encrypt.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Database_Expression.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Database_Expression.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Event_Observer.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Event_Observer.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Event_Subject.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Event_Subject.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Cache.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Session.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Mssql.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database/Mssql.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Pdosqlite.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database/Pdosqlite.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Mysqli.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database/Mysqli.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Pgsql.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database/Pgsql.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Mysql.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database/Mysql.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Alpha.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Alpha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Math.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Math.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Word.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Word.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Riddle.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Riddle.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Basic.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Basic.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Black.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha/Black.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Eaccelerator.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/Eaccelerator.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Apc.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/Apc.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Memcache.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/Memcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Xcache.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/Xcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/File.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/File.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Sqlite.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Cache/Sqlite.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image/GraphicsMagick.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Image/GraphicsMagick.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image/GD.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Image/GD.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image/ImageMagick.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Image/ImageMagick.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session/Cookie.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Session/Cookie.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session/Cache.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Session/Cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session/Database.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Session/Database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/drivers/Database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Image.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Validation.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM_Versioned.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/ORM_Versioned.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Controller.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Controller.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Model.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Model.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/View.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/View.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Router.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Router.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM_Iterator.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/ORM_Iterator.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Profiler_Table.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Profiler_Table.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/URI.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/URI.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/ORM.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Calendar_Event.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Calendar_Event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Tagcloud.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Tagcloud.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Input.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Input.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Database.php $(DESTDIR)$(LIBDIR)/kohana/system/libraries/Database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/locale.php $(DESTDIR)$(LIBDIR)/kohana/system/config/locale.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/routes.php $(DESTDIR)$(LIBDIR)/kohana/system/config/routes.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/pagination.php $(DESTDIR)$(LIBDIR)/kohana/system/config/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/sql_types.php $(DESTDIR)$(LIBDIR)/kohana/system/config/sql_types.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/captcha.php $(DESTDIR)$(LIBDIR)/kohana/system/config/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/email.php $(DESTDIR)$(LIBDIR)/kohana/system/config/email.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/image.php $(DESTDIR)$(LIBDIR)/kohana/system/config/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache_sqlite.php $(DESTDIR)$(LIBDIR)/kohana/system/config/cache_sqlite.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache_memcache.php $(DESTDIR)$(LIBDIR)/kohana/system/config/cache_memcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/session.php $(DESTDIR)$(LIBDIR)/kohana/system/config/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/database.php $(DESTDIR)$(LIBDIR)/kohana/system/config/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/credit_cards.php $(DESTDIR)$(LIBDIR)/kohana/system/config/credit_cards.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/http.php $(DESTDIR)$(LIBDIR)/kohana/system/config/http.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/mimes.php $(DESTDIR)$(LIBDIR)/kohana/system/config/mimes.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/config/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/view.php $(DESTDIR)$(LIBDIR)/kohana/system/config/view.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache.php $(DESTDIR)$(LIBDIR)/kohana/system/config/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/encryption.php $(DESTDIR)$(LIBDIR)/kohana/system/config/encryption.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/upload.php $(DESTDIR)$(LIBDIR)/kohana/system/config/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cookie.php $(DESTDIR)$(LIBDIR)/kohana/system/config/cookie.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/user_agents.php $(DESTDIR)$(LIBDIR)/kohana/system/config/user_agents.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/inflector.php $(DESTDIR)$(LIBDIR)/kohana/system/config/inflector.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache_xcache.php $(DESTDIR)$(LIBDIR)/kohana/system/config/cache_xcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Event.php $(DESTDIR)$(LIBDIR)/kohana/system/core/Event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/transliterate_to_ascii.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/transliterate_to_ascii.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ucfirst.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/ucfirst.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ord.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/ord.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strrpos.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strrpos.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strtolower.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strtolower.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/substr.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/substr.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/str_pad.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/str_pad.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strcspn.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strcspn.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/trim.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/trim.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/rtrim.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/rtrim.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strcasecmp.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strcasecmp.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strtoupper.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strtoupper.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/str_split.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/str_split.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strpos.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strpos.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/stristr.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/stristr.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ucwords.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/ucwords.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/str_ireplace.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/str_ireplace.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strlen.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strlen.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/to_unicode.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/to_unicode.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/substr_replace.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/substr_replace.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/from_unicode.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/from_unicode.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strrev.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strrev.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strspn.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/strspn.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ltrim.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8/ltrim.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Benchmark.php $(DESTDIR)$(LIBDIR)/kohana/system/core/Benchmark.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Bootstrap.php $(DESTDIR)$(LIBDIR)/kohana/system/core/Bootstrap.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Kohana.php $(DESTDIR)$(LIBDIR)/kohana/system/core/Kohana.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8.php $(DESTDIR)$(LIBDIR)/kohana/system/core/utf8.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_profiler_table.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_profiler_table.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana/template.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana/template.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_error_page.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_error_page.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_calendar.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/digg.php $(DESTDIR)$(LIBDIR)/kohana/system/views/pagination/digg.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/punbb.php $(DESTDIR)$(LIBDIR)/kohana/system/views/pagination/punbb.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/extended.php $(DESTDIR)$(LIBDIR)/kohana/system/views/pagination/extended.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/classic.php $(DESTDIR)$(LIBDIR)/kohana/system/views/pagination/classic.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_profiler_table.css $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_profiler_table.css
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_profiler.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_error_disabled.php $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_error_disabled.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_errors.css $(DESTDIR)$(LIBDIR)/kohana/system/views/kohana_errors.css
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/fonts/LICENSE $(DESTDIR)$(LIBDIR)/kohana/system/fonts/LICENSE
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/fonts/DejaVuSerif.ttf $(DESTDIR)$(LIBDIR)/kohana/system/fonts/DejaVuSerif.ttf
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/controllers
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Database
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Captcha
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Cache
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Image
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Session
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/config
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/core
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/views
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/kohana
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/pagination
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(DATAROOTDIR)/kohana/system/fonts
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/controllers/captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/controllers/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/controllers/template.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/controllers/template.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/validation.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/core.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/pagination.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/encrypt.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/orm.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/image.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/session.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/calendar.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/profiler.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/upload.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/event.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/errors.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/de_DE/swift.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/de_DE/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/validation.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/core.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/pagination.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/encrypt.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/orm.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/image.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/session.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/calendar.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/profiler.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/upload.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/event.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/errors.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/nl_NL/swift.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/nl_NL/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/validation.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/core.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/pagination.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/encrypt.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/orm.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/image.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/session.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/calendar.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/profiler.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/upload.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/event.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/errors.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/es_ES/swift.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/es_ES/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/validation.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/core.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/pagination.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/encrypt.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/orm.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/image.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/session.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/calendar.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/profiler.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/upload.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/event.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/errors.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/ru_RU/swift.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/ru_RU/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/validation.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/core.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/pagination.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/encrypt.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/orm.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/image.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/session.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/calendar.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/profiler.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/upload.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/event.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/errors.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/en_US/swift.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/en_US/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/validation.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/core.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/pagination.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/encrypt.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/orm.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/image.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/session.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/calendar.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/profiler.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/upload.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/event.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/errors.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/fr_FR/swift.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/fr_FR/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/validation.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/core.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/core.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/pagination.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/encrypt.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/orm.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/orm.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/image.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/session.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/calendar.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/profiler.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/upload.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/event.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/errors.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/errors.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/i18n/it_IT/swift.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/i18n/it_IT/swift.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/remote.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/remote.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/url.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/url.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/feed.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/feed.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/expires.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/expires.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/text.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/text.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/email.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/email.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/download.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/download.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/format.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/format.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/form.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/form.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/arr.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/arr.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/html.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/html.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/valid.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/valid.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/date.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/date.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/file.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/file.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/request.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/request.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/upload.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/cookie.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/cookie.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/security.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/security.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/num.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/num.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/helpers/inflector.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/helpers/inflector.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Pagination.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM_Tree.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/ORM_Tree.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Encrypt.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Encrypt.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Calendar.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Database_Expression.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Database_Expression.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Event_Observer.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Event_Observer.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Event_Subject.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Event_Subject.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Session.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Mssql.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Database/Mssql.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Pdosqlite.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Database/Pdosqlite.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Mysqli.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Database/Mysqli.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Pgsql.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Database/Pgsql.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database/Mysql.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Database/Mysql.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Alpha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Captcha/Alpha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Math.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Captcha/Math.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Word.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Captcha/Word.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Riddle.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Captcha/Riddle.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Basic.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Captcha/Basic.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha/Black.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Captcha/Black.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Eaccelerator.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Cache/Eaccelerator.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Apc.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Cache/Apc.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Memcache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Cache/Memcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Xcache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Cache/Xcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/File.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Cache/File.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Cache/Sqlite.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Cache/Sqlite.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image/GraphicsMagick.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Image/GraphicsMagick.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image/GD.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Image/GD.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Image/ImageMagick.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Image/ImageMagick.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session/Cookie.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Session/Cookie.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session/Cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Session/Cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Session/Database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Session/Database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/drivers/Database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/drivers/Database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Image.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Validation.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Validation.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM_Versioned.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/ORM_Versioned.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Controller.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Controller.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Profiler.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Model.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Model.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/View.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/View.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Router.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Router.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM_Iterator.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/ORM_Iterator.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Profiler_Table.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Profiler_Table.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/URI.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/URI.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/ORM.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/ORM.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Calendar_Event.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Calendar_Event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Tagcloud.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Tagcloud.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Input.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Input.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/libraries/Database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/libraries/Database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/locale.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/locale.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/routes.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/routes.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/pagination.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/pagination.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/sql_types.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/sql_types.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/captcha.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/captcha.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/email.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/email.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/image.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/image.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache_sqlite.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/cache_sqlite.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache_memcache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/cache_memcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/session.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/session.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/database.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/database.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/credit_cards.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/credit_cards.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/http.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/http.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/mimes.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/mimes.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/profiler.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/view.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/view.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/cache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/encryption.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/encryption.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/upload.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/upload.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cookie.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/cookie.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/user_agents.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/user_agents.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/inflector.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/inflector.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/config/cache_xcache.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/config/cache_xcache.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Event.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/Event.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/transliterate_to_ascii.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/transliterate_to_ascii.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ucfirst.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/ucfirst.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ord.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/ord.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strrpos.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/strrpos.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strtolower.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/strtolower.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/substr.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/substr.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/str_pad.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/str_pad.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strcspn.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/strcspn.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/trim.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/trim.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/rtrim.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/rtrim.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strcasecmp.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/strcasecmp.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strtoupper.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/strtoupper.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/str_split.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/str_split.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strpos.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/strpos.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/stristr.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/stristr.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ucwords.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/ucwords.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/str_ireplace.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/str_ireplace.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strlen.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/strlen.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/to_unicode.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/to_unicode.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/substr_replace.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/substr_replace.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/from_unicode.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/from_unicode.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strrev.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/strrev.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/strspn.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/strspn.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8/ltrim.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8/ltrim.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Benchmark.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/Benchmark.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Bootstrap.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/Bootstrap.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Security.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/Security.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/Kohana.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/Kohana.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/core/utf8.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/core/utf8.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_profiler_table.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/kohana_profiler_table.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana/template.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/kohana/template.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_error_page.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/kohana_error_page.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_calendar.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/kohana_calendar.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/digg.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/pagination/digg.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/punbb.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/pagination/punbb.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/extended.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/pagination/extended.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/pagination/classic.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/pagination/classic.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_profiler_table.css $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/kohana_profiler_table.css
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_profiler.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/kohana_profiler.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_error_disabled.php $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/kohana_error_disabled.php
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/views/kohana_errors.css $(DESTDIR)$(DATAROOTDIR)/kohana/system/views/kohana_errors.css
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/fonts/LICENSE $(DESTDIR)$(DATAROOTDIR)/kohana/system/fonts/LICENSE
$(INSTALL) -m 644 $(INSTALL_OPTS) kohana/system/fonts/DejaVuSerif.ttf $(DESTDIR)$(DATAROOTDIR)/kohana/system/fonts/DejaVuSerif.ttf

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Cache
*
@@ -25,8 +29,8 @@
*/
$config['default'] = array
(
'driver' => 'file',
'params' => APPPATH.'cache',
'lifetime' => 1800,
'requests' => 1000
'driver' => 'file',
'params' => APPPATH . 'cache',
'lifetime' => 1800,
'requests' => 1000
);

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Cache:Memcache
*
@@ -6,15 +10,15 @@
*/
$config['servers'] = array
(
array
(
'host' => '127.0.0.1',
'port' => 11211,
'persistent' => FALSE,
)
array
(
'host' => '127.0.0.1',
'port' => 11211,
'persistent' => false,
)
);
/**
* Enable cache data compression.
*/
$config['compression'] = FALSE;
$config['compression'] = false;

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Cache:SQLite
*/
@@ -7,4 +11,4 @@ $config['schema'] =
id VARCHAR(127) PRIMARY KEY,
tags VARCHAR(255),
expiration INTEGER,
cache TEXT);';
cache TEXT);';

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Cache:Xcache
*

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Core
*
@@ -18,12 +22,12 @@
*/
$config['default'] = array
(
'style' => 'basic',
'width' => 150,
'height' => 50,
'complexity' => 4,
'background' => '',
'fontpath' => SYSPATH.'fonts/',
'fonts' => array('DejaVuSerif.ttf'),
'promote' => FALSE,
);
'style' => 'basic',
'width' => 150,
'height' => 50,
'complexity' => 4,
'background' => '',
'fontpath' => SYSPATH . 'fonts/',
'fonts' => array('DejaVuSerif.ttf'),
'promote' => false,
);

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Core
*
@@ -23,10 +27,10 @@ $config['expire'] = 0;
* Enable this option to only allow the cookie to be read when using the a
* secure protocol.
*/
$config['secure'] = FALSE;
$config['secure'] = false;
/**
* Enable this option to disable the cookie from being accessed when using a
* secure protocol. This option is only available in PHP 5.2 and above.
*/
$config['httponly'] = FALSE;
$config['httponly'] = false;

View File

@@ -1,7 +1,11 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* Credit card validation configuration.
*
*
* Options for each credit card:
* length - All the allowed card number lengths, in a comma separated string
* prefix - The digits the card needs to start with, in regex format
@@ -9,52 +13,52 @@
*/
$config = array
(
'default' => array
(
'length' => '13,14,15,16,17,18,19',
'prefix' => '',
'luhn' => TRUE
),
'american express' => array
(
'length' => '15',
'prefix' => '3[47]',
'luhn' => TRUE
),
'diners club' => array
(
'length' => '14,16',
'prefix' => '36|55|30[0-5]',
'luhn' => TRUE
),
'discover' => array
(
'length' => '16',
'prefix' => '6(?:5|011)',
'luhn' => TRUE,
),
'jcb' => array
(
'length' => '15,16',
'prefix' => '3|1800|2131',
'luhn' => TRUE
),
'maestro' => array
(
'length' => '16,18',
'prefix' => '50(?:20|38)|6(?:304|759)',
'luhn' => TRUE
),
'mastercard' => array
(
'length' => '16',
'prefix' => '5[1-5]',
'luhn' => TRUE
),
'visa' => array
(
'length' => '13,16',
'prefix' => '4',
'luhn' => TRUE
),
);
'default' => array
(
'length' => '13,14,15,16,17,18,19',
'prefix' => '',
'luhn' => true
),
'american express' => array
(
'length' => '15',
'prefix' => '3[47]',
'luhn' => true
),
'diners club' => array
(
'length' => '14,16',
'prefix' => '36|55|30[0-5]',
'luhn' => true
),
'discover' => array
(
'length' => '16',
'prefix' => '6(?:5|011)',
'luhn' => true,
),
'jcb' => array
(
'length' => '15,16',
'prefix' => '3|1800|2131',
'luhn' => true
),
'maestro' => array
(
'length' => '16,18',
'prefix' => '50(?:20|38)|6(?:304|759)',
'luhn' => true
),
'mastercard' => array
(
'length' => '16',
'prefix' => '5[1-5]',
'luhn' => true
),
'visa' => array
(
'length' => '13,16',
'prefix' => '4',
'luhn' => true
),
);

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Database
*
@@ -21,25 +25,25 @@
* table_prefix - Database table prefix
* object - Enable or disable object results
* cache - Enable or disable query caching
* escape - Enable automatic query builder escaping
* escape - Enable automatic query builder escaping
*/
$config['default'] = array
(
'benchmark' => TRUE,
'persistent' => FALSE,
'connection' => array
(
'type' => 'mysql',
'user' => 'dbuser',
'pass' => 'p@ssw0rd',
'host' => 'localhost',
'port' => FALSE,
'socket' => FALSE,
'database' => 'kohana'
),
'character_set' => 'utf8',
'table_prefix' => '',
'object' => TRUE,
'cache' => FALSE,
'escape' => TRUE
);
'benchmark' => true,
'persistent' => false,
'connection' => array
(
'type' => 'mysql',
'user' => 'dbuser',
'pass' => 'p@ssw0rd',
'host' => 'localhost',
'port' => false,
'socket' => false,
'database' => 'kohana'
),
'character_set' => 'utf8',
'table_prefix' => '',
'object' => true,
'cache' => false,
'escape' => true
);

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* SwiftMailer driver, used with the email helper.
*
@@ -19,4 +23,4 @@ $config['driver'] = 'native';
* @param string sendmail: executable path, with -bs or equivalent attached
* @param array smtp: hostname, (username), (password), (port), (auth), (encryption)
*/
$config['options'] = NULL;
$config['options'] = null;

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Encrypt
*
@@ -25,7 +29,7 @@
*/
$config['default'] = array
(
'key' => 'K0H@NA+PHP_7hE-SW!FtFraM3w0R|<',
'mode' => MCRYPT_MODE_NOFB,
'cipher' => MCRYPT_RIJNDAEL_128
'key' => 'K0H@NA+PHP_7hE-SW!FtFraM3w0R|<',
'mode' => MCRYPT_MODE_NOFB,
'cipher' => MCRYPT_RIJNDAEL_128
);

View File

@@ -1,19 +1,23 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
// HTTP-EQUIV type meta tags
$config['meta_equiv'] = array
(
'cache-control',
'content-type', 'content-script-type', 'content-style-type',
'content-disposition',
'content-language',
'default-style',
'expires',
'ext-cache',
'pics-label',
'pragma',
'refresh',
'set-cookie',
'vary',
'window-target',
);
'cache-control',
'content-type', 'content-script-type', 'content-style-type',
'content-disposition',
'content-language',
'default-style',
'expires',
'ext-cache',
'pics-label',
'pragma',
'refresh',
'set-cookie',
'vary',
'window-target',
);

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Image
*
@@ -10,4 +14,4 @@ $config['driver'] = 'GD';
* Driver parameters:
* ImageMagick - set the "directory" parameter to your ImageMagick installation directory
*/
$config['params'] = array();
$config['params'] = array();

View File

@@ -1,58 +1,62 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
$config['uncountable'] = array
(
'access',
'advice',
'art',
'baggage',
'dances',
'equipment',
'fish',
'fuel',
'furniture',
'food',
'heat',
'honey',
'homework',
'impatience',
'information',
'knowledge',
'luggage',
'money',
'music',
'news',
'patience',
'progress',
'pollution',
'research',
'rice',
'sand',
'series',
'sheep',
'sms',
'species',
'staff',
'toothpaste',
'traffic',
'understanding',
'water',
'weather',
'work',
'access',
'advice',
'art',
'baggage',
'dances',
'equipment',
'fish',
'fuel',
'furniture',
'food',
'heat',
'honey',
'homework',
'impatience',
'information',
'knowledge',
'luggage',
'money',
'music',
'news',
'patience',
'progress',
'pollution',
'research',
'rice',
'sand',
'series',
'sheep',
'sms',
'species',
'staff',
'toothpaste',
'traffic',
'understanding',
'water',
'weather',
'work',
);
$config['irregular'] = array
(
'child' => 'children',
'clothes' => 'clothing',
'man' => 'men',
'movie' => 'movies',
'person' => 'people',
'woman' => 'women',
'mouse' => 'mice',
'goose' => 'geese',
'ox' => 'oxen',
'leaf' => 'leaves',
'course' => 'courses',
'size' => 'sizes',
'child' => 'children',
'clothes' => 'clothing',
'man' => 'men',
'movie' => 'movies',
'person' => 'people',
'woman' => 'women',
'mouse' => 'mice',
'goose' => 'geese',
'ox' => 'oxen',
'leaf' => 'leaves',
'course' => 'courses',
'size' => 'sizes',
);

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Core
*
@@ -13,4 +17,4 @@ $config['language'] = array('en_US', 'English_United States');
* Locale timezone. Defaults to use the server timezone.
* @see http://php.net/timezones
*/
$config['timezone'] = '';
$config['timezone'] = '';

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Core
*
@@ -11,214 +15,214 @@
*/
$config = array
(
'323' => array('text/h323'),
'7z' => array('application/x-7z-compressed'),
'abw' => array('application/x-abiword'),
'acx' => array('application/internet-property-stream'),
'ai' => array('application/postscript'),
'aif' => array('audio/x-aiff'),
'aifc' => array('audio/x-aiff'),
'aiff' => array('audio/x-aiff'),
'asf' => array('video/x-ms-asf'),
'asr' => array('video/x-ms-asf'),
'asx' => array('video/x-ms-asf'),
'atom' => array('application/atom+xml'),
'avi' => array('video/avi', 'video/msvideo', 'video/x-msvideo'),
'bin' => array('application/octet-stream','application/macbinary'),
'bmp' => array('image/bmp'),
'c' => array('text/x-csrc'),
'c++' => array('text/x-c++src'),
'cab' => array('application/x-cab'),
'cc' => array('text/x-c++src'),
'cda' => array('application/x-cdf'),
'class' => array('application/octet-stream'),
'cpp' => array('text/x-c++src'),
'cpt' => array('application/mac-compactpro'),
'csh' => array('text/x-csh'),
'css' => array('text/css'),
'csv' => array('text/x-comma-separated-values', 'application/vnd.ms-excel', 'text/comma-separated-values', 'text/csv'),
'dbk' => array('application/docbook+xml'),
'dcr' => array('application/x-director'),
'deb' => array('application/x-debian-package'),
'diff' => array('text/x-diff'),
'dir' => array('application/x-director'),
'divx' => array('video/divx'),
'dll' => array('application/octet-stream', 'application/x-msdos-program'),
'dmg' => array('application/x-apple-diskimage'),
'dms' => array('application/octet-stream'),
'doc' => array('application/msword'),
'dvi' => array('application/x-dvi'),
'dxr' => array('application/x-director'),
'eml' => array('message/rfc822'),
'eps' => array('application/postscript'),
'evy' => array('application/envoy'),
'exe' => array('application/x-msdos-program', 'application/octet-stream'),
'fla' => array('application/octet-stream'),
'flac' => array('application/x-flac'),
'flc' => array('video/flc'),
'fli' => array('video/fli'),
'flv' => array('video/x-flv'),
'gif' => array('image/gif'),
'gtar' => array('application/x-gtar'),
'gz' => array('application/x-gzip'),
'h' => array('text/x-chdr'),
'h++' => array('text/x-c++hdr'),
'hh' => array('text/x-c++hdr'),
'hpp' => array('text/x-c++hdr'),
'hqx' => array('application/mac-binhex40'),
'hs' => array('text/x-haskell'),
'htm' => array('text/html'),
'html' => array('text/html'),
'ico' => array('image/x-icon'),
'ics' => array('text/calendar'),
'iii' => array('application/x-iphone'),
'ins' => array('application/x-internet-signup'),
'iso' => array('application/x-iso9660-image'),
'isp' => array('application/x-internet-signup'),
'jar' => array('application/java-archive'),
'java' => array('application/x-java-applet'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'js' => array('application/x-javascript'),
'json' => array('application/json'),
'latex' => array('application/x-latex'),
'lha' => array('application/octet-stream'),
'log' => array('text/plain', 'text/x-log'),
'lzh' => array('application/octet-stream'),
'm4a' => array('audio/mpeg'),
'm4p' => array('video/mp4v-es'),
'm4v' => array('video/mp4'),
'man' => array('application/x-troff-man'),
'mdb' => array('application/x-msaccess'),
'midi' => array('audio/midi'),
'mid' => array('audio/midi'),
'mif' => array('application/vnd.mif'),
'mka' => array('audio/x-matroska'),
'mkv' => array('video/x-matroska'),
'mov' => array('video/quicktime'),
'movie' => array('video/x-sgi-movie'),
'mp2' => array('audio/mpeg'),
'mp3' => array('audio/mpeg'),
'mp4' => array('application/mp4','audio/mp4','video/mp4'),
'mpa' => array('video/mpeg'),
'mpe' => array('video/mpeg'),
'mpeg' => array('video/mpeg'),
'mpg' => array('video/mpeg'),
'mpg4' => array('video/mp4'),
'mpga' => array('audio/mpeg'),
'mpp' => array('application/vnd.ms-project'),
'mpv' => array('video/x-matroska'),
'mpv2' => array('video/mpeg'),
'ms' => array('application/x-troff-ms'),
'msg' => array('application/msoutlook','application/x-msg'),
'msi' => array('application/x-msi'),
'nws' => array('message/rfc822'),
'oda' => array('application/oda'),
'odb' => array('application/vnd.oasis.opendocument.database'),
'odc' => array('application/vnd.oasis.opendocument.chart'),
'odf' => array('application/vnd.oasis.opendocument.forumla'),
'odg' => array('application/vnd.oasis.opendocument.graphics'),
'odi' => array('application/vnd.oasis.opendocument.image'),
'odm' => array('application/vnd.oasis.opendocument.text-master'),
'odp' => array('application/vnd.oasis.opendocument.presentation'),
'ods' => array('application/vnd.oasis.opendocument.spreadsheet'),
'odt' => array('application/vnd.oasis.opendocument.text'),
'oga' => array('audio/ogg'),
'ogg' => array('application/ogg'),
'ogv' => array('video/ogg'),
'otg' => array('application/vnd.oasis.opendocument.graphics-template'),
'oth' => array('application/vnd.oasis.opendocument.web'),
'otp' => array('application/vnd.oasis.opendocument.presentation-template'),
'ots' => array('application/vnd.oasis.opendocument.spreadsheet-template'),
'ott' => array('application/vnd.oasis.opendocument.template'),
'p' => array('text/x-pascal'),
'pas' => array('text/x-pascal'),
'patch' => array('text/x-diff'),
'pbm' => array('image/x-portable-bitmap'),
'pdf' => array('application/pdf', 'application/x-download'),
'php' => array('application/x-httpd-php'),
'php3' => array('application/x-httpd-php'),
'php4' => array('application/x-httpd-php'),
'php5' => array('application/x-httpd-php'),
'phps' => array('application/x-httpd-php-source'),
'phtml' => array('application/x-httpd-php'),
'pl' => array('text/x-perl'),
'pm' => array('text/x-perl'),
'png' => array('image/png', 'image/x-png'),
'po' => array('text/x-gettext-translation'),
'pot' => array('application/vnd.ms-powerpoint'),
'pps' => array('application/vnd.ms-powerpoint'),
'ppt' => array('application/powerpoint'),
'ps' => array('application/postscript'),
'psd' => array('application/x-photoshop', 'image/x-photoshop'),
'pub' => array('application/x-mspublisher'),
'py' => array('text/x-python'),
'qt' => array('video/quicktime'),
'ra' => array('audio/x-realaudio'),
'ram' => array('audio/x-realaudio', 'audio/x-pn-realaudio'),
'rar' => array('application/rar'),
'rgb' => array('image/x-rgb'),
'rm' => array('audio/x-pn-realaudio'),
'rpm' => array('audio/x-pn-realaudio-plugin', 'application/x-redhat-package-manager'),
'rss' => array('application/rss+xml'),
'rtf' => array('text/rtf'),
'rtx' => array('text/richtext'),
'rv' => array('video/vnd.rn-realvideo'),
'sea' => array('application/octet-stream'),
'sh' => array('text/x-sh'),
'shtml' => array('text/html'),
'sit' => array('application/x-stuffit'),
'smi' => array('application/smil'),
'smil' => array('application/smil'),
'so' => array('application/octet-stream'),
'src' => array('application/x-wais-source'),
'svg' => array('image/svg+xml'),
'swf' => array('application/x-shockwave-flash'),
't' => array('application/x-troff'),
'tar' => array('application/x-tar'),
'tcl' => array('text/x-tcl'),
'tex' => array('application/x-tex'),
'text' => array('text/plain'),
'texti' => array('application/x-texinfo'),
'textinfo' => array('application/x-texinfo'),
'tgz' => array('application/x-tar'),
'tif' => array('image/tiff'),
'tiff' => array('image/tiff'),
'torrent' => array('application/x-bittorrent'),
'tr' => array('application/x-troff'),
'tsv' => array('text/tab-separated-values'),
'txt' => array('text/plain'),
'wav' => array('audio/x-wav'),
'wax' => array('audio/x-ms-wax'),
'wbxml' => array('application/wbxml'),
'wm' => array('video/x-ms-wm'),
'wma' => array('audio/x-ms-wma'),
'wmd' => array('application/x-ms-wmd'),
'wmlc' => array('application/wmlc'),
'wmv' => array('video/x-ms-wmv', 'application/octet-stream'),
'wmx' => array('video/x-ms-wmx'),
'wmz' => array('application/x-ms-wmz'),
'word' => array('application/msword', 'application/octet-stream'),
'wp5' => array('application/wordperfect5.1'),
'wpd' => array('application/vnd.wordperfect'),
'wvx' => array('video/x-ms-wvx'),
'xbm' => array('image/x-xbitmap'),
'xcf' => array('image/xcf'),
'xhtml' => array('application/xhtml+xml'),
'xht' => array('application/xhtml+xml'),
'xl' => array('application/excel', 'application/vnd.ms-excel'),
'xla' => array('application/excel', 'application/vnd.ms-excel'),
'xlc' => array('application/excel', 'application/vnd.ms-excel'),
'xlm' => array('application/excel', 'application/vnd.ms-excel'),
'xls' => array('application/excel', 'application/vnd.ms-excel'),
'xlt' => array('application/excel', 'application/vnd.ms-excel'),
'xml' => array('text/xml'),
'xof' => array('x-world/x-vrml'),
'xpm' => array('image/x-xpixmap'),
'xsl' => array('text/xml'),
'xvid' => array('video/x-xvid'),
'xwd' => array('image/x-xwindowdump'),
'z' => array('application/x-compress'),
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed')
'323' => array('text/h323'),
'7z' => array('application/x-7z-compressed'),
'abw' => array('application/x-abiword'),
'acx' => array('application/internet-property-stream'),
'ai' => array('application/postscript'),
'aif' => array('audio/x-aiff'),
'aifc' => array('audio/x-aiff'),
'aiff' => array('audio/x-aiff'),
'asf' => array('video/x-ms-asf'),
'asr' => array('video/x-ms-asf'),
'asx' => array('video/x-ms-asf'),
'atom' => array('application/atom+xml'),
'avi' => array('video/avi', 'video/msvideo', 'video/x-msvideo'),
'bin' => array('application/octet-stream','application/macbinary'),
'bmp' => array('image/bmp'),
'c' => array('text/x-csrc'),
'c++' => array('text/x-c++src'),
'cab' => array('application/x-cab'),
'cc' => array('text/x-c++src'),
'cda' => array('application/x-cdf'),
'class' => array('application/octet-stream'),
'cpp' => array('text/x-c++src'),
'cpt' => array('application/mac-compactpro'),
'csh' => array('text/x-csh'),
'css' => array('text/css'),
'csv' => array('text/x-comma-separated-values', 'application/vnd.ms-excel', 'text/comma-separated-values', 'text/csv'),
'dbk' => array('application/docbook+xml'),
'dcr' => array('application/x-director'),
'deb' => array('application/x-debian-package'),
'diff' => array('text/x-diff'),
'dir' => array('application/x-director'),
'divx' => array('video/divx'),
'dll' => array('application/octet-stream', 'application/x-msdos-program'),
'dmg' => array('application/x-apple-diskimage'),
'dms' => array('application/octet-stream'),
'doc' => array('application/msword'),
'dvi' => array('application/x-dvi'),
'dxr' => array('application/x-director'),
'eml' => array('message/rfc822'),
'eps' => array('application/postscript'),
'evy' => array('application/envoy'),
'exe' => array('application/x-msdos-program', 'application/octet-stream'),
'fla' => array('application/octet-stream'),
'flac' => array('application/x-flac'),
'flc' => array('video/flc'),
'fli' => array('video/fli'),
'flv' => array('video/x-flv'),
'gif' => array('image/gif'),
'gtar' => array('application/x-gtar'),
'gz' => array('application/x-gzip'),
'h' => array('text/x-chdr'),
'h++' => array('text/x-c++hdr'),
'hh' => array('text/x-c++hdr'),
'hpp' => array('text/x-c++hdr'),
'hqx' => array('application/mac-binhex40'),
'hs' => array('text/x-haskell'),
'htm' => array('text/html'),
'html' => array('text/html'),
'ico' => array('image/x-icon'),
'ics' => array('text/calendar'),
'iii' => array('application/x-iphone'),
'ins' => array('application/x-internet-signup'),
'iso' => array('application/x-iso9660-image'),
'isp' => array('application/x-internet-signup'),
'jar' => array('application/java-archive'),
'java' => array('application/x-java-applet'),
'jpe' => array('image/jpeg', 'image/pjpeg'),
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg' => array('image/jpeg', 'image/pjpeg'),
'js' => array('application/x-javascript'),
'json' => array('application/json'),
'latex' => array('application/x-latex'),
'lha' => array('application/octet-stream'),
'log' => array('text/plain', 'text/x-log'),
'lzh' => array('application/octet-stream'),
'm4a' => array('audio/mpeg'),
'm4p' => array('video/mp4v-es'),
'm4v' => array('video/mp4'),
'man' => array('application/x-troff-man'),
'mdb' => array('application/x-msaccess'),
'midi' => array('audio/midi'),
'mid' => array('audio/midi'),
'mif' => array('application/vnd.mif'),
'mka' => array('audio/x-matroska'),
'mkv' => array('video/x-matroska'),
'mov' => array('video/quicktime'),
'movie' => array('video/x-sgi-movie'),
'mp2' => array('audio/mpeg'),
'mp3' => array('audio/mpeg'),
'mp4' => array('application/mp4','audio/mp4','video/mp4'),
'mpa' => array('video/mpeg'),
'mpe' => array('video/mpeg'),
'mpeg' => array('video/mpeg'),
'mpg' => array('video/mpeg'),
'mpg4' => array('video/mp4'),
'mpga' => array('audio/mpeg'),
'mpp' => array('application/vnd.ms-project'),
'mpv' => array('video/x-matroska'),
'mpv2' => array('video/mpeg'),
'ms' => array('application/x-troff-ms'),
'msg' => array('application/msoutlook','application/x-msg'),
'msi' => array('application/x-msi'),
'nws' => array('message/rfc822'),
'oda' => array('application/oda'),
'odb' => array('application/vnd.oasis.opendocument.database'),
'odc' => array('application/vnd.oasis.opendocument.chart'),
'odf' => array('application/vnd.oasis.opendocument.forumla'),
'odg' => array('application/vnd.oasis.opendocument.graphics'),
'odi' => array('application/vnd.oasis.opendocument.image'),
'odm' => array('application/vnd.oasis.opendocument.text-master'),
'odp' => array('application/vnd.oasis.opendocument.presentation'),
'ods' => array('application/vnd.oasis.opendocument.spreadsheet'),
'odt' => array('application/vnd.oasis.opendocument.text'),
'oga' => array('audio/ogg'),
'ogg' => array('application/ogg'),
'ogv' => array('video/ogg'),
'otg' => array('application/vnd.oasis.opendocument.graphics-template'),
'oth' => array('application/vnd.oasis.opendocument.web'),
'otp' => array('application/vnd.oasis.opendocument.presentation-template'),
'ots' => array('application/vnd.oasis.opendocument.spreadsheet-template'),
'ott' => array('application/vnd.oasis.opendocument.template'),
'p' => array('text/x-pascal'),
'pas' => array('text/x-pascal'),
'patch' => array('text/x-diff'),
'pbm' => array('image/x-portable-bitmap'),
'pdf' => array('application/pdf', 'application/x-download'),
'php' => array('application/x-httpd-php'),
'php3' => array('application/x-httpd-php'),
'php4' => array('application/x-httpd-php'),
'php5' => array('application/x-httpd-php'),
'phps' => array('application/x-httpd-php-source'),
'phtml' => array('application/x-httpd-php'),
'pl' => array('text/x-perl'),
'pm' => array('text/x-perl'),
'png' => array('image/png', 'image/x-png'),
'po' => array('text/x-gettext-translation'),
'pot' => array('application/vnd.ms-powerpoint'),
'pps' => array('application/vnd.ms-powerpoint'),
'ppt' => array('application/powerpoint'),
'ps' => array('application/postscript'),
'psd' => array('application/x-photoshop', 'image/x-photoshop'),
'pub' => array('application/x-mspublisher'),
'py' => array('text/x-python'),
'qt' => array('video/quicktime'),
'ra' => array('audio/x-realaudio'),
'ram' => array('audio/x-realaudio', 'audio/x-pn-realaudio'),
'rar' => array('application/rar'),
'rgb' => array('image/x-rgb'),
'rm' => array('audio/x-pn-realaudio'),
'rpm' => array('audio/x-pn-realaudio-plugin', 'application/x-redhat-package-manager'),
'rss' => array('application/rss+xml'),
'rtf' => array('text/rtf'),
'rtx' => array('text/richtext'),
'rv' => array('video/vnd.rn-realvideo'),
'sea' => array('application/octet-stream'),
'sh' => array('text/x-sh'),
'shtml' => array('text/html'),
'sit' => array('application/x-stuffit'),
'smi' => array('application/smil'),
'smil' => array('application/smil'),
'so' => array('application/octet-stream'),
'src' => array('application/x-wais-source'),
'svg' => array('image/svg+xml'),
'swf' => array('application/x-shockwave-flash'),
't' => array('application/x-troff'),
'tar' => array('application/x-tar'),
'tcl' => array('text/x-tcl'),
'tex' => array('application/x-tex'),
'text' => array('text/plain'),
'texti' => array('application/x-texinfo'),
'textinfo' => array('application/x-texinfo'),
'tgz' => array('application/x-tar'),
'tif' => array('image/tiff'),
'tiff' => array('image/tiff'),
'torrent' => array('application/x-bittorrent'),
'tr' => array('application/x-troff'),
'tsv' => array('text/tab-separated-values'),
'txt' => array('text/plain'),
'wav' => array('audio/x-wav'),
'wax' => array('audio/x-ms-wax'),
'wbxml' => array('application/wbxml'),
'wm' => array('video/x-ms-wm'),
'wma' => array('audio/x-ms-wma'),
'wmd' => array('application/x-ms-wmd'),
'wmlc' => array('application/wmlc'),
'wmv' => array('video/x-ms-wmv', 'application/octet-stream'),
'wmx' => array('video/x-ms-wmx'),
'wmz' => array('application/x-ms-wmz'),
'word' => array('application/msword', 'application/octet-stream'),
'wp5' => array('application/wordperfect5.1'),
'wpd' => array('application/vnd.wordperfect'),
'wvx' => array('video/x-ms-wvx'),
'xbm' => array('image/x-xbitmap'),
'xcf' => array('image/xcf'),
'xhtml' => array('application/xhtml+xml'),
'xht' => array('application/xhtml+xml'),
'xl' => array('application/excel', 'application/vnd.ms-excel'),
'xla' => array('application/excel', 'application/vnd.ms-excel'),
'xlc' => array('application/excel', 'application/vnd.ms-excel'),
'xlm' => array('application/excel', 'application/vnd.ms-excel'),
'xls' => array('application/excel', 'application/vnd.ms-excel'),
'xlt' => array('application/excel', 'application/vnd.ms-excel'),
'xml' => array('text/xml'),
'xof' => array('x-world/x-vrml'),
'xpm' => array('image/x-xpixmap'),
'xsl' => array('text/xml'),
'xvid' => array('video/x-xvid'),
'xwd' => array('image/x-xwindowdump'),
'z' => array('application/x-compress'),
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed')
);

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Pagination
*
@@ -16,10 +20,10 @@
*/
$config['default'] = array
(
'directory' => 'pagination',
'style' => 'classic',
'uri_segment' => 3,
'query_string' => '',
'items_per_page' => 20,
'auto_hide' => FALSE,
'directory' => 'pagination',
'style' => 'classic',
'uri_segment' => 3,
'query_string' => '',
'items_per_page' => 20,
'auto_hide' => false,
);

View File

@@ -1,8 +1,12 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Profiler
*
* Array of section names to display in the Profiler, TRUE to display all of them.
* Built in sections are benchmarks, database, session, post and cookies, custom sections can be used too.
*/
$config['show'] = TRUE;
$config['show'] = true;

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Core
*

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Session
*
@@ -27,7 +31,7 @@ $config['validate'] = array('user_agent');
* Note: this has no effect on the native session driver.
* Note: the cookie driver always encrypts session data. Set to TRUE for stronger encryption.
*/
$config['encryption'] = FALSE;
$config['encryption'] = false;
/**
* Session lifetime. Number of seconds that each session will last.
@@ -44,4 +48,4 @@ $config['regenerate'] = 3;
/**
* Percentage probability that the gc (garbage collection) routine is started.
*/
$config['gc_probability'] = 2;
$config['gc_probability'] = 2;

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Database
*
@@ -8,27 +12,27 @@
*/
$config = array
(
'tinyint' => array('type' => 'int', 'max' => 127),
'smallint' => array('type' => 'int', 'max' => 32767),
'mediumint' => array('type' => 'int', 'max' => 8388607),
'int' => array('type' => 'int', 'max' => 2147483647),
'integer' => array('type' => 'int', 'max' => 2147483647),
'bigint' => array('type' => 'int', 'max' => 9223372036854775807),
'float' => array('type' => 'float'),
'float unsigned' => array('type' => 'float', 'min' => 0),
'boolean' => array('type' => 'boolean'),
'time' => array('type' => 'string', 'format' => '00:00:00'),
'time with time zone' => array('type' => 'string'),
'date' => array('type' => 'string', 'format' => '0000-00-00'),
'year' => array('type' => 'string', 'format' => '0000'),
'datetime' => array('type' => 'string', 'format' => '0000-00-00 00:00:00'),
'timestamp with time zone' => array('type' => 'string'),
'char' => array('type' => 'string', 'exact' => TRUE),
'binary' => array('type' => 'string', 'binary' => TRUE, 'exact' => TRUE),
'varchar' => array('type' => 'string'),
'varbinary' => array('type' => 'string', 'binary' => TRUE),
'blob' => array('type' => 'string', 'binary' => TRUE),
'text' => array('type' => 'string')
'tinyint' => array('type' => 'int', 'max' => 127),
'smallint' => array('type' => 'int', 'max' => 32767),
'mediumint' => array('type' => 'int', 'max' => 8388607),
'int' => array('type' => 'int', 'max' => 2147483647),
'integer' => array('type' => 'int', 'max' => 2147483647),
'bigint' => array('type' => 'int', 'max' => 9223372036854775807),
'float' => array('type' => 'float'),
'float unsigned' => array('type' => 'float', 'min' => 0),
'boolean' => array('type' => 'boolean'),
'time' => array('type' => 'string', 'format' => '00:00:00'),
'time with time zone' => array('type' => 'string'),
'date' => array('type' => 'string', 'format' => '0000-00-00'),
'year' => array('type' => 'string', 'format' => '0000'),
'datetime' => array('type' => 'string', 'format' => '0000-00-00 00:00:00'),
'timestamp with time zone' => array('type' => 'string'),
'char' => array('type' => 'string', 'exact' => true),
'binary' => array('type' => 'string', 'binary' => true, 'exact' => true),
'varchar' => array('type' => 'string'),
'varbinary' => array('type' => 'string', 'binary' => true),
'blob' => array('type' => 'string', 'binary' => true),
'text' => array('type' => 'string')
);
// DOUBLE

View File

@@ -1,17 +1,21 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Core
*
* This path is relative to your index file. Absolute paths are also supported.
*/
$config['directory'] = DOCROOT.'upload';
$config['directory'] = DOCROOT . 'upload';
/**
* Enable or disable directory creation.
*/
$config['create_directories'] = FALSE;
$config['create_directories'] = false;
/**
* Remove spaces from uploaded filenames.
*/
$config['remove_spaces'] = TRUE;
$config['remove_spaces'] = true;

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Core
*
@@ -9,104 +13,104 @@
*/
$config['platform'] = array
(
'windows nt 6.0' => 'Windows Vista',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.0' => 'Windows 2000',
'windows nt 5.1' => 'Windows XP',
'windows nt 4.0' => 'Windows NT',
'winnt4.0' => 'Windows NT',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows' => 'Unknown Windows OS',
'os x' => 'Mac OS X',
'intel mac' => 'Intel Mac',
'ppc mac' => 'PowerPC Mac',
'powerpc' => 'PowerPC',
'ppc' => 'PowerPC',
'cygwin' => 'Cygwin',
'linux' => 'Linux',
'debian' => 'Debian',
'openvms' => 'OpenVMS',
'sunos' => 'Sun Solaris',
'amiga' => 'Amiga',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'freebsd' => 'FreeBSD',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'os/2' => 'OS/2',
'warp' => 'OS/2',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'hurd' => 'GNU/Hurd',
'unix' => 'Unknown Unix OS',
'windows nt 6.0' => 'Windows Vista',
'windows nt 5.2' => 'Windows 2003',
'windows nt 5.0' => 'Windows 2000',
'windows nt 5.1' => 'Windows XP',
'windows nt 4.0' => 'Windows NT',
'winnt4.0' => 'Windows NT',
'winnt 4.0' => 'Windows NT',
'winnt' => 'Windows NT',
'windows 98' => 'Windows 98',
'win98' => 'Windows 98',
'windows 95' => 'Windows 95',
'win95' => 'Windows 95',
'windows' => 'Unknown Windows OS',
'os x' => 'Mac OS X',
'intel mac' => 'Intel Mac',
'ppc mac' => 'PowerPC Mac',
'powerpc' => 'PowerPC',
'ppc' => 'PowerPC',
'cygwin' => 'Cygwin',
'linux' => 'Linux',
'debian' => 'Debian',
'openvms' => 'OpenVMS',
'sunos' => 'Sun Solaris',
'amiga' => 'Amiga',
'beos' => 'BeOS',
'apachebench' => 'ApacheBench',
'freebsd' => 'FreeBSD',
'netbsd' => 'NetBSD',
'bsdi' => 'BSDi',
'openbsd' => 'OpenBSD',
'os/2' => 'OS/2',
'warp' => 'OS/2',
'aix' => 'AIX',
'irix' => 'Irix',
'osf' => 'DEC OSF',
'hp-ux' => 'HP-UX',
'hurd' => 'GNU/Hurd',
'unix' => 'Unknown Unix OS',
);
// The order of this array should NOT be changed. Many browsers return
// multiple browser types so we want to identify the sub-type first.
$config['browser'] = array
(
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Chrome' => 'Chrome',
'Safari' => 'Safari',
'Konqueror' => 'Konqueror',
'Epiphany' => 'Epiphany',
'Galeon' => 'Galeon',
'Mozilla' => 'Mozilla',
'icab' => 'iCab',
'lynx' => 'Lynx',
'links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse',
'Opera' => 'Opera',
'MSIE' => 'Internet Explorer',
'Internet Explorer' => 'Internet Explorer',
'Shiira' => 'Shiira',
'Firefox' => 'Firefox',
'Chimera' => 'Chimera',
'Phoenix' => 'Phoenix',
'Firebird' => 'Firebird',
'Camino' => 'Camino',
'Netscape' => 'Netscape',
'OmniWeb' => 'OmniWeb',
'Chrome' => 'Chrome',
'Safari' => 'Safari',
'Konqueror' => 'Konqueror',
'Epiphany' => 'Epiphany',
'Galeon' => 'Galeon',
'Mozilla' => 'Mozilla',
'icab' => 'iCab',
'lynx' => 'Lynx',
'links' => 'Links',
'hotjava' => 'HotJava',
'amaya' => 'Amaya',
'IBrowse' => 'IBrowse',
);
$config['mobile'] = array
(
'mobileexplorer' => 'Mobile Explorer',
'openwave' => 'Open Wave',
'opera mini' => 'Opera Mini',
'operamini' => 'Opera Mini',
'elaine' => 'Palm',
'palmsource' => 'Palm',
'digital paths' => 'Palm',
'avantgo' => 'Avantgo',
'xiino' => 'Xiino',
'palmscape' => 'Palmscape',
'nokia' => 'Nokia',
'ericsson' => 'Ericsson',
'blackBerry' => 'BlackBerry',
'motorola' => 'Motorola',
'iphone' => 'iPhone',
'android' => 'Android',
'mobileexplorer' => 'Mobile Explorer',
'openwave' => 'Open Wave',
'opera mini' => 'Opera Mini',
'operamini' => 'Opera Mini',
'elaine' => 'Palm',
'palmsource' => 'Palm',
'digital paths' => 'Palm',
'avantgo' => 'Avantgo',
'xiino' => 'Xiino',
'palmscape' => 'Palmscape',
'nokia' => 'Nokia',
'ericsson' => 'Ericsson',
'blackBerry' => 'BlackBerry',
'motorola' => 'Motorola',
'iphone' => 'iPhone',
'android' => 'Android',
);
// There are hundreds of bots but these are the most common.
$config['robot'] = array
(
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'askjeeves' => 'AskJeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos',
);
'googlebot' => 'Googlebot',
'msnbot' => 'MSNBot',
'slurp' => 'Inktomi Slurp',
'yahoo' => 'Yahoo',
'askjeeves' => 'AskJeeves',
'fastcrawler' => 'FastCrawler',
'infoseek' => 'InfoSeek Robot 1.0',
'lycos' => 'Lycos',
);

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* @package Core
*
@@ -6,12 +10,12 @@
*/
$config['allowed_filetypes'] = array
(
'gif',
'jpg', 'jpeg',
'png',
'tif', 'tiff',
'swf',
'htm', 'html',
'css',
'js'
'gif',
'jpg', 'jpeg',
'png',
'tif', 'tiff',
'swf',
'htm', 'html',
'css',
'js'
);

View File

@@ -1,4 +1,11 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* Outputs the dynamic Captcha resource.
* Usage: Call the Captcha controller from a view, e.g.
@@ -11,13 +18,13 @@
* @copyright (c) 2007-2008 Kohana Team
* @license http://kohanaphp.com/license.html
*/
class Captcha_Controller extends Controller {
public function __call($method, $args)
{
// Output the Captcha challenge resource (no html)
// Pull the config group name from the URL
Captcha::factory($this->uri->segment(2))->render(FALSE);
}
} // End Captcha_Controller
class Captcha_Controller extends Controller
{
public function __call($method, $args)
{
// Output the Captcha challenge resource (no html)
// Pull the config group name from the URL
Captcha::factory($this->uri->segment(2))->render(false);
}
}
// End Captcha_Controller

View File

@@ -1,4 +1,12 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* Allows a template to be automatically loaded and displayed. Display can be
* dynamically turned off in the controller methods, and the template file
@@ -14,41 +22,39 @@
* @copyright (c) 2007-2008 Kohana Team
* @license http://kohanaphp.com/license.html
*/
abstract class Template_Controller extends Controller {
abstract class Template_Controller extends Controller
{
// Template view name
public $template = 'template';
// Template view name
public $template = 'template';
// Default to do auto-rendering
public $auto_render = true;
// Default to do auto-rendering
public $auto_render = TRUE;
/**
* Template loading and setup routine.
*/
public function __construct()
{
parent::__construct();
/**
* Template loading and setup routine.
*/
public function __construct()
{
parent::__construct();
// Load the template
$this->template = new View($this->template);
// Load the template
$this->template = new View($this->template);
if ($this->auto_render == true) {
// Render the template immediately after the controller method
Event::add('system.post_controller', array($this, 'Xrender'));
}
}
if ($this->auto_render == TRUE)
{
// Render the template immediately after the controller method
Event::add('system.post_controller', array($this, '_render'));
}
}
/**
* Render the loaded template.
*/
public function _render()
{
if ($this->auto_render == TRUE)
{
// Render the template when the class is destroyed
$this->template->render(TRUE);
}
}
} // End Template_Controller
/**
* Render the loaded template.
*/
public function Xrender()
{
if ($this->auto_render == true) {
// Render the template when the class is destroyed
$this->template->render(true);
}
}
}
// End Template_Controller

View File

@@ -1,4 +1,11 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* Simple benchmarking.
*
@@ -9,117 +16,111 @@
* @copyright (c) 2007 Kohana Team
* @license http://kohanaphp.com/license.html
*/
final class Benchmark {
final class Benchmark
{
// Benchmark timestamps
private static $marks;
// Benchmark timestamps
private static $marks;
/**
* Set a benchmark start point.
*
* @param string benchmark name
* @return void
*/
public static function start($name)
{
if (! isset(self::$marks[$name])) {
self::$marks[$name] = array();
}
/**
* Set a benchmark start point.
*
* @param string benchmark name
* @return void
*/
public static function start($name)
{
if ( ! isset(self::$marks[$name]))
{
self::$marks[$name] = array();
}
$mark = array
(
'start' => microtime(true),
'stop' => false,
'memory_start' => self::memory_usage(),
'memory_stop' => false
);
$mark = array
(
'start' => microtime(TRUE),
'stop' => FALSE,
'memory_start' => self::memory_usage(),
'memory_stop' => FALSE
);
array_unshift(self::$marks[$name], $mark);
}
array_unshift(self::$marks[$name], $mark);
}
/**
* Set a benchmark stop point.
*
* @param string benchmark name
* @return void
*/
public static function stop($name)
{
if (isset(self::$marks[$name]) and self::$marks[$name][0]['stop'] === false) {
self::$marks[$name][0]['stop'] = microtime(true);
self::$marks[$name][0]['memory_stop'] = self::memory_usage();
}
}
/**
* Set a benchmark stop point.
*
* @param string benchmark name
* @return void
*/
public static function stop($name)
{
if (isset(self::$marks[$name]) AND self::$marks[$name][0]['stop'] === FALSE)
{
self::$marks[$name][0]['stop'] = microtime(TRUE);
self::$marks[$name][0]['memory_stop'] = self::memory_usage();
}
}
/**
* Get the elapsed time between a start and stop.
*
* @param string benchmark name, TRUE for all
* @param integer number of decimal places to count to
* @return array
*/
public static function get($name, $decimals = 4)
{
if ($name === true) {
$times = array();
$names = array_keys(self::$marks);
/**
* Get the elapsed time between a start and stop.
*
* @param string benchmark name, TRUE for all
* @param integer number of decimal places to count to
* @return array
*/
public static function get($name, $decimals = 4)
{
if ($name === TRUE)
{
$times = array();
$names = array_keys(self::$marks);
foreach ($names as $name) {
// Get each mark recursively
$times[$name] = self::get($name, $decimals);
}
foreach ($names as $name)
{
// Get each mark recursively
$times[$name] = self::get($name, $decimals);
}
// Return the array
return $times;
}
// Return the array
return $times;
}
if (! isset(self::$marks[$name])) {
return false;
}
if ( ! isset(self::$marks[$name]))
return FALSE;
if (self::$marks[$name][0]['stop'] === false) {
// Stop the benchmark to prevent mis-matched results
self::stop($name);
}
if (self::$marks[$name][0]['stop'] === FALSE)
{
// Stop the benchmark to prevent mis-matched results
self::stop($name);
}
// Return a string version of the time between the start and stop points
// Properly reading a float requires using number_format or sprintf
$time = $memory = 0;
for ($i = 0; $i < count(self::$marks[$name]); $i++) {
$time += self::$marks[$name][$i]['stop'] - self::$marks[$name][$i]['start'];
$memory += self::$marks[$name][$i]['memory_stop'] - self::$marks[$name][$i]['memory_start'];
}
// Return a string version of the time between the start and stop points
// Properly reading a float requires using number_format or sprintf
$time = $memory = 0;
for ($i = 0; $i < count(self::$marks[$name]); $i++)
{
$time += self::$marks[$name][$i]['stop'] - self::$marks[$name][$i]['start'];
$memory += self::$marks[$name][$i]['memory_stop'] - self::$marks[$name][$i]['memory_start'];
}
return array
(
'time' => number_format($time, $decimals),
'memory' => $memory,
'count' => count(self::$marks[$name])
);
}
return array
(
'time' => number_format($time, $decimals),
'memory' => $memory,
'count' => count(self::$marks[$name])
);
}
/**
* Returns the current memory usage. This is only possible if the
* memory_get_usage function is supported in PHP.
*
* @return integer
*/
private static function memory_usage()
{
static $func;
/**
* Returns the current memory usage. This is only possible if the
* memory_get_usage function is supported in PHP.
*
* @return integer
*/
private static function memory_usage()
{
static $func;
if ($func === null) {
// Test if memory usage can be seen
$func = function_exists('memory_get_usage');
}
if ($func === NULL)
{
// Test if memory usage can be seen
$func = function_exists('memory_get_usage');
}
return $func ? memory_get_usage() : 0;
}
} // End Benchmark
return $func ? memory_get_usage() : 0;
}
}
// End Benchmark

View File

@@ -1,7 +1,11 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
/**
* Kohana process control file, loaded by the front controller.
*
*
* $Id: Bootstrap.php 4409 2009-06-06 00:48:26Z zombor $
*
* @package Core
@@ -10,7 +14,7 @@
* @license http://kohanaphp.com/license.html
*/
define('KOHANA_VERSION', '2.3.4');
define('KOHANA_VERSION', '2.3.4');
define('KOHANA_CODENAME', 'buteo regalis');
// Test of Kohana is running in Windows
@@ -20,27 +24,28 @@ define('KOHANA_IS_WIN', DIRECTORY_SEPARATOR === '\\');
define('SYSTEM_BENCHMARK', 'system_benchmark');
// Load benchmarking support
require SYSPATH.'core/Benchmark'.EXT;
require SYSPATH . 'core/Benchmark' . EXT;
// Start total_execution
Benchmark::start(SYSTEM_BENCHMARK.'_total_execution');
Benchmark::start(SYSTEM_BENCHMARK . '_total_execution');
// Start kohana_loading
Benchmark::start(SYSTEM_BENCHMARK.'_kohana_loading');
Benchmark::start(SYSTEM_BENCHMARK . '_kohana_loading');
// Load core files
require SYSPATH.'core/utf8'.EXT;
require SYSPATH.'core/Event'.EXT;
require SYSPATH.'core/Kohana'.EXT;
require SYSPATH . 'core/utf8' . EXT;
require SYSPATH . 'core/Event' . EXT;
require SYSPATH . 'core/Security' . EXT;
require SYSPATH . 'core/Kohana' . EXT;
// Prepare the environment
Kohana::setup();
// End kohana_loading
Benchmark::stop(SYSTEM_BENCHMARK.'_kohana_loading');
Benchmark::stop(SYSTEM_BENCHMARK . '_kohana_loading');
// Start system_initialization
Benchmark::start(SYSTEM_BENCHMARK.'_system_initialization');
Benchmark::start(SYSTEM_BENCHMARK . '_system_initialization');
// Prepare the system
Event::run('system.ready');
@@ -49,7 +54,7 @@ Event::run('system.ready');
Event::run('system.routing');
// End system_initialization
Benchmark::stop(SYSTEM_BENCHMARK.'_system_initialization');
Benchmark::stop(SYSTEM_BENCHMARK . '_system_initialization');
// Make the magic happen!
Event::run('system.execute');

View File

@@ -1,4 +1,10 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* Process queuing/execution class. Allows an unlimited number of callbacks
* to be added to 'events'. Events can be run multiple times, and can also
@@ -12,221 +18,203 @@
* @license http://kohanaphp.com/license.html
* @link http://docs.kohanaphp.com/general/events
*/
final class Event {
final class Event
{
// Event callbacks
private static $events = array();
// Event callbacks
private static $events = array();
// Cache of events that have been run
private static $has_run = array();
// Cache of events that have been run
private static $has_run = array();
// Data that can be processed during events
public static $data;
// Data that can be processed during events
public static $data;
/**
* Add a callback to an event queue.
*
* @param string event name
* @param array http://php.net/callback
* @return boolean
*/
public static function add($name, $callback)
{
if (! isset(self::$events[$name])) {
// Create an empty event if it is not yet defined
self::$events[$name] = array();
} elseif (in_array($callback, self::$events[$name], true)) {
// The event already exists
return false;
}
/**
* Add a callback to an event queue.
*
* @param string event name
* @param array http://php.net/callback
* @return boolean
*/
public static function add($name, $callback)
{
if ( ! isset(self::$events[$name]))
{
// Create an empty event if it is not yet defined
self::$events[$name] = array();
}
elseif (in_array($callback, self::$events[$name], TRUE))
{
// The event already exists
return FALSE;
}
// Add the event
self::$events[$name][] = $callback;
// Add the event
self::$events[$name][] = $callback;
return true;
}
return TRUE;
}
/**
* Add a callback to an event queue, before a given event.
*
* @param string event name
* @param array existing event callback
* @param array event callback
* @return boolean
*/
public static function add_before($name, $existing, $callback)
{
if (empty(self::$events[$name]) or ($key = array_search($existing, self::$events[$name])) === false) {
// Just add the event if there are no events
return self::add($name, $callback);
} else {
// Insert the event immediately before the existing event
return self::insert_event($name, $key, $callback);
}
}
/**
* Add a callback to an event queue, before a given event.
*
* @param string event name
* @param array existing event callback
* @param array event callback
* @return boolean
*/
public static function add_before($name, $existing, $callback)
{
if (empty(self::$events[$name]) OR ($key = array_search($existing, self::$events[$name])) === FALSE)
{
// Just add the event if there are no events
return self::add($name, $callback);
}
else
{
// Insert the event immediately before the existing event
return self::insert_event($name, $key, $callback);
}
}
/**
* Add a callback to an event queue, after a given event.
*
* @param string event name
* @param array existing event callback
* @param array event callback
* @return boolean
*/
public static function add_after($name, $existing, $callback)
{
if (empty(self::$events[$name]) or ($key = array_search($existing, self::$events[$name])) === false) {
// Just add the event if there are no events
return self::add($name, $callback);
} else {
// Insert the event immediately after the existing event
return self::insert_event($name, $key + 1, $callback);
}
}
/**
* Add a callback to an event queue, after a given event.
*
* @param string event name
* @param array existing event callback
* @param array event callback
* @return boolean
*/
public static function add_after($name, $existing, $callback)
{
if (empty(self::$events[$name]) OR ($key = array_search($existing, self::$events[$name])) === FALSE)
{
// Just add the event if there are no events
return self::add($name, $callback);
}
else
{
// Insert the event immediately after the existing event
return self::insert_event($name, $key + 1, $callback);
}
}
/**
* Inserts a new event at a specfic key location.
*
* @param string event name
* @param integer key to insert new event at
* @param array event callback
* @return void
*/
private static function insert_event($name, $key, $callback)
{
if (in_array($callback, self::$events[$name], true)) {
return false;
}
/**
* Inserts a new event at a specfic key location.
*
* @param string event name
* @param integer key to insert new event at
* @param array event callback
* @return void
*/
private static function insert_event($name, $key, $callback)
{
if (in_array($callback, self::$events[$name], TRUE))
return FALSE;
// Add the new event at the given key location
self::$events[$name] = array_merge(
// Events before the key
array_slice(self::$events[$name], 0, $key),
// New event callback
array($callback),
// Events after the key
array_slice(self::$events[$name], $key)
);
// Add the new event at the given key location
self::$events[$name] = array_merge
(
// Events before the key
array_slice(self::$events[$name], 0, $key),
// New event callback
array($callback),
// Events after the key
array_slice(self::$events[$name], $key)
);
return true;
}
return TRUE;
}
/**
* Replaces an event with another event.
*
* @param string event name
* @param array event to replace
* @param array new callback
* @return boolean
*/
public static function replace($name, $existing, $callback)
{
if (empty(self::$events[$name]) or ($key = array_search($existing, self::$events[$name], true)) === false) {
return false;
}
/**
* Replaces an event with another event.
*
* @param string event name
* @param array event to replace
* @param array new callback
* @return boolean
*/
public static function replace($name, $existing, $callback)
{
if (empty(self::$events[$name]) OR ($key = array_search($existing, self::$events[$name], TRUE)) === FALSE)
return FALSE;
if (! in_array($callback, self::$events[$name], true)) {
// Replace the exisiting event with the new event
self::$events[$name][$key] = $callback;
} else {
// Remove the existing event from the queue
unset(self::$events[$name][$key]);
if ( ! in_array($callback, self::$events[$name], TRUE))
{
// Replace the exisiting event with the new event
self::$events[$name][$key] = $callback;
}
else
{
// Remove the existing event from the queue
unset(self::$events[$name][$key]);
// Reset the array so the keys are ordered properly
self::$events[$name] = array_values(self::$events[$name]);
}
// Reset the array so the keys are ordered properly
self::$events[$name] = array_values(self::$events[$name]);
}
return true;
}
return TRUE;
}
/**
* Get all callbacks for an event.
*
* @param string event name
* @return array
*/
public static function get($name)
{
return empty(self::$events[$name]) ? array() : self::$events[$name];
}
/**
* Get all callbacks for an event.
*
* @param string event name
* @return array
*/
public static function get($name)
{
return empty(self::$events[$name]) ? array() : self::$events[$name];
}
/**
* Clear some or all callbacks from an event.
*
* @param string event name
* @param array specific callback to remove, FALSE for all callbacks
* @return void
*/
public static function clear($name, $callback = false)
{
if ($callback === false) {
self::$events[$name] = array();
} elseif (isset(self::$events[$name])) {
// Loop through each of the event callbacks and compare it to the
// callback requested for removal. The callback is removed if it
// matches.
foreach (self::$events[$name] as $i => $event_callback) {
if ($callback === $event_callback) {
unset(self::$events[$name][$i]);
}
}
}
}
/**
* Clear some or all callbacks from an event.
*
* @param string event name
* @param array specific callback to remove, FALSE for all callbacks
* @return void
*/
public static function clear($name, $callback = FALSE)
{
if ($callback === FALSE)
{
self::$events[$name] = array();
}
elseif (isset(self::$events[$name]))
{
// Loop through each of the event callbacks and compare it to the
// callback requested for removal. The callback is removed if it
// matches.
foreach (self::$events[$name] as $i => $event_callback)
{
if ($callback === $event_callback)
{
unset(self::$events[$name][$i]);
}
}
}
}
/**
* Execute all of the callbacks attached to an event.
*
* @param string event name
* @param array data can be processed as Event::$data by the callbacks
* @return void
*/
public static function run($name, &$data = null)
{
if (! empty(self::$events[$name])) {
// So callbacks can access Event::$data
self::$data =& $data;
$callbacks = self::get($name);
/**
* Execute all of the callbacks attached to an event.
*
* @param string event name
* @param array data can be processed as Event::$data by the callbacks
* @return void
*/
public static function run($name, & $data = NULL)
{
if ( ! empty(self::$events[$name]))
{
// So callbacks can access Event::$data
self::$data =& $data;
$callbacks = self::get($name);
foreach ($callbacks as $callback) {
call_user_func($callback);
}
foreach ($callbacks as $callback)
{
call_user_func($callback);
}
// Do this to prevent data from getting 'stuck'
$clear_data = '';
self::$data =& $clear_data;
}
// Do this to prevent data from getting 'stuck'
$clear_data = '';
self::$data =& $clear_data;
}
// The event has been run!
self::$has_run[$name] = $name;
}
// The event has been run!
self::$has_run[$name] = $name;
}
/**
* Check if a given event has been run.
*
* @param string event name
* @return boolean
*/
public static function has_run($name)
{
return isset(self::$has_run[$name]);
}
} // End Event
/**
* Check if a given event has been run.
*
* @param string event name
* @return boolean
*/
public static function has_run($name)
{
return isset(self::$has_run[$name]);
}
}
// End Event

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,138 @@
<?php
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct script access.');
// phpcs:enable PSR1.Files.SideEffects
/**
* Security helper class.
*
* @package Kohana
* @category Security
* @author Kohana Team
* @copyright (c) 2007-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Security
{
/**
* @var string key name used for token storage
*/
public static $token_name = 'security_token';
/**
* Generate and store a unique token which can be used to help prevent
* [CSRF](http://wikipedia.org/wiki/Cross_Site_Request_Forgery) attacks.
*
* $token = Security::token();
*
* You can insert this token into your forms as a hidden field:
*
* echo Form::hidden('csrf', Security::token());
*
* And then check it when using [Validation]:
*
* $array->rules('csrf', array(
* array('not_empty'),
* array('Security::check'),
* ));
*
* This provides a basic, but effective, method of preventing CSRF attacks.
*
* @param boolean $new force a new token to be generated?
* @return string
* @uses Session::instance
*/
public static function token($new = false)
{
$session = Session::instance();
// Get the current token
$token = $session->get(Security::$token_name);
if ($new === true or ! $token) {
// Generate a new unique token
if (function_exists('openssl_random_pseudo_bytes')) {
// Generate a random pseudo bytes token if openssl_random_pseudo_bytes is available
// This is more secure than uniqid, because uniqid relies on microtime, which is predictable
$token = base64_encode(openssl_random_pseudo_bytes(32));
} else {
// Otherwise, fall back to a hashed uniqid
$token = sha1(uniqid(null, true));
}
// Store the new token
$session->set(Security::$token_name, $token);
}
return $token;
}
/**
* Check that the given token matches the currently stored security token.
*
* if (Security::check($token))
* {
* // Pass
* }
*
* @param string $token token to check
* @return boolean
* @uses Security::token
*/
public static function check($token)
{
return Security::slow_equals(Security::token(), $token);
}
/**
* Compare two hashes in a time-invariant manner.
* Prevents cryptographic side-channel attacks (timing attacks, specifically)
*
* @param string $a cryptographic hash
* @param string $b cryptographic hash
* @return boolean
*/
public static function slow_equals($a, $b)
{
$diff = strlen($a) ^ strlen($b);
for ($i = 0; $i < strlen($a) and $i < strlen($b); $i++) {
$diff |= ord($a[$i]) ^ ord($b[$i]);
}
return $diff === 0;
}
/**
* Deprecated for security reasons.
* See https://github.com/kohana/kohana/issues/107
*
* Remove image tags from a string.
*
* $str = Security::strip_image_tags($str);
*
* @deprecated since version 3.3.6
* @param string $str string to sanitize
* @return string
*/
public static function strip_image_tags($str)
{
return preg_replace('#<img\s.*?(?:src\s*=\s*["\']?([^"\'<>\s]*)["\']?[^>]*)?>#is', '$1', $str);
}
/**
* Encodes PHP tags in a string.
*
* $str = Security::encode_php_tags($str);
*
* @param string $str string to sanitize
* @return string
*/
public static function encode_php_tags($str)
{
return str_replace(array('<?', '?>'), array('&lt;?', '?&gt;'), $str);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,9 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::from_unicode
*
@@ -10,59 +15,45 @@
*/
function _from_unicode($arr)
{
ob_start();
ob_start();
$keys = array_keys($arr);
$keys = array_keys($arr);
foreach ($keys as $k)
{
// ASCII range (including control chars)
if (($arr[$k] >= 0) AND ($arr[$k] <= 0x007f))
{
echo chr($arr[$k]);
}
// 2 byte sequence
elseif ($arr[$k] <= 0x07ff)
{
echo chr(0xc0 | ($arr[$k] >> 6));
echo chr(0x80 | ($arr[$k] & 0x003f));
}
// Byte order mark (skip)
elseif ($arr[$k] == 0xFEFF)
{
// nop -- zap the BOM
}
// Test for illegal surrogates
elseif ($arr[$k] >= 0xD800 AND $arr[$k] <= 0xDFFF)
{
// Found a surrogate
trigger_error('utf8::from_unicode: Illegal surrogate at index: '.$k.', value: '.$arr[$k], E_USER_WARNING);
return FALSE;
}
// 3 byte sequence
elseif ($arr[$k] <= 0xffff)
{
echo chr(0xe0 | ($arr[$k] >> 12));
echo chr(0x80 | (($arr[$k] >> 6) & 0x003f));
echo chr(0x80 | ($arr[$k] & 0x003f));
}
// 4 byte sequence
elseif ($arr[$k] <= 0x10ffff)
{
echo chr(0xf0 | ($arr[$k] >> 18));
echo chr(0x80 | (($arr[$k] >> 12) & 0x3f));
echo chr(0x80 | (($arr[$k] >> 6) & 0x3f));
echo chr(0x80 | ($arr[$k] & 0x3f));
}
// Out of range
else
{
trigger_error('utf8::from_unicode: Codepoint out of Unicode range at index: '.$k.', value: '.$arr[$k], E_USER_WARNING);
return FALSE;
}
}
foreach ($keys as $k) {
// ASCII range (including control chars)
if (($arr[$k] >= 0) and ($arr[$k] <= 0x007f)) {
echo chr($arr[$k]);
} elseif ($arr[$k] <= 0x07ff) {
// 2 byte sequence
echo chr(0xc0 | ($arr[$k] >> 6));
echo chr(0x80 | ($arr[$k] & 0x003f));
} elseif ($arr[$k] == 0xFEFF) {
// Byte order mark (skip)
// nop -- zap the BOM
} elseif ($arr[$k] >= 0xD800 and $arr[$k] <= 0xDFFF) {
// Test for illegal surrogates
// Found a surrogate
trigger_error('utf8::from_unicode: Illegal surrogate at index: ' . $k . ', value: ' . $arr[$k], E_USER_WARNING);
return false;
} elseif ($arr[$k] <= 0xffff) {
// 3 byte sequence
echo chr(0xe0 | ($arr[$k] >> 12));
echo chr(0x80 | (($arr[$k] >> 6) & 0x003f));
echo chr(0x80 | ($arr[$k] & 0x003f));
} elseif ($arr[$k] <= 0x10ffff) {
// 4 byte sequence
echo chr(0xf0 | ($arr[$k] >> 18));
echo chr(0x80 | (($arr[$k] >> 12) & 0x3f));
echo chr(0x80 | (($arr[$k] >> 6) & 0x3f));
echo chr(0x80 | ($arr[$k] & 0x3f));
} else {
// Out of range
trigger_error('utf8::from_unicode: Codepoint out of Unicode range at index: ' . $k . ', value: ' . $arr[$k], E_USER_WARNING);
return false;
}
}
$result = ob_get_contents();
ob_end_clean();
return $result;
$result = ob_get_contents();
ob_end_clean();
return $result;
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::ltrim
*
@@ -8,15 +12,17 @@
* @copyright (c) 2005 Harry Fuecks
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
*/
function _ltrim($str, $charlist = NULL)
function _ltrim($str, $charlist = null)
{
if ($charlist === NULL)
return ltrim($str);
if ($charlist === null) {
return ltrim($str);
}
if (utf8::is_ascii($charlist))
return ltrim($str, $charlist);
if (utf8::is_ascii($charlist)) {
return ltrim($str, $charlist);
}
$charlist = preg_replace('#[-\[\]:\\\\^/]#', '\\\\$0', $charlist);
$charlist = preg_replace('#[-\[\]:\\\\^/]#', '\\\\$0', $charlist);
return preg_replace('/^['.$charlist.']+/u', '', $str);
}
return preg_replace('/^[' . $charlist . ']+/u', '', $str);
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::ord
*
@@ -10,79 +14,67 @@
*/
function _ord($chr)
{
$ord0 = ord($chr);
$ord0 = ord($chr);
if ($ord0 >= 0 AND $ord0 <= 127)
{
return $ord0;
}
if ($ord0 >= 0 and $ord0 <= 127) {
return $ord0;
}
if ( ! isset($chr[1]))
{
trigger_error('Short sequence - at least 2 bytes expected, only 1 seen', E_USER_WARNING);
return FALSE;
}
if (! isset($chr[1])) {
trigger_error('Short sequence - at least 2 bytes expected, only 1 seen', E_USER_WARNING);
return false;
}
$ord1 = ord($chr[1]);
$ord1 = ord($chr[1]);
if ($ord0 >= 192 AND $ord0 <= 223)
{
return ($ord0 - 192) * 64 + ($ord1 - 128);
}
if ($ord0 >= 192 and $ord0 <= 223) {
return ($ord0 - 192) * 64 + ($ord1 - 128);
}
if ( ! isset($chr[2]))
{
trigger_error('Short sequence - at least 3 bytes expected, only 2 seen', E_USER_WARNING);
return FALSE;
}
if (! isset($chr[2])) {
trigger_error('Short sequence - at least 3 bytes expected, only 2 seen', E_USER_WARNING);
return false;
}
$ord2 = ord($chr[2]);
$ord2 = ord($chr[2]);
if ($ord0 >= 224 AND $ord0 <= 239)
{
return ($ord0 - 224) * 4096 + ($ord1 - 128) * 64 + ($ord2 - 128);
}
if ($ord0 >= 224 and $ord0 <= 239) {
return ($ord0 - 224) * 4096 + ($ord1 - 128) * 64 + ($ord2 - 128);
}
if ( ! isset($chr[3]))
{
trigger_error('Short sequence - at least 4 bytes expected, only 3 seen', E_USER_WARNING);
return FALSE;
}
if (! isset($chr[3])) {
trigger_error('Short sequence - at least 4 bytes expected, only 3 seen', E_USER_WARNING);
return false;
}
$ord3 = ord($chr[3]);
$ord3 = ord($chr[3]);
if ($ord0 >= 240 AND $ord0 <= 247)
{
return ($ord0 - 240) * 262144 + ($ord1 - 128) * 4096 + ($ord2-128) * 64 + ($ord3 - 128);
}
if ($ord0 >= 240 and $ord0 <= 247) {
return ($ord0 - 240) * 262144 + ($ord1 - 128) * 4096 + ($ord2 - 128) * 64 + ($ord3 - 128);
}
if ( ! isset($chr[4]))
{
trigger_error('Short sequence - at least 5 bytes expected, only 4 seen', E_USER_WARNING);
return FALSE;
}
if (! isset($chr[4])) {
trigger_error('Short sequence - at least 5 bytes expected, only 4 seen', E_USER_WARNING);
return false;
}
$ord4 = ord($chr[4]);
$ord4 = ord($chr[4]);
if ($ord0 >= 248 AND $ord0 <= 251)
{
return ($ord0 - 248) * 16777216 + ($ord1-128) * 262144 + ($ord2 - 128) * 4096 + ($ord3 - 128) * 64 + ($ord4 - 128);
}
if ($ord0 >= 248 and $ord0 <= 251) {
return ($ord0 - 248) * 16777216 + ($ord1 - 128) * 262144 + ($ord2 - 128) * 4096 + ($ord3 - 128) * 64 + ($ord4 - 128);
}
if ( ! isset($chr[5]))
{
trigger_error('Short sequence - at least 6 bytes expected, only 5 seen', E_USER_WARNING);
return FALSE;
}
if (! isset($chr[5])) {
trigger_error('Short sequence - at least 6 bytes expected, only 5 seen', E_USER_WARNING);
return false;
}
if ($ord0 >= 252 AND $ord0 <= 253)
{
return ($ord0 - 252) * 1073741824 + ($ord1 - 128) * 16777216 + ($ord2 - 128) * 262144 + ($ord3 - 128) * 4096 + ($ord4 - 128) * 64 + (ord($chr[5]) - 128);
}
if ($ord0 >= 252 and $ord0 <= 253) {
return ($ord0 - 252) * 1073741824 + ($ord1 - 128) * 16777216 + ($ord2 - 128) * 262144 + ($ord3 - 128) * 4096 + ($ord4 - 128) * 64 + (ord($chr[5]) - 128);
}
if ($ord0 >= 254 AND $ord0 <= 255)
{
trigger_error('Invalid UTF-8 with surrogate ordinal '.$ord0, E_USER_WARNING);
return FALSE;
}
}
if ($ord0 >= 254 and $ord0 <= 255) {
trigger_error('Invalid UTF-8 with surrogate ordinal ' . $ord0, E_USER_WARNING);
return false;
}
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::rtrim
*
@@ -8,15 +12,17 @@
* @copyright (c) 2005 Harry Fuecks
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
*/
function _rtrim($str, $charlist = NULL)
function _rtrim($str, $charlist = null)
{
if ($charlist === NULL)
return rtrim($str);
if ($charlist === null) {
return rtrim($str);
}
if (utf8::is_ascii($charlist))
return rtrim($str, $charlist);
if (utf8::is_ascii($charlist)) {
return rtrim($str, $charlist);
}
$charlist = preg_replace('#[-\[\]:\\\\^/]#', '\\\\$0', $charlist);
$charlist = preg_replace('#[-\[\]:\\\\^/]#', '\\\\$0', $charlist);
return preg_replace('/['.$charlist.']++$/uD', '', $str);
}
return preg_replace('/[' . $charlist . ']++$/uD', '', $str);
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::str_ireplace
*
@@ -8,63 +12,53 @@
* @copyright (c) 2005 Harry Fuecks
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
*/
function _str_ireplace($search, $replace, $str, & $count = NULL)
function _str_ireplace($search, $replace, $str, &$count = null)
{
if (utf8::is_ascii($search) AND utf8::is_ascii($replace) AND utf8::is_ascii($str))
return str_ireplace($search, $replace, $str, $count);
if (utf8::is_ascii($search) and utf8::is_ascii($replace) and utf8::is_ascii($str)) {
return str_ireplace($search, $replace, $str, $count);
}
if (is_array($str))
{
foreach ($str as $key => $val)
{
$str[$key] = utf8::str_ireplace($search, $replace, $val, $count);
}
return $str;
}
if (is_array($str)) {
foreach ($str as $key => $val) {
$str[$key] = utf8::str_ireplace($search, $replace, $val, $count);
}
return $str;
}
if (is_array($search))
{
$keys = array_keys($search);
if (is_array($search)) {
$keys = array_keys($search);
foreach ($keys as $k)
{
if (is_array($replace))
{
if (array_key_exists($k, $replace))
{
$str = utf8::str_ireplace($search[$k], $replace[$k], $str, $count);
}
else
{
$str = utf8::str_ireplace($search[$k], '', $str, $count);
}
}
else
{
$str = utf8::str_ireplace($search[$k], $replace, $str, $count);
}
}
return $str;
}
foreach ($keys as $k) {
if (is_array($replace)) {
if (array_key_exists($k, $replace)) {
$str = utf8::str_ireplace($search[$k], $replace[$k], $str, $count);
} else {
$str = utf8::str_ireplace($search[$k], '', $str, $count);
}
} else {
$str = utf8::str_ireplace($search[$k], $replace, $str, $count);
}
}
return $str;
}
$search = utf8::strtolower($search);
$str_lower = utf8::strtolower($str);
$search = utf8::strtolower($search);
$str_lower = utf8::strtolower($str);
$total_matched_strlen = 0;
$i = 0;
$total_matched_strlen = 0;
$i = 0;
while (preg_match('/(.*?)'.preg_quote($search, '/').'/s', $str_lower, $matches))
{
$matched_strlen = strlen($matches[0]);
$str_lower = substr($str_lower, $matched_strlen);
while (preg_match('/(.*?)' . preg_quote($search, '/') . '/s', $str_lower, $matches)) {
$matched_strlen = strlen($matches[0]);
$str_lower = substr($str_lower, $matched_strlen);
$offset = $total_matched_strlen + strlen($matches[1]) + ($i * (strlen($replace) - 1));
$str = substr_replace($str, $replace, $offset, strlen($search));
$offset = $total_matched_strlen + strlen($matches[1]) + ($i * (strlen($replace) - 1));
$str = substr_replace($str, $replace, $offset, strlen($search));
$total_matched_strlen += $matched_strlen;
$i++;
}
$total_matched_strlen += $matched_strlen;
$i++;
}
$count += $i;
return $str;
$count += $i;
return $str;
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::str_pad
*
@@ -10,45 +14,40 @@
*/
function _str_pad($str, $final_str_length, $pad_str = ' ', $pad_type = STR_PAD_RIGHT)
{
if (utf8::is_ascii($str) AND utf8::is_ascii($pad_str))
{
return str_pad($str, $final_str_length, $pad_str, $pad_type);
}
if (utf8::is_ascii($str) and utf8::is_ascii($pad_str)) {
return str_pad($str, $final_str_length, $pad_str, $pad_type);
}
$str_length = utf8::strlen($str);
$str_length = utf8::strlen($str);
if ($final_str_length <= 0 OR $final_str_length <= $str_length)
{
return $str;
}
if ($final_str_length <= 0 or $final_str_length <= $str_length) {
return $str;
}
$pad_str_length = utf8::strlen($pad_str);
$pad_length = $final_str_length - $str_length;
$pad_str_length = utf8::strlen($pad_str);
$pad_length = $final_str_length - $str_length;
if ($pad_type == STR_PAD_RIGHT)
{
$repeat = ceil($pad_length / $pad_str_length);
return utf8::substr($str.str_repeat($pad_str, $repeat), 0, $final_str_length);
}
if ($pad_type == STR_PAD_RIGHT) {
$repeat = ceil($pad_length / $pad_str_length);
return utf8::substr($str . str_repeat($pad_str, $repeat), 0, $final_str_length);
}
if ($pad_type == STR_PAD_LEFT)
{
$repeat = ceil($pad_length / $pad_str_length);
return utf8::substr(str_repeat($pad_str, $repeat), 0, floor($pad_length)).$str;
}
if ($pad_type == STR_PAD_LEFT) {
$repeat = ceil($pad_length / $pad_str_length);
return utf8::substr(str_repeat($pad_str, $repeat), 0, floor($pad_length)) . $str;
}
if ($pad_type == STR_PAD_BOTH)
{
$pad_length /= 2;
$pad_length_left = floor($pad_length);
$pad_length_right = ceil($pad_length);
$repeat_left = ceil($pad_length_left / $pad_str_length);
$repeat_right = ceil($pad_length_right / $pad_str_length);
if ($pad_type == STR_PAD_BOTH) {
$pad_length /= 2;
$pad_length_left = floor($pad_length);
$pad_length_right = ceil($pad_length);
$repeat_left = ceil($pad_length_left / $pad_str_length);
$repeat_right = ceil($pad_length_right / $pad_str_length);
$pad_left = utf8::substr(str_repeat($pad_str, $repeat_left), 0, $pad_length_left);
$pad_right = utf8::substr(str_repeat($pad_str, $repeat_right), 0, $pad_length_left);
return $pad_left.$str.$pad_right;
}
$pad_left = utf8::substr(str_repeat($pad_str, $repeat_left), 0, $pad_length_left);
$pad_right = utf8::substr(str_repeat($pad_str, $repeat_right), 0, $pad_length_left);
return $pad_left . $str . $pad_right;
}
trigger_error('utf8::str_pad: Unknown padding type (' . $pad_type . ')', E_USER_ERROR);
}
trigger_error('utf8::str_pad: Unknown padding type (' . $pad_type . ')', E_USER_ERROR);
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::str_split
*
@@ -10,24 +14,21 @@
*/
function _str_split($str, $split_length = 1)
{
$split_length = (int) $split_length;
$split_length = (int) $split_length;
if (utf8::is_ascii($str))
{
return str_split($str, $split_length);
}
if (utf8::is_ascii($str)) {
return str_split($str, $split_length);
}
if ($split_length < 1)
{
return FALSE;
}
if ($split_length < 1) {
return false;
}
if (utf8::strlen($str) <= $split_length)
{
return array($str);
}
if (utf8::strlen($str) <= $split_length) {
return array($str);
}
preg_match_all('/.{'.$split_length.'}|[^\x00]{1,'.$split_length.'}$/us', $str, $matches);
preg_match_all('/.{' . $split_length . '}|[^\x00]{1,' . $split_length . '}$/us', $str, $matches);
return $matches[0];
}
return $matches[0];
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::strcasecmp
*
@@ -10,10 +14,11 @@
*/
function _strcasecmp($str1, $str2)
{
if (utf8::is_ascii($str1) AND utf8::is_ascii($str2))
return strcasecmp($str1, $str2);
if (utf8::is_ascii($str1) and utf8::is_ascii($str2)) {
return strcasecmp($str1, $str2);
}
$str1 = utf8::strtolower($str1);
$str2 = utf8::strtolower($str2);
return strcmp($str1, $str2);
}
$str1 = utf8::strtolower($str1);
$str2 = utf8::strtolower($str2);
return strcmp($str1, $str2);
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::strcspn
*
@@ -8,23 +12,24 @@
* @copyright (c) 2005 Harry Fuecks
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
*/
function _strcspn($str, $mask, $offset = NULL, $length = NULL)
function _strcspn($str, $mask, $offset = null, $length = null)
{
if ($str == '' OR $mask == '')
return 0;
if ($str == '' or $mask == '') {
return 0;
}
if (utf8::is_ascii($str) AND utf8::is_ascii($mask))
return ($offset === NULL) ? strcspn($str, $mask) : (($length === NULL) ? strcspn($str, $mask, $offset) : strcspn($str, $mask, $offset, $length));
if (utf8::is_ascii($str) and utf8::is_ascii($mask)) {
return ($offset === null) ? strcspn($str, $mask) : (($length === null) ? strcspn($str, $mask, $offset) : strcspn($str, $mask, $offset, $length));
}
if ($str !== NULL OR $length !== NULL)
{
$str = utf8::substr($str, $offset, $length);
}
if ($str !== null or $length !== null) {
$str = utf8::substr($str, $offset, $length);
}
// Escape these characters: - [ ] . : \ ^ /
// The . and : are escaped to prevent possible warnings about POSIX regex elements
$mask = preg_replace('#[-[\].:\\\\^/]#', '\\\\$0', $mask);
preg_match('/^[^'.$mask.']+/u', $str, $matches);
// Escape these characters: - [ ] . : \ ^ /
// The . and : are escaped to prevent possible warnings about POSIX regex elements
$mask = preg_replace('#[-[\].:\\\\^/]#', '\\\\$0', $mask);
preg_match('/^[^' . $mask . ']+/u', $str, $matches);
return isset($matches[0]) ? utf8::strlen($matches[0]) : 0;
}
return isset($matches[0]) ? utf8::strlen($matches[0]) : 0;
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::stristr
*
@@ -10,19 +14,22 @@
*/
function _stristr($str, $search)
{
if (utf8::is_ascii($str) AND utf8::is_ascii($search))
return stristr($str, $search);
if (utf8::is_ascii($str) and utf8::is_ascii($search)) {
return stristr($str, $search);
}
if ($search == '')
return $str;
if ($search == '') {
return $str;
}
$str_lower = utf8::strtolower($str);
$search_lower = utf8::strtolower($search);
$str_lower = utf8::strtolower($str);
$search_lower = utf8::strtolower($search);
preg_match('/^(.*?)'.preg_quote($search, '/').'/s', $str_lower, $matches);
preg_match('/^(.*?)' . preg_quote($search, '/') . '/s', $str_lower, $matches);
if (isset($matches[1]))
return substr($str, strlen($matches[1]));
if (isset($matches[1])) {
return substr($str, strlen($matches[1]));
}
return FALSE;
}
return false;
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::strlen
*
@@ -10,12 +14,14 @@
*/
function _strlen($str)
{
// Try mb_strlen() first because it's faster than combination of is_ascii() and strlen()
if (SERVER_UTF8)
return mb_strlen($str);
// Try mb_strlen() first because it's faster than combination of is_ascii() and strlen()
if (SERVER_UTF8) {
return mb_strlen($str);
}
if (utf8::is_ascii($str))
return strlen($str);
if (utf8::is_ascii($str)) {
return strlen($str);
}
return strlen(utf8_decode($str));
}
return strlen(utf8_decode($str));
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::strpos
*
@@ -10,21 +14,22 @@
*/
function _strpos($str, $search, $offset = 0)
{
$offset = (int) $offset;
$offset = (int) $offset;
if (SERVER_UTF8)
return mb_strpos($str, $search, $offset);
if (SERVER_UTF8) {
return mb_strpos($str, $search, $offset);
}
if (utf8::is_ascii($str) AND utf8::is_ascii($search))
return strpos($str, $search, $offset);
if (utf8::is_ascii($str) and utf8::is_ascii($search)) {
return strpos($str, $search, $offset);
}
if ($offset == 0)
{
$array = explode($search, $str, 2);
return isset($array[1]) ? utf8::strlen($array[0]) : FALSE;
}
if ($offset == 0) {
$array = explode($search, $str, 2);
return isset($array[1]) ? utf8::strlen($array[0]) : false;
}
$str = utf8::substr($str, $offset);
$pos = utf8::strpos($str, $search);
return ($pos === FALSE) ? FALSE : $pos + $offset;
}
$str = utf8::substr($str, $offset);
$pos = utf8::strpos($str, $search);
return ($pos === false) ? false : $pos + $offset;
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::strrev
*
@@ -10,9 +14,10 @@
*/
function _strrev($str)
{
if (utf8::is_ascii($str))
return strrev($str);
if (utf8::is_ascii($str)) {
return strrev($str);
}
preg_match_all('/./us', $str, $matches);
return implode('', array_reverse($matches[0]));
}
preg_match_all('/./us', $str, $matches);
return implode('', array_reverse($matches[0]));
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::strrpos
*
@@ -10,21 +14,22 @@
*/
function _strrpos($str, $search, $offset = 0)
{
$offset = (int) $offset;
$offset = (int) $offset;
if (SERVER_UTF8)
return mb_strrpos($str, $search, $offset);
if (SERVER_UTF8) {
return mb_strrpos($str, $search, $offset);
}
if (utf8::is_ascii($str) AND utf8::is_ascii($search))
return strrpos($str, $search, $offset);
if (utf8::is_ascii($str) and utf8::is_ascii($search)) {
return strrpos($str, $search, $offset);
}
if ($offset == 0)
{
$array = explode($search, $str, -1);
return isset($array[0]) ? utf8::strlen(implode($search, $array)) : FALSE;
}
if ($offset == 0) {
$array = explode($search, $str, -1);
return isset($array[0]) ? utf8::strlen(implode($search, $array)) : false;
}
$str = utf8::substr($str, $offset);
$pos = utf8::strrpos($str, $search);
return ($pos === FALSE) ? FALSE : $pos + $offset;
}
$str = utf8::substr($str, $offset);
$pos = utf8::strrpos($str, $search);
return ($pos === false) ? false : $pos + $offset;
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::strspn
*
@@ -8,23 +12,24 @@
* @copyright (c) 2005 Harry Fuecks
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
*/
function _strspn($str, $mask, $offset = NULL, $length = NULL)
function _strspn($str, $mask, $offset = null, $length = null)
{
if ($str == '' OR $mask == '')
return 0;
if ($str == '' or $mask == '') {
return 0;
}
if (utf8::is_ascii($str) AND utf8::is_ascii($mask))
return ($offset === NULL) ? strspn($str, $mask) : (($length === NULL) ? strspn($str, $mask, $offset) : strspn($str, $mask, $offset, $length));
if (utf8::is_ascii($str) and utf8::is_ascii($mask)) {
return ($offset === null) ? strspn($str, $mask) : (($length === null) ? strspn($str, $mask, $offset) : strspn($str, $mask, $offset, $length));
}
if ($offset !== NULL OR $length !== NULL)
{
$str = utf8::substr($str, $offset, $length);
}
if ($offset !== null or $length !== null) {
$str = utf8::substr($str, $offset, $length);
}
// Escape these characters: - [ ] . : \ ^ /
// The . and : are escaped to prevent possible warnings about POSIX regex elements
$mask = preg_replace('#[-[\].:\\\\^/]#', '\\\\$0', $mask);
preg_match('/^[^'.$mask.']+/u', $str, $matches);
// Escape these characters: - [ ] . : \ ^ /
// The . and : are escaped to prevent possible warnings about POSIX regex elements
$mask = preg_replace('#[-[\].:\\\\^/]#', '\\\\$0', $mask);
preg_match('/^[^' . $mask . ']+/u', $str, $matches);
return isset($matches[0]) ? utf8::strlen($matches[0]) : 0;
}
return isset($matches[0]) ? utf8::strlen($matches[0]) : 0;
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::strtolower
*
@@ -10,75 +14,75 @@
*/
function _strtolower($str)
{
if (SERVER_UTF8)
return mb_strtolower($str);
if (SERVER_UTF8) {
return mb_strtolower($str);
}
if (utf8::is_ascii($str))
return strtolower($str);
if (utf8::is_ascii($str)) {
return strtolower($str);
}
static $UTF8_UPPER_TO_LOWER = NULL;
static $UTF8_UPPER_TO_LOWER = null;
if ($UTF8_UPPER_TO_LOWER === NULL)
{
$UTF8_UPPER_TO_LOWER = array(
0x0041=>0x0061, 0x03A6=>0x03C6, 0x0162=>0x0163, 0x00C5=>0x00E5, 0x0042=>0x0062,
0x0139=>0x013A, 0x00C1=>0x00E1, 0x0141=>0x0142, 0x038E=>0x03CD, 0x0100=>0x0101,
0x0490=>0x0491, 0x0394=>0x03B4, 0x015A=>0x015B, 0x0044=>0x0064, 0x0393=>0x03B3,
0x00D4=>0x00F4, 0x042A=>0x044A, 0x0419=>0x0439, 0x0112=>0x0113, 0x041C=>0x043C,
0x015E=>0x015F, 0x0143=>0x0144, 0x00CE=>0x00EE, 0x040E=>0x045E, 0x042F=>0x044F,
0x039A=>0x03BA, 0x0154=>0x0155, 0x0049=>0x0069, 0x0053=>0x0073, 0x1E1E=>0x1E1F,
0x0134=>0x0135, 0x0427=>0x0447, 0x03A0=>0x03C0, 0x0418=>0x0438, 0x00D3=>0x00F3,
0x0420=>0x0440, 0x0404=>0x0454, 0x0415=>0x0435, 0x0429=>0x0449, 0x014A=>0x014B,
0x0411=>0x0431, 0x0409=>0x0459, 0x1E02=>0x1E03, 0x00D6=>0x00F6, 0x00D9=>0x00F9,
0x004E=>0x006E, 0x0401=>0x0451, 0x03A4=>0x03C4, 0x0423=>0x0443, 0x015C=>0x015D,
0x0403=>0x0453, 0x03A8=>0x03C8, 0x0158=>0x0159, 0x0047=>0x0067, 0x00C4=>0x00E4,
0x0386=>0x03AC, 0x0389=>0x03AE, 0x0166=>0x0167, 0x039E=>0x03BE, 0x0164=>0x0165,
0x0116=>0x0117, 0x0108=>0x0109, 0x0056=>0x0076, 0x00DE=>0x00FE, 0x0156=>0x0157,
0x00DA=>0x00FA, 0x1E60=>0x1E61, 0x1E82=>0x1E83, 0x00C2=>0x00E2, 0x0118=>0x0119,
0x0145=>0x0146, 0x0050=>0x0070, 0x0150=>0x0151, 0x042E=>0x044E, 0x0128=>0x0129,
0x03A7=>0x03C7, 0x013D=>0x013E, 0x0422=>0x0442, 0x005A=>0x007A, 0x0428=>0x0448,
0x03A1=>0x03C1, 0x1E80=>0x1E81, 0x016C=>0x016D, 0x00D5=>0x00F5, 0x0055=>0x0075,
0x0176=>0x0177, 0x00DC=>0x00FC, 0x1E56=>0x1E57, 0x03A3=>0x03C3, 0x041A=>0x043A,
0x004D=>0x006D, 0x016A=>0x016B, 0x0170=>0x0171, 0x0424=>0x0444, 0x00CC=>0x00EC,
0x0168=>0x0169, 0x039F=>0x03BF, 0x004B=>0x006B, 0x00D2=>0x00F2, 0x00C0=>0x00E0,
0x0414=>0x0434, 0x03A9=>0x03C9, 0x1E6A=>0x1E6B, 0x00C3=>0x00E3, 0x042D=>0x044D,
0x0416=>0x0436, 0x01A0=>0x01A1, 0x010C=>0x010D, 0x011C=>0x011D, 0x00D0=>0x00F0,
0x013B=>0x013C, 0x040F=>0x045F, 0x040A=>0x045A, 0x00C8=>0x00E8, 0x03A5=>0x03C5,
0x0046=>0x0066, 0x00DD=>0x00FD, 0x0043=>0x0063, 0x021A=>0x021B, 0x00CA=>0x00EA,
0x0399=>0x03B9, 0x0179=>0x017A, 0x00CF=>0x00EF, 0x01AF=>0x01B0, 0x0045=>0x0065,
0x039B=>0x03BB, 0x0398=>0x03B8, 0x039C=>0x03BC, 0x040C=>0x045C, 0x041F=>0x043F,
0x042C=>0x044C, 0x00DE=>0x00FE, 0x00D0=>0x00F0, 0x1EF2=>0x1EF3, 0x0048=>0x0068,
0x00CB=>0x00EB, 0x0110=>0x0111, 0x0413=>0x0433, 0x012E=>0x012F, 0x00C6=>0x00E6,
0x0058=>0x0078, 0x0160=>0x0161, 0x016E=>0x016F, 0x0391=>0x03B1, 0x0407=>0x0457,
0x0172=>0x0173, 0x0178=>0x00FF, 0x004F=>0x006F, 0x041B=>0x043B, 0x0395=>0x03B5,
0x0425=>0x0445, 0x0120=>0x0121, 0x017D=>0x017E, 0x017B=>0x017C, 0x0396=>0x03B6,
0x0392=>0x03B2, 0x0388=>0x03AD, 0x1E84=>0x1E85, 0x0174=>0x0175, 0x0051=>0x0071,
0x0417=>0x0437, 0x1E0A=>0x1E0B, 0x0147=>0x0148, 0x0104=>0x0105, 0x0408=>0x0458,
0x014C=>0x014D, 0x00CD=>0x00ED, 0x0059=>0x0079, 0x010A=>0x010B, 0x038F=>0x03CE,
0x0052=>0x0072, 0x0410=>0x0430, 0x0405=>0x0455, 0x0402=>0x0452, 0x0126=>0x0127,
0x0136=>0x0137, 0x012A=>0x012B, 0x038A=>0x03AF, 0x042B=>0x044B, 0x004C=>0x006C,
0x0397=>0x03B7, 0x0124=>0x0125, 0x0218=>0x0219, 0x00DB=>0x00FB, 0x011E=>0x011F,
0x041E=>0x043E, 0x1E40=>0x1E41, 0x039D=>0x03BD, 0x0106=>0x0107, 0x03AB=>0x03CB,
0x0426=>0x0446, 0x00DE=>0x00FE, 0x00C7=>0x00E7, 0x03AA=>0x03CA, 0x0421=>0x0441,
0x0412=>0x0432, 0x010E=>0x010F, 0x00D8=>0x00F8, 0x0057=>0x0077, 0x011A=>0x011B,
0x0054=>0x0074, 0x004A=>0x006A, 0x040B=>0x045B, 0x0406=>0x0456, 0x0102=>0x0103,
0x039B=>0x03BB, 0x00D1=>0x00F1, 0x041D=>0x043D, 0x038C=>0x03CC, 0x00C9=>0x00E9,
0x00D0=>0x00F0, 0x0407=>0x0457, 0x0122=>0x0123,
);
}
if ($UTF8_UPPER_TO_LOWER === null) {
$UTF8_UPPER_TO_LOWER = array(
0x0041 => 0x0061, 0x03A6 => 0x03C6, 0x0162 => 0x0163, 0x00C5 => 0x00E5, 0x0042 => 0x0062,
0x0139 => 0x013A, 0x00C1 => 0x00E1, 0x0141 => 0x0142, 0x038E => 0x03CD, 0x0100 => 0x0101,
0x0490 => 0x0491, 0x0394 => 0x03B4, 0x015A => 0x015B, 0x0044 => 0x0064, 0x0393 => 0x03B3,
0x00D4 => 0x00F4, 0x042A => 0x044A, 0x0419 => 0x0439, 0x0112 => 0x0113, 0x041C => 0x043C,
0x015E => 0x015F, 0x0143 => 0x0144, 0x00CE => 0x00EE, 0x040E => 0x045E, 0x042F => 0x044F,
0x039A => 0x03BA, 0x0154 => 0x0155, 0x0049 => 0x0069, 0x0053 => 0x0073, 0x1E1E => 0x1E1F,
0x0134 => 0x0135, 0x0427 => 0x0447, 0x03A0 => 0x03C0, 0x0418 => 0x0438, 0x00D3 => 0x00F3,
0x0420 => 0x0440, 0x0404 => 0x0454, 0x0415 => 0x0435, 0x0429 => 0x0449, 0x014A => 0x014B,
0x0411 => 0x0431, 0x0409 => 0x0459, 0x1E02 => 0x1E03, 0x00D6 => 0x00F6, 0x00D9 => 0x00F9,
0x004E => 0x006E, 0x0401 => 0x0451, 0x03A4 => 0x03C4, 0x0423 => 0x0443, 0x015C => 0x015D,
0x0403 => 0x0453, 0x03A8 => 0x03C8, 0x0158 => 0x0159, 0x0047 => 0x0067, 0x00C4 => 0x00E4,
0x0386 => 0x03AC, 0x0389 => 0x03AE, 0x0166 => 0x0167, 0x039E => 0x03BE, 0x0164 => 0x0165,
0x0116 => 0x0117, 0x0108 => 0x0109, 0x0056 => 0x0076, 0x00DE => 0x00FE, 0x0156 => 0x0157,
0x00DA => 0x00FA, 0x1E60 => 0x1E61, 0x1E82 => 0x1E83, 0x00C2 => 0x00E2, 0x0118 => 0x0119,
0x0145 => 0x0146, 0x0050 => 0x0070, 0x0150 => 0x0151, 0x042E => 0x044E, 0x0128 => 0x0129,
0x03A7 => 0x03C7, 0x013D => 0x013E, 0x0422 => 0x0442, 0x005A => 0x007A, 0x0428 => 0x0448,
0x03A1 => 0x03C1, 0x1E80 => 0x1E81, 0x016C => 0x016D, 0x00D5 => 0x00F5, 0x0055 => 0x0075,
0x0176 => 0x0177, 0x00DC => 0x00FC, 0x1E56 => 0x1E57, 0x03A3 => 0x03C3, 0x041A => 0x043A,
0x004D => 0x006D, 0x016A => 0x016B, 0x0170 => 0x0171, 0x0424 => 0x0444, 0x00CC => 0x00EC,
0x0168 => 0x0169, 0x039F => 0x03BF, 0x004B => 0x006B, 0x00D2 => 0x00F2, 0x00C0 => 0x00E0,
0x0414 => 0x0434, 0x03A9 => 0x03C9, 0x1E6A => 0x1E6B, 0x00C3 => 0x00E3, 0x042D => 0x044D,
0x0416 => 0x0436, 0x01A0 => 0x01A1, 0x010C => 0x010D, 0x011C => 0x011D, 0x00D0 => 0x00F0,
0x013B => 0x013C, 0x040F => 0x045F, 0x040A => 0x045A, 0x00C8 => 0x00E8, 0x03A5 => 0x03C5,
0x0046 => 0x0066, 0x00DD => 0x00FD, 0x0043 => 0x0063, 0x021A => 0x021B, 0x00CA => 0x00EA,
0x0399 => 0x03B9, 0x0179 => 0x017A, 0x00CF => 0x00EF, 0x01AF => 0x01B0, 0x0045 => 0x0065,
0x039B => 0x03BB, 0x0398 => 0x03B8, 0x039C => 0x03BC, 0x040C => 0x045C, 0x041F => 0x043F,
0x042C => 0x044C, 0x00DE => 0x00FE, 0x00D0 => 0x00F0, 0x1EF2 => 0x1EF3, 0x0048 => 0x0068,
0x00CB => 0x00EB, 0x0110 => 0x0111, 0x0413 => 0x0433, 0x012E => 0x012F, 0x00C6 => 0x00E6,
0x0058 => 0x0078, 0x0160 => 0x0161, 0x016E => 0x016F, 0x0391 => 0x03B1, 0x0407 => 0x0457,
0x0172 => 0x0173, 0x0178 => 0x00FF, 0x004F => 0x006F, 0x041B => 0x043B, 0x0395 => 0x03B5,
0x0425 => 0x0445, 0x0120 => 0x0121, 0x017D => 0x017E, 0x017B => 0x017C, 0x0396 => 0x03B6,
0x0392 => 0x03B2, 0x0388 => 0x03AD, 0x1E84 => 0x1E85, 0x0174 => 0x0175, 0x0051 => 0x0071,
0x0417 => 0x0437, 0x1E0A => 0x1E0B, 0x0147 => 0x0148, 0x0104 => 0x0105, 0x0408 => 0x0458,
0x014C => 0x014D, 0x00CD => 0x00ED, 0x0059 => 0x0079, 0x010A => 0x010B, 0x038F => 0x03CE,
0x0052 => 0x0072, 0x0410 => 0x0430, 0x0405 => 0x0455, 0x0402 => 0x0452, 0x0126 => 0x0127,
0x0136 => 0x0137, 0x012A => 0x012B, 0x038A => 0x03AF, 0x042B => 0x044B, 0x004C => 0x006C,
0x0397 => 0x03B7, 0x0124 => 0x0125, 0x0218 => 0x0219, 0x00DB => 0x00FB, 0x011E => 0x011F,
0x041E => 0x043E, 0x1E40 => 0x1E41, 0x039D => 0x03BD, 0x0106 => 0x0107, 0x03AB => 0x03CB,
0x0426 => 0x0446, 0x00DE => 0x00FE, 0x00C7 => 0x00E7, 0x03AA => 0x03CA, 0x0421 => 0x0441,
0x0412 => 0x0432, 0x010E => 0x010F, 0x00D8 => 0x00F8, 0x0057 => 0x0077, 0x011A => 0x011B,
0x0054 => 0x0074, 0x004A => 0x006A, 0x040B => 0x045B, 0x0406 => 0x0456, 0x0102 => 0x0103,
0x039B => 0x03BB, 0x00D1 => 0x00F1, 0x041D => 0x043D, 0x038C => 0x03CC, 0x00C9 => 0x00E9,
0x00D0 => 0x00F0, 0x0407 => 0x0457, 0x0122 => 0x0123,
);
}
$uni = utf8::to_unicode($str);
$uni = utf8::to_unicode($str);
if ($uni === FALSE)
return FALSE;
if ($uni === false) {
return false;
}
for ($i = 0, $c = count($uni); $i < $c; $i++)
{
if (isset($UTF8_UPPER_TO_LOWER[$uni[$i]]))
{
$uni[$i] = $UTF8_UPPER_TO_LOWER[$uni[$i]];
}
}
for ($i = 0, $c = count($uni); $i < $c; $i++) {
if (isset($UTF8_UPPER_TO_LOWER[$uni[$i]])) {
$uni[$i] = $UTF8_UPPER_TO_LOWER[$uni[$i]];
}
}
return utf8::from_unicode($uni);
}
return utf8::from_unicode($uni);
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::strtoupper
*
@@ -10,75 +14,75 @@
*/
function _strtoupper($str)
{
if (SERVER_UTF8)
return mb_strtoupper($str);
if (SERVER_UTF8) {
return mb_strtoupper($str);
}
if (utf8::is_ascii($str))
return strtoupper($str);
if (utf8::is_ascii($str)) {
return strtoupper($str);
}
static $UTF8_LOWER_TO_UPPER = NULL;
static $UTF8_LOWER_TO_UPPER = null;
if ($UTF8_LOWER_TO_UPPER === NULL)
{
$UTF8_LOWER_TO_UPPER = array(
0x0061=>0x0041, 0x03C6=>0x03A6, 0x0163=>0x0162, 0x00E5=>0x00C5, 0x0062=>0x0042,
0x013A=>0x0139, 0x00E1=>0x00C1, 0x0142=>0x0141, 0x03CD=>0x038E, 0x0101=>0x0100,
0x0491=>0x0490, 0x03B4=>0x0394, 0x015B=>0x015A, 0x0064=>0x0044, 0x03B3=>0x0393,
0x00F4=>0x00D4, 0x044A=>0x042A, 0x0439=>0x0419, 0x0113=>0x0112, 0x043C=>0x041C,
0x015F=>0x015E, 0x0144=>0x0143, 0x00EE=>0x00CE, 0x045E=>0x040E, 0x044F=>0x042F,
0x03BA=>0x039A, 0x0155=>0x0154, 0x0069=>0x0049, 0x0073=>0x0053, 0x1E1F=>0x1E1E,
0x0135=>0x0134, 0x0447=>0x0427, 0x03C0=>0x03A0, 0x0438=>0x0418, 0x00F3=>0x00D3,
0x0440=>0x0420, 0x0454=>0x0404, 0x0435=>0x0415, 0x0449=>0x0429, 0x014B=>0x014A,
0x0431=>0x0411, 0x0459=>0x0409, 0x1E03=>0x1E02, 0x00F6=>0x00D6, 0x00F9=>0x00D9,
0x006E=>0x004E, 0x0451=>0x0401, 0x03C4=>0x03A4, 0x0443=>0x0423, 0x015D=>0x015C,
0x0453=>0x0403, 0x03C8=>0x03A8, 0x0159=>0x0158, 0x0067=>0x0047, 0x00E4=>0x00C4,
0x03AC=>0x0386, 0x03AE=>0x0389, 0x0167=>0x0166, 0x03BE=>0x039E, 0x0165=>0x0164,
0x0117=>0x0116, 0x0109=>0x0108, 0x0076=>0x0056, 0x00FE=>0x00DE, 0x0157=>0x0156,
0x00FA=>0x00DA, 0x1E61=>0x1E60, 0x1E83=>0x1E82, 0x00E2=>0x00C2, 0x0119=>0x0118,
0x0146=>0x0145, 0x0070=>0x0050, 0x0151=>0x0150, 0x044E=>0x042E, 0x0129=>0x0128,
0x03C7=>0x03A7, 0x013E=>0x013D, 0x0442=>0x0422, 0x007A=>0x005A, 0x0448=>0x0428,
0x03C1=>0x03A1, 0x1E81=>0x1E80, 0x016D=>0x016C, 0x00F5=>0x00D5, 0x0075=>0x0055,
0x0177=>0x0176, 0x00FC=>0x00DC, 0x1E57=>0x1E56, 0x03C3=>0x03A3, 0x043A=>0x041A,
0x006D=>0x004D, 0x016B=>0x016A, 0x0171=>0x0170, 0x0444=>0x0424, 0x00EC=>0x00CC,
0x0169=>0x0168, 0x03BF=>0x039F, 0x006B=>0x004B, 0x00F2=>0x00D2, 0x00E0=>0x00C0,
0x0434=>0x0414, 0x03C9=>0x03A9, 0x1E6B=>0x1E6A, 0x00E3=>0x00C3, 0x044D=>0x042D,
0x0436=>0x0416, 0x01A1=>0x01A0, 0x010D=>0x010C, 0x011D=>0x011C, 0x00F0=>0x00D0,
0x013C=>0x013B, 0x045F=>0x040F, 0x045A=>0x040A, 0x00E8=>0x00C8, 0x03C5=>0x03A5,
0x0066=>0x0046, 0x00FD=>0x00DD, 0x0063=>0x0043, 0x021B=>0x021A, 0x00EA=>0x00CA,
0x03B9=>0x0399, 0x017A=>0x0179, 0x00EF=>0x00CF, 0x01B0=>0x01AF, 0x0065=>0x0045,
0x03BB=>0x039B, 0x03B8=>0x0398, 0x03BC=>0x039C, 0x045C=>0x040C, 0x043F=>0x041F,
0x044C=>0x042C, 0x00FE=>0x00DE, 0x00F0=>0x00D0, 0x1EF3=>0x1EF2, 0x0068=>0x0048,
0x00EB=>0x00CB, 0x0111=>0x0110, 0x0433=>0x0413, 0x012F=>0x012E, 0x00E6=>0x00C6,
0x0078=>0x0058, 0x0161=>0x0160, 0x016F=>0x016E, 0x03B1=>0x0391, 0x0457=>0x0407,
0x0173=>0x0172, 0x00FF=>0x0178, 0x006F=>0x004F, 0x043B=>0x041B, 0x03B5=>0x0395,
0x0445=>0x0425, 0x0121=>0x0120, 0x017E=>0x017D, 0x017C=>0x017B, 0x03B6=>0x0396,
0x03B2=>0x0392, 0x03AD=>0x0388, 0x1E85=>0x1E84, 0x0175=>0x0174, 0x0071=>0x0051,
0x0437=>0x0417, 0x1E0B=>0x1E0A, 0x0148=>0x0147, 0x0105=>0x0104, 0x0458=>0x0408,
0x014D=>0x014C, 0x00ED=>0x00CD, 0x0079=>0x0059, 0x010B=>0x010A, 0x03CE=>0x038F,
0x0072=>0x0052, 0x0430=>0x0410, 0x0455=>0x0405, 0x0452=>0x0402, 0x0127=>0x0126,
0x0137=>0x0136, 0x012B=>0x012A, 0x03AF=>0x038A, 0x044B=>0x042B, 0x006C=>0x004C,
0x03B7=>0x0397, 0x0125=>0x0124, 0x0219=>0x0218, 0x00FB=>0x00DB, 0x011F=>0x011E,
0x043E=>0x041E, 0x1E41=>0x1E40, 0x03BD=>0x039D, 0x0107=>0x0106, 0x03CB=>0x03AB,
0x0446=>0x0426, 0x00FE=>0x00DE, 0x00E7=>0x00C7, 0x03CA=>0x03AA, 0x0441=>0x0421,
0x0432=>0x0412, 0x010F=>0x010E, 0x00F8=>0x00D8, 0x0077=>0x0057, 0x011B=>0x011A,
0x0074=>0x0054, 0x006A=>0x004A, 0x045B=>0x040B, 0x0456=>0x0406, 0x0103=>0x0102,
0x03BB=>0x039B, 0x00F1=>0x00D1, 0x043D=>0x041D, 0x03CC=>0x038C, 0x00E9=>0x00C9,
0x00F0=>0x00D0, 0x0457=>0x0407, 0x0123=>0x0122,
);
}
if ($UTF8_LOWER_TO_UPPER === null) {
$UTF8_LOWER_TO_UPPER = array(
0x0061 => 0x0041, 0x03C6 => 0x03A6, 0x0163 => 0x0162, 0x00E5 => 0x00C5, 0x0062 => 0x0042,
0x013A => 0x0139, 0x00E1 => 0x00C1, 0x0142 => 0x0141, 0x03CD => 0x038E, 0x0101 => 0x0100,
0x0491 => 0x0490, 0x03B4 => 0x0394, 0x015B => 0x015A, 0x0064 => 0x0044, 0x03B3 => 0x0393,
0x00F4 => 0x00D4, 0x044A => 0x042A, 0x0439 => 0x0419, 0x0113 => 0x0112, 0x043C => 0x041C,
0x015F => 0x015E, 0x0144 => 0x0143, 0x00EE => 0x00CE, 0x045E => 0x040E, 0x044F => 0x042F,
0x03BA => 0x039A, 0x0155 => 0x0154, 0x0069 => 0x0049, 0x0073 => 0x0053, 0x1E1F => 0x1E1E,
0x0135 => 0x0134, 0x0447 => 0x0427, 0x03C0 => 0x03A0, 0x0438 => 0x0418, 0x00F3 => 0x00D3,
0x0440 => 0x0420, 0x0454 => 0x0404, 0x0435 => 0x0415, 0x0449 => 0x0429, 0x014B => 0x014A,
0x0431 => 0x0411, 0x0459 => 0x0409, 0x1E03 => 0x1E02, 0x00F6 => 0x00D6, 0x00F9 => 0x00D9,
0x006E => 0x004E, 0x0451 => 0x0401, 0x03C4 => 0x03A4, 0x0443 => 0x0423, 0x015D => 0x015C,
0x0453 => 0x0403, 0x03C8 => 0x03A8, 0x0159 => 0x0158, 0x0067 => 0x0047, 0x00E4 => 0x00C4,
0x03AC => 0x0386, 0x03AE => 0x0389, 0x0167 => 0x0166, 0x03BE => 0x039E, 0x0165 => 0x0164,
0x0117 => 0x0116, 0x0109 => 0x0108, 0x0076 => 0x0056, 0x00FE => 0x00DE, 0x0157 => 0x0156,
0x00FA => 0x00DA, 0x1E61 => 0x1E60, 0x1E83 => 0x1E82, 0x00E2 => 0x00C2, 0x0119 => 0x0118,
0x0146 => 0x0145, 0x0070 => 0x0050, 0x0151 => 0x0150, 0x044E => 0x042E, 0x0129 => 0x0128,
0x03C7 => 0x03A7, 0x013E => 0x013D, 0x0442 => 0x0422, 0x007A => 0x005A, 0x0448 => 0x0428,
0x03C1 => 0x03A1, 0x1E81 => 0x1E80, 0x016D => 0x016C, 0x00F5 => 0x00D5, 0x0075 => 0x0055,
0x0177 => 0x0176, 0x00FC => 0x00DC, 0x1E57 => 0x1E56, 0x03C3 => 0x03A3, 0x043A => 0x041A,
0x006D => 0x004D, 0x016B => 0x016A, 0x0171 => 0x0170, 0x0444 => 0x0424, 0x00EC => 0x00CC,
0x0169 => 0x0168, 0x03BF => 0x039F, 0x006B => 0x004B, 0x00F2 => 0x00D2, 0x00E0 => 0x00C0,
0x0434 => 0x0414, 0x03C9 => 0x03A9, 0x1E6B => 0x1E6A, 0x00E3 => 0x00C3, 0x044D => 0x042D,
0x0436 => 0x0416, 0x01A1 => 0x01A0, 0x010D => 0x010C, 0x011D => 0x011C, 0x00F0 => 0x00D0,
0x013C => 0x013B, 0x045F => 0x040F, 0x045A => 0x040A, 0x00E8 => 0x00C8, 0x03C5 => 0x03A5,
0x0066 => 0x0046, 0x00FD => 0x00DD, 0x0063 => 0x0043, 0x021B => 0x021A, 0x00EA => 0x00CA,
0x03B9 => 0x0399, 0x017A => 0x0179, 0x00EF => 0x00CF, 0x01B0 => 0x01AF, 0x0065 => 0x0045,
0x03BB => 0x039B, 0x03B8 => 0x0398, 0x03BC => 0x039C, 0x045C => 0x040C, 0x043F => 0x041F,
0x044C => 0x042C, 0x00FE => 0x00DE, 0x00F0 => 0x00D0, 0x1EF3 => 0x1EF2, 0x0068 => 0x0048,
0x00EB => 0x00CB, 0x0111 => 0x0110, 0x0433 => 0x0413, 0x012F => 0x012E, 0x00E6 => 0x00C6,
0x0078 => 0x0058, 0x0161 => 0x0160, 0x016F => 0x016E, 0x03B1 => 0x0391, 0x0457 => 0x0407,
0x0173 => 0x0172, 0x00FF => 0x0178, 0x006F => 0x004F, 0x043B => 0x041B, 0x03B5 => 0x0395,
0x0445 => 0x0425, 0x0121 => 0x0120, 0x017E => 0x017D, 0x017C => 0x017B, 0x03B6 => 0x0396,
0x03B2 => 0x0392, 0x03AD => 0x0388, 0x1E85 => 0x1E84, 0x0175 => 0x0174, 0x0071 => 0x0051,
0x0437 => 0x0417, 0x1E0B => 0x1E0A, 0x0148 => 0x0147, 0x0105 => 0x0104, 0x0458 => 0x0408,
0x014D => 0x014C, 0x00ED => 0x00CD, 0x0079 => 0x0059, 0x010B => 0x010A, 0x03CE => 0x038F,
0x0072 => 0x0052, 0x0430 => 0x0410, 0x0455 => 0x0405, 0x0452 => 0x0402, 0x0127 => 0x0126,
0x0137 => 0x0136, 0x012B => 0x012A, 0x03AF => 0x038A, 0x044B => 0x042B, 0x006C => 0x004C,
0x03B7 => 0x0397, 0x0125 => 0x0124, 0x0219 => 0x0218, 0x00FB => 0x00DB, 0x011F => 0x011E,
0x043E => 0x041E, 0x1E41 => 0x1E40, 0x03BD => 0x039D, 0x0107 => 0x0106, 0x03CB => 0x03AB,
0x0446 => 0x0426, 0x00FE => 0x00DE, 0x00E7 => 0x00C7, 0x03CA => 0x03AA, 0x0441 => 0x0421,
0x0432 => 0x0412, 0x010F => 0x010E, 0x00F8 => 0x00D8, 0x0077 => 0x0057, 0x011B => 0x011A,
0x0074 => 0x0054, 0x006A => 0x004A, 0x045B => 0x040B, 0x0456 => 0x0406, 0x0103 => 0x0102,
0x03BB => 0x039B, 0x00F1 => 0x00D1, 0x043D => 0x041D, 0x03CC => 0x038C, 0x00E9 => 0x00C9,
0x00F0 => 0x00D0, 0x0457 => 0x0407, 0x0123 => 0x0122,
);
}
$uni = utf8::to_unicode($str);
$uni = utf8::to_unicode($str);
if ($uni === FALSE)
return FALSE;
if ($uni === false) {
return false;
}
for ($i = 0, $c = count($uni); $i < $c; $i++)
{
if (isset($UTF8_LOWER_TO_UPPER[$uni[$i]]))
{
$uni[$i] = $UTF8_LOWER_TO_UPPER[$uni[$i]];
}
}
for ($i = 0, $c = count($uni); $i < $c; $i++) {
if (isset($UTF8_LOWER_TO_UPPER[$uni[$i]])) {
$uni[$i] = $UTF8_LOWER_TO_UPPER[$uni[$i]];
}
}
return utf8::from_unicode($uni);
}
return utf8::from_unicode($uni);
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::substr
*
@@ -8,68 +12,66 @@
* @copyright (c) 2005 Harry Fuecks
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
*/
function _substr($str, $offset, $length = NULL)
function _substr($str, $offset, $length = null)
{
if (SERVER_UTF8)
return ($length === NULL) ? mb_substr($str, $offset) : mb_substr($str, $offset, $length);
if (SERVER_UTF8) {
return ($length === null) ? mb_substr($str, $offset) : mb_substr($str, $offset, $length);
}
if (utf8::is_ascii($str))
return ($length === NULL) ? substr($str, $offset) : substr($str, $offset, $length);
if (utf8::is_ascii($str)) {
return ($length === null) ? substr($str, $offset) : substr($str, $offset, $length);
}
// Normalize params
$str = (string) $str;
$strlen = utf8::strlen($str);
$offset = (int) ($offset < 0) ? max(0, $strlen + $offset) : $offset; // Normalize to positive offset
$length = ($length === NULL) ? NULL : (int) $length;
// Normalize params
$str = (string) $str;
$strlen = utf8::strlen($str);
$offset = (int) ($offset < 0) ? max(0, $strlen + $offset) : $offset; // Normalize to positive offset
$length = ($length === null) ? null : (int) $length;
// Impossible
if ($length === 0 OR $offset >= $strlen OR ($length < 0 AND $length <= $offset - $strlen))
return '';
// Impossible
if ($length === 0 or $offset >= $strlen or ($length < 0 and $length <= $offset - $strlen)) {
return '';
}
// Whole string
if ($offset == 0 AND ($length === NULL OR $length >= $strlen))
return $str;
// Whole string
if ($offset == 0 and ($length === null or $length >= $strlen)) {
return $str;
}
// Build regex
$regex = '^';
// Build regex
$regex = '^';
// Create an offset expression
if ($offset > 0)
{
// PCRE repeating quantifiers must be less than 65536, so repeat when necessary
$x = (int) ($offset / 65535);
$y = (int) ($offset % 65535);
$regex .= ($x == 0) ? '' : '(?:.{65535}){'.$x.'}';
$regex .= ($y == 0) ? '' : '.{'.$y.'}';
}
// Create an offset expression
if ($offset > 0) {
// PCRE repeating quantifiers must be less than 65536, so repeat when necessary
$x = (int) ($offset / 65535);
$y = (int) ($offset % 65535);
$regex .= ($x == 0) ? '' : '(?:.{65535}){' . $x . '}';
$regex .= ($y == 0) ? '' : '.{' . $y . '}';
}
// Create a length expression
if ($length === NULL)
{
$regex .= '(.*)'; // No length set, grab it all
}
// Find length from the left (positive length)
elseif ($length > 0)
{
// Reduce length so that it can't go beyond the end of the string
$length = min($strlen - $offset, $length);
// Create a length expression
if ($length === null) {
$regex .= '(.*)'; // No length set, grab it all
} elseif ($length > 0) {
// Find length from the left (positive length)
// Reduce length so that it can't go beyond the end of the string
$length = min($strlen - $offset, $length);
$x = (int) ($length / 65535);
$y = (int) ($length % 65535);
$regex .= '(';
$regex .= ($x == 0) ? '' : '(?:.{65535}){'.$x.'}';
$regex .= '.{'.$y.'})';
}
// Find length from the right (negative length)
else
{
$x = (int) (-$length / 65535);
$y = (int) (-$length % 65535);
$regex .= '(.*)';
$regex .= ($x == 0) ? '' : '(?:.{65535}){'.$x.'}';
$regex .= '.{'.$y.'}';
}
$x = (int) ($length / 65535);
$y = (int) ($length % 65535);
$regex .= '(';
$regex .= ($x == 0) ? '' : '(?:.{65535}){' . $x . '}';
$regex .= '.{' . $y . '})';
} else {
// Find length from the right (negative length)
$x = (int) (-$length / 65535);
$y = (int) (-$length % 65535);
$regex .= '(.*)';
$regex .= ($x == 0) ? '' : '(?:.{65535}){' . $x . '}';
$regex .= '.{' . $y . '}';
}
preg_match('/'.$regex.'/us', $str, $matches);
return $matches[1];
}
preg_match('/' . $regex . '/us', $str, $matches);
return $matches[1];
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::substr_replace
*
@@ -8,15 +12,16 @@
* @copyright (c) 2005 Harry Fuecks
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
*/
function _substr_replace($str, $replacement, $offset, $length = NULL)
function _substr_replace($str, $replacement, $offset, $length = null)
{
if (utf8::is_ascii($str))
return ($length === NULL) ? substr_replace($str, $replacement, $offset) : substr_replace($str, $replacement, $offset, $length);
if (utf8::is_ascii($str)) {
return ($length === null) ? substr_replace($str, $replacement, $offset) : substr_replace($str, $replacement, $offset, $length);
}
$length = ($length === NULL) ? utf8::strlen($str) : (int) $length;
preg_match_all('/./us', $str, $str_array);
preg_match_all('/./us', $replacement, $replacement_array);
$length = ($length === null) ? utf8::strlen($str) : (int) $length;
preg_match_all('/./us', $str, $str_array);
preg_match_all('/./us', $replacement, $replacement_array);
array_splice($str_array[0], $offset, $length, $replacement_array[0]);
return implode('', $str_array[0]);
}
array_splice($str_array[0], $offset, $length, $replacement_array[0]);
return implode('', $str_array[0]);
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::to_unicode
*
@@ -10,132 +14,111 @@
*/
function _to_unicode($str)
{
$mState = 0; // cached expected number of octets after the current octet until the beginning of the next UTF8 character sequence
$mUcs4 = 0; // cached Unicode character
$mBytes = 1; // cached expected number of octets in the current sequence
$mState = 0; // cached expected number of octets after the current octet until the beginning of the next UTF8 character sequence
$mUcs4 = 0; // cached Unicode character
$mBytes = 1; // cached expected number of octets in the current sequence
$out = array();
$out = array();
$len = strlen($str);
$len = strlen($str);
for ($i = 0; $i < $len; $i++)
{
$in = ord($str[$i]);
for ($i = 0; $i < $len; $i++) {
$in = ord($str[$i]);
if ($mState == 0)
{
// When mState is zero we expect either a US-ASCII character or a
// multi-octet sequence.
if (0 == (0x80 & $in))
{
// US-ASCII, pass straight through.
$out[] = $in;
$mBytes = 1;
}
elseif (0xC0 == (0xE0 & $in))
{
// First octet of 2 octet sequence
$mUcs4 = $in;
$mUcs4 = ($mUcs4 & 0x1F) << 6;
$mState = 1;
$mBytes = 2;
}
elseif (0xE0 == (0xF0 & $in))
{
// First octet of 3 octet sequence
$mUcs4 = $in;
$mUcs4 = ($mUcs4 & 0x0F) << 12;
$mState = 2;
$mBytes = 3;
}
elseif (0xF0 == (0xF8 & $in))
{
// First octet of 4 octet sequence
$mUcs4 = $in;
$mUcs4 = ($mUcs4 & 0x07) << 18;
$mState = 3;
$mBytes = 4;
}
elseif (0xF8 == (0xFC & $in))
{
// First octet of 5 octet sequence.
//
// This is illegal because the encoded codepoint must be either
// (a) not the shortest form or
// (b) outside the Unicode range of 0-0x10FFFF.
// Rather than trying to resynchronize, we will carry on until the end
// of the sequence and let the later error handling code catch it.
$mUcs4 = $in;
$mUcs4 = ($mUcs4 & 0x03) << 24;
$mState = 4;
$mBytes = 5;
}
elseif (0xFC == (0xFE & $in))
{
// First octet of 6 octet sequence, see comments for 5 octet sequence.
$mUcs4 = $in;
$mUcs4 = ($mUcs4 & 1) << 30;
$mState = 5;
$mBytes = 6;
}
else
{
// Current octet is neither in the US-ASCII range nor a legal first octet of a multi-octet sequence.
trigger_error('utf8::to_unicode: Illegal sequence identifier in UTF-8 at byte '.$i, E_USER_WARNING);
return FALSE;
}
}
else
{
// When mState is non-zero, we expect a continuation of the multi-octet sequence
if (0x80 == (0xC0 & $in))
{
// Legal continuation
$shift = ($mState - 1) * 6;
$tmp = $in;
$tmp = ($tmp & 0x0000003F) << $shift;
$mUcs4 |= $tmp;
if ($mState == 0) {
// When mState is zero we expect either a US-ASCII character or a
// multi-octet sequence.
if (0 == (0x80 & $in)) {
// US-ASCII, pass straight through.
$out[] = $in;
$mBytes = 1;
} elseif (0xC0 == (0xE0 & $in)) {
// First octet of 2 octet sequence
$mUcs4 = $in;
$mUcs4 = ($mUcs4 & 0x1F) << 6;
$mState = 1;
$mBytes = 2;
} elseif (0xE0 == (0xF0 & $in)) {
// First octet of 3 octet sequence
$mUcs4 = $in;
$mUcs4 = ($mUcs4 & 0x0F) << 12;
$mState = 2;
$mBytes = 3;
} elseif (0xF0 == (0xF8 & $in)) {
// First octet of 4 octet sequence
$mUcs4 = $in;
$mUcs4 = ($mUcs4 & 0x07) << 18;
$mState = 3;
$mBytes = 4;
} elseif (0xF8 == (0xFC & $in)) {
// First octet of 5 octet sequence.
//
// This is illegal because the encoded codepoint must be either
// (a) not the shortest form or
// (b) outside the Unicode range of 0-0x10FFFF.
// Rather than trying to resynchronize, we will carry on until the end
// of the sequence and let the later error handling code catch it.
$mUcs4 = $in;
$mUcs4 = ($mUcs4 & 0x03) << 24;
$mState = 4;
$mBytes = 5;
} elseif (0xFC == (0xFE & $in)) {
// First octet of 6 octet sequence, see comments for 5 octet sequence.
$mUcs4 = $in;
$mUcs4 = ($mUcs4 & 1) << 30;
$mState = 5;
$mBytes = 6;
} else {
// Current octet is neither in the US-ASCII range nor a legal first octet of a multi-octet sequence.
trigger_error('utf8::to_unicode: Illegal sequence identifier in UTF-8 at byte ' . $i, E_USER_WARNING);
return false;
}
} else {
// When mState is non-zero, we expect a continuation of the multi-octet sequence
if (0x80 == (0xC0 & $in)) {
// Legal continuation
$shift = ($mState - 1) * 6;
$tmp = $in;
$tmp = ($tmp & 0x0000003F) << $shift;
$mUcs4 |= $tmp;
// End of the multi-octet sequence. mUcs4 now contains the final Unicode codepoint to be output
if (0 == --$mState)
{
// Check for illegal sequences and codepoints
// End of the multi-octet sequence. mUcs4 now contains the final Unicode codepoint to be output
if (0 == --$mState) {
// Check for illegal sequences and codepoints
// From Unicode 3.1, non-shortest form is illegal
if (((2 == $mBytes) AND ($mUcs4 < 0x0080)) OR
((3 == $mBytes) AND ($mUcs4 < 0x0800)) OR
((4 == $mBytes) AND ($mUcs4 < 0x10000)) OR
(4 < $mBytes) OR
// From Unicode 3.2, surrogate characters are illegal
(($mUcs4 & 0xFFFFF800) == 0xD800) OR
// Codepoints outside the Unicode range are illegal
($mUcs4 > 0x10FFFF))
{
trigger_error('utf8::to_unicode: Illegal sequence or codepoint in UTF-8 at byte '.$i, E_USER_WARNING);
return FALSE;
}
// From Unicode 3.1, non-shortest form is illegal
if (
((2 == $mBytes) and ($mUcs4 < 0x0080)) or
((3 == $mBytes) and ($mUcs4 < 0x0800)) or
((4 == $mBytes) and ($mUcs4 < 0x10000)) or
(4 < $mBytes) or
// From Unicode 3.2, surrogate characters are illegal
(($mUcs4 & 0xFFFFF800) == 0xD800) or
// Codepoints outside the Unicode range are illegal
($mUcs4 > 0x10FFFF)
) {
trigger_error('utf8::to_unicode: Illegal sequence or codepoint in UTF-8 at byte ' . $i, E_USER_WARNING);
return false;
}
if (0xFEFF != $mUcs4)
{
// BOM is legal but we don't want to output it
$out[] = $mUcs4;
}
if (0xFEFF != $mUcs4) {
// BOM is legal but we don't want to output it
$out[] = $mUcs4;
}
// Initialize UTF-8 cache
$mState = 0;
$mUcs4 = 0;
$mBytes = 1;
}
}
else
{
// ((0xC0 & (*in) != 0x80) AND (mState != 0))
// Incomplete multi-octet sequence
trigger_error('utf8::to_unicode: Incomplete multi-octet sequence in UTF-8 at byte '.$i, E_USER_WARNING);
return FALSE;
}
}
}
// Initialize UTF-8 cache
$mState = 0;
$mUcs4 = 0;
$mBytes = 1;
}
} else {
// ((0xC0 & (*in) != 0x80) AND (mState != 0))
// Incomplete multi-octet sequence
trigger_error('utf8::to_unicode: Incomplete multi-octet sequence in UTF-8 at byte ' . $i, E_USER_WARNING);
return false;
}
}
}
return $out;
}
return $out;
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::transliterate_to_ascii
*
@@ -10,68 +14,64 @@
*/
function _transliterate_to_ascii($str, $case = 0)
{
static $UTF8_LOWER_ACCENTS = NULL;
static $UTF8_UPPER_ACCENTS = NULL;
static $UTF8_LOWER_ACCENTS = null;
static $UTF8_UPPER_ACCENTS = null;
if ($case <= 0)
{
if ($UTF8_LOWER_ACCENTS === NULL)
{
$UTF8_LOWER_ACCENTS = array(
'à' => 'a', 'ô' => 'o', 'ď' => 'd', '' => 'f', 'ë' => 'e', 'š' => 's', 'ơ' => 'o',
'ß' => 'ss', 'ă' => 'a', 'ř' => 'r', 'ț' => 't', 'ň' => 'n', 'ā' => 'a', 'ķ' => 'k',
'ŝ' => 's', '' => 'y', 'ņ' => 'n', 'ĺ' => 'l', 'ħ' => 'h', '' => 'p', 'ó' => 'o',
'ú' => 'u', 'ě' => 'e', 'é' => 'e', 'ç' => 'c', '' => 'w', 'ċ' => 'c', 'õ' => 'o',
'' => 's', 'ø' => 'o', 'ģ' => 'g', 'ŧ' => 't', 'ș' => 's', 'ė' => 'e', 'ĉ' => 'c',
'ś' => 's', 'î' => 'i', 'ű' => 'u', 'ć' => 'c', 'ę' => 'e', 'ŵ' => 'w', '' => 't',
'ū' => 'u', 'č' => 'c', 'ö' => 'o', 'è' => 'e', 'ŷ' => 'y', 'ą' => 'a', 'ł' => 'l',
'ų' => 'u', 'ů' => 'u', 'ş' => 's', 'ğ' => 'g', 'ļ' => 'l', 'ƒ' => 'f', 'ž' => 'z',
'' => 'w', '' => 'b', 'å' => 'a', 'ì' => 'i', 'ï' => 'i', '' => 'd', 'ť' => 't',
'ŗ' => 'r', 'ä' => 'a', 'í' => 'i', 'ŕ' => 'r', 'ê' => 'e', 'ü' => 'u', 'ò' => 'o',
'ē' => 'e', 'ñ' => 'n', 'ń' => 'n', 'ĥ' => 'h', 'ĝ' => 'g', 'đ' => 'd', 'ĵ' => 'j',
'ÿ' => 'y', 'ũ' => 'u', 'ŭ' => 'u', 'ư' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o',
'â' => 'a', 'ľ' => 'l', '' => 'w', 'ż' => 'z', 'ī' => 'i', 'ã' => 'a', 'ġ' => 'g',
'ṁ' => 'm', 'ō' => 'o', 'ĩ' => 'i', 'ù' => 'u', 'į' => 'i', 'ź' => 'z', 'á' => 'a',
'û' => 'u', 'þ' => 'th', 'ð' => 'dh', 'æ' => 'ae', 'µ' => 'u', 'ĕ' => 'e',
);
}
if ($case <= 0) {
if ($UTF8_LOWER_ACCENTS === null) {
$UTF8_LOWER_ACCENTS = array(
'à' => 'a', 'ô' => 'o', 'ď' => 'd', 'ḟ' => 'f', 'ë' => 'e', 'š' => 's', 'ơ' => 'o',
'ß' => 'ss', 'ă' => 'a', 'ř' => 'r', 'ț' => 't', 'ň' => 'n', 'ā' => 'a', 'ķ' => 'k',
'ŝ' => 's', '' => 'y', 'ņ' => 'n', 'ĺ' => 'l', 'ħ' => 'h', '' => 'p', 'ó' => 'o',
'ú' => 'u', 'ě' => 'e', 'é' => 'e', 'ç' => 'c', '' => 'w', 'ċ' => 'c', 'õ' => 'o',
'' => 's', 'ø' => 'o', 'ģ' => 'g', 'ŧ' => 't', 'ș' => 's', 'ė' => 'e', 'ĉ' => 'c',
'ś' => 's', 'î' => 'i', 'ű' => 'u', 'ć' => 'c', 'ę' => 'e', 'ŵ' => 'w', '' => 't',
'ū' => 'u', 'č' => 'c', 'ö' => 'o', 'è' => 'e', 'ŷ' => 'y', 'ą' => 'a', 'ł' => 'l',
'ų' => 'u', 'ů' => 'u', 'ş' => 's', 'ğ' => 'g', 'ļ' => 'l', 'ƒ' => 'f', 'ž' => 'z',
'' => 'w', '' => 'b', 'å' => 'a', 'ì' => 'i', 'ï' => 'i', '' => 'd', 'ť' => 't',
'ŗ' => 'r', 'ä' => 'a', 'í' => 'i', 'ŕ' => 'r', 'ê' => 'e', 'ü' => 'u', 'ò' => 'o',
'ē' => 'e', 'ñ' => 'n', 'ń' => 'n', 'ĥ' => 'h', 'ĝ' => 'g', 'đ' => 'd', 'ĵ' => 'j',
'ÿ' => 'y', 'ũ' => 'u', 'ŭ' => 'u', 'ư' => 'u', 'ţ' => 't', 'ý' => 'y', 'ő' => 'o',
'â' => 'a', 'ľ' => 'l', '' => 'w', 'ż' => 'z', 'ī' => 'i', 'ã' => 'a', 'ġ' => 'g',
'' => 'm', 'ō' => 'o', 'ĩ' => 'i', 'ù' => 'u', 'į' => 'i', 'ź' => 'z', 'á' => 'a',
'û' => 'u', 'þ' => 'th', 'ð' => 'dh', 'æ' => 'ae', 'µ' => 'u', 'ĕ' => 'e',
);
}
$str = str_replace(
array_keys($UTF8_LOWER_ACCENTS),
array_values($UTF8_LOWER_ACCENTS),
$str
);
}
$str = str_replace(
array_keys($UTF8_LOWER_ACCENTS),
array_values($UTF8_LOWER_ACCENTS),
$str
);
}
if ($case >= 0)
{
if ($UTF8_UPPER_ACCENTS === NULL)
{
$UTF8_UPPER_ACCENTS = array(
'À' => 'A', 'Ô' => 'O', 'Ď' => 'D', '' => 'F', 'Ë' => 'E', 'Š' => 'S', 'Ơ' => 'O',
'Ă' => 'A', 'Ř' => 'R', 'Ț' => 'T', 'Ň' => 'N', 'Ā' => 'A', 'Ķ' => 'K', 'Ĕ' => 'E',
'Ŝ' => 'S', '' => 'Y', 'Ņ' => 'N', 'Ĺ' => 'L', 'Ħ' => 'H', '' => 'P', 'Ó' => 'O',
'Ú' => 'U', 'Ě' => 'E', 'É' => 'E', 'Ç' => 'C', '' => 'W', 'Ċ' => 'C', 'Õ' => 'O',
'' => 'S', 'Ø' => 'O', 'Ģ' => 'G', 'Ŧ' => 'T', 'Ș' => 'S', 'Ė' => 'E', 'Ĉ' => 'C',
'Ś' => 'S', 'Î' => 'I', 'Ű' => 'U', 'Ć' => 'C', 'Ę' => 'E', 'Ŵ' => 'W', '' => 'T',
'Ū' => 'U', 'Č' => 'C', 'Ö' => 'O', 'È' => 'E', 'Ŷ' => 'Y', 'Ą' => 'A', 'Ł' => 'L',
'Ų' => 'U', 'Ů' => 'U', 'Ş' => 'S', 'Ğ' => 'G', 'Ļ' => 'L', 'Ƒ' => 'F', 'Ž' => 'Z',
'' => 'W', '' => 'B', 'Å' => 'A', 'Ì' => 'I', 'Ï' => 'I', '' => 'D', 'Ť' => 'T',
'Ŗ' => 'R', 'Ä' => 'A', 'Í' => 'I', 'Ŕ' => 'R', 'Ê' => 'E', 'Ü' => 'U', 'Ò' => 'O',
'Ē' => 'E', 'Ñ' => 'N', 'Ń' => 'N', 'Ĥ' => 'H', 'Ĝ' => 'G', 'Đ' => 'D', 'Ĵ' => 'J',
'Ÿ' => 'Y', 'Ũ' => 'U', 'Ŭ' => 'U', 'Ư' => 'U', 'Ţ' => 'T', 'Ý' => 'Y', 'Ő' => 'O',
'Â' => 'A', 'Ľ' => 'L', 'Ẅ' => 'W', 'Ż' => 'Z', 'Ī' => 'I', 'Ã' => 'A', 'Ġ' => 'G',
'Ṁ' => 'M', 'Ō' => 'O', 'Ĩ' => 'I', 'Ù' => 'U', 'Į' => 'I', 'Ź' => 'Z', 'Á' => 'A',
'Û' => 'U', 'Þ' => 'Th', 'Ð' => 'Dh', 'Æ' => 'Ae',
);
}
if ($case >= 0) {
if ($UTF8_UPPER_ACCENTS === null) {
$UTF8_UPPER_ACCENTS = array(
'À' => 'A', 'Ô' => 'O', 'Ď' => 'D', 'Ḟ' => 'F', 'Ë' => 'E', 'Š' => 'S', 'Ơ' => 'O',
'Ă' => 'A', 'Ř' => 'R', 'Ț' => 'T', 'Ň' => 'N', 'Ā' => 'A', 'Ķ' => 'K', 'Ĕ' => 'E',
'Ŝ' => 'S', '' => 'Y', 'Ņ' => 'N', 'Ĺ' => 'L', 'Ħ' => 'H', '' => 'P', 'Ó' => 'O',
'Ú' => 'U', 'Ě' => 'E', 'É' => 'E', 'Ç' => 'C', '' => 'W', 'Ċ' => 'C', 'Õ' => 'O',
'' => 'S', 'Ø' => 'O', 'Ģ' => 'G', 'Ŧ' => 'T', 'Ș' => 'S', 'Ė' => 'E', 'Ĉ' => 'C',
'Ś' => 'S', 'Î' => 'I', 'Ű' => 'U', 'Ć' => 'C', 'Ę' => 'E', 'Ŵ' => 'W', '' => 'T',
'Ū' => 'U', 'Č' => 'C', 'Ö' => 'O', 'È' => 'E', 'Ŷ' => 'Y', 'Ą' => 'A', 'Ł' => 'L',
'Ų' => 'U', 'Ů' => 'U', 'Ş' => 'S', 'Ğ' => 'G', 'Ļ' => 'L', 'Ƒ' => 'F', 'Ž' => 'Z',
'' => 'W', '' => 'B', 'Å' => 'A', 'Ì' => 'I', 'Ï' => 'I', '' => 'D', 'Ť' => 'T',
'Ŗ' => 'R', 'Ä' => 'A', 'Í' => 'I', 'Ŕ' => 'R', 'Ê' => 'E', 'Ü' => 'U', 'Ò' => 'O',
'Ē' => 'E', 'Ñ' => 'N', 'Ń' => 'N', 'Ĥ' => 'H', 'Ĝ' => 'G', 'Đ' => 'D', 'Ĵ' => 'J',
'Ÿ' => 'Y', 'Ũ' => 'U', 'Ŭ' => 'U', 'Ư' => 'U', 'Ţ' => 'T', 'Ý' => 'Y', 'Ő' => 'O',
'Â' => 'A', 'Ľ' => 'L', '' => 'W', 'Ż' => 'Z', 'Ī' => 'I', 'Ã' => 'A', 'Ġ' => 'G',
'' => 'M', 'Ō' => 'O', 'Ĩ' => 'I', 'Ù' => 'U', 'Į' => 'I', 'Ź' => 'Z', 'Á' => 'A',
'Û' => 'U', 'Þ' => 'Th', 'Ð' => 'Dh', 'Æ' => 'Ae',
);
}
$str = str_replace(
array_keys($UTF8_UPPER_ACCENTS),
array_values($UTF8_UPPER_ACCENTS),
$str
);
}
$str = str_replace(
array_keys($UTF8_UPPER_ACCENTS),
array_values($UTF8_UPPER_ACCENTS),
$str
);
}
return $str;
}
return $str;
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::trim
*
@@ -8,10 +12,11 @@
* @copyright (c) 2005 Harry Fuecks
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
*/
function _trim($str, $charlist = NULL)
function _trim($str, $charlist = null)
{
if ($charlist === NULL)
return trim($str);
if ($charlist === null) {
return trim($str);
}
return utf8::ltrim(utf8::rtrim($str, $charlist), $charlist);
}
return utf8::ltrim(utf8::rtrim($str, $charlist), $charlist);
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::ucfirst
*
@@ -10,9 +14,10 @@
*/
function _ucfirst($str)
{
if (utf8::is_ascii($str))
return ucfirst($str);
if (utf8::is_ascii($str)) {
return ucfirst($str);
}
preg_match('/^(.?)(.*)$/us', $str, $matches);
return utf8::strtoupper($matches[1]).$matches[2];
}
preg_match('/^(.?)(.*)$/us', $str, $matches);
return utf8::strtoupper($matches[1]) . $matches[2];
}

View File

@@ -1,4 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
/**
* utf8::ucwords
*
@@ -10,17 +14,19 @@
*/
function _ucwords($str)
{
if (SERVER_UTF8)
return mb_convert_case($str, MB_CASE_TITLE);
if (SERVER_UTF8) {
return mb_convert_case($str, MB_CASE_TITLE);
}
if (utf8::is_ascii($str))
return ucwords($str);
if (utf8::is_ascii($str)) {
return ucwords($str);
}
// [\x0c\x09\x0b\x0a\x0d\x20] matches form feeds, horizontal tabs, vertical tabs, linefeeds and carriage returns.
// This corresponds to the definition of a 'word' defined at http://php.net/ucwords
return preg_replace(
'/(?<=^|[\x0c\x09\x0b\x0a\x0d\x20])[^\x0c\x09\x0b\x0a\x0d\x20]/ue',
'utf8::strtoupper(\'$0\')',
$str
);
}
// [\x0c\x09\x0b\x0a\x0d\x20] matches form feeds, horizontal tabs, vertical tabs, linefeeds and carriage returns.
// This corresponds to the definition of a 'word' defined at http://php.net/ucwords
return preg_replace(
'/(?<=^|[\x0c\x09\x0b\x0a\x0d\x20])[^\x0c\x09\x0b\x0a\x0d\x20]/ue',
'utf8::strtoupper(\'$0\')',
$str
);
}

View File

@@ -1,4 +1,12 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* Array helper class.
*
@@ -9,304 +17,272 @@
* @copyright (c) 2007-2008 Kohana Team
* @license http://kohanaphp.com/license.html
*/
class arr_Core {
class arr_Core
{
/**
* Return a callback array from a string, eg: limit[10,20] would become
* array('limit', array('10', '20'))
*
* @param string callback string
* @return array
*/
public static function callback_string($str)
{
// command[param,param]
if (preg_match('/([^\[]*+)\[(.+)\]/', (string) $str, $match)) {
// command
$command = $match[1];
/**
* Return a callback array from a string, eg: limit[10,20] would become
* array('limit', array('10', '20'))
*
* @param string callback string
* @return array
*/
public static function callback_string($str)
{
// command[param,param]
if (preg_match('/([^\[]*+)\[(.+)\]/', (string) $str, $match))
{
// command
$command = $match[1];
// param,param
$params = preg_split('/(?<!\\\\),/', $match[2]);
$params = str_replace('\,', ',', $params);
} else {
// command
$command = $str;
// param,param
$params = preg_split('/(?<!\\\\),/', $match[2]);
$params = str_replace('\,', ',', $params);
}
else
{
// command
$command = $str;
// No params
$params = null;
}
// No params
$params = NULL;
}
return array($command, $params);
}
return array($command, $params);
}
/**
* Rotates a 2D array clockwise.
* Example, turns a 2x3 array into a 3x2 array.
*
* @param array array to rotate
* @param boolean keep the keys in the final rotated array. the sub arrays of the source array need to have the same key values.
* if your subkeys might not match, you need to pass FALSE here!
* @return array
*/
public static function rotate($source_array, $keep_keys = true)
{
$new_array = array();
foreach ($source_array as $key => $value) {
$value = ($keep_keys === true) ? $value : array_values($value);
foreach ($value as $k => $v) {
$new_array[$k][$key] = $v;
}
}
/**
* Rotates a 2D array clockwise.
* Example, turns a 2x3 array into a 3x2 array.
*
* @param array array to rotate
* @param boolean keep the keys in the final rotated array. the sub arrays of the source array need to have the same key values.
* if your subkeys might not match, you need to pass FALSE here!
* @return array
*/
public static function rotate($source_array, $keep_keys = TRUE)
{
$new_array = array();
foreach ($source_array as $key => $value)
{
$value = ($keep_keys === TRUE) ? $value : array_values($value);
foreach ($value as $k => $v)
{
$new_array[$k][$key] = $v;
}
}
return $new_array;
}
return $new_array;
}
/**
* Removes a key from an array and returns the value.
*
* @param string key to return
* @param array array to work on
* @return mixed value of the requested array key
*/
public static function remove($key, &$array)
{
if (! array_key_exists($key, $array)) {
return null;
}
/**
* Removes a key from an array and returns the value.
*
* @param string key to return
* @param array array to work on
* @return mixed value of the requested array key
*/
public static function remove($key, & $array)
{
if ( ! array_key_exists($key, $array))
return NULL;
$val = $array[$key];
unset($array[$key]);
$val = $array[$key];
unset($array[$key]);
return $val;
}
return $val;
}
/**
* Extract one or more keys from an array. Each key given after the first
* argument (the array) will be extracted. Keys that do not exist in the
* search array will be NULL in the extracted data.
*
* @param array array to search
* @param string key name
* @return array
*/
public static function extract(array $search, $keys)
{
// Get the keys, removing the $search array
$keys = array_slice(func_get_args(), 1);
/**
* Extract one or more keys from an array. Each key given after the first
* argument (the array) will be extracted. Keys that do not exist in the
* search array will be NULL in the extracted data.
*
* @param array array to search
* @param string key name
* @return array
*/
public static function extract(array $search, $keys)
{
// Get the keys, removing the $search array
$keys = array_slice(func_get_args(), 1);
$found = array();
foreach ($keys as $key)
{
if (isset($search[$key]))
{
$found[$key] = $search[$key];
}
else
{
$found[$key] = NULL;
}
}
$found = array();
foreach ($keys as $key) {
if (isset($search[$key])) {
$found[$key] = $search[$key];
} else {
$found[$key] = null;
}
}
return $found;
}
return $found;
}
/**
* Because PHP does not have this function.
*
* @param array array to unshift
* @param string key to unshift
* @param mixed value to unshift
* @return array
*/
public static function unshift_assoc( array & $array, $key, $val)
{
$array = array_reverse($array, TRUE);
$array[$key] = $val;
$array = array_reverse($array, TRUE);
/**
* Because PHP does not have this function.
*
* @param array array to unshift
* @param string key to unshift
* @param mixed value to unshift
* @return array
*/
public static function unshift_assoc(array &$array, $key, $val)
{
$array = array_reverse($array, true);
$array[$key] = $val;
$array = array_reverse($array, true);
return $array;
}
return $array;
}
/**
* Because PHP does not have this function, and array_walk_recursive creates
* references in arrays and is not truly recursive.
*
* @param mixed callback to apply to each member of the array
* @param array array to map to
* @return array
*/
public static function map_recursive($callback, array $array)
{
foreach ($array as $key => $val)
{
// Map the callback to the key
$array[$key] = is_array($val) ? arr::map_recursive($callback, $val) : call_user_func($callback, $val);
}
/**
* Because PHP does not have this function, and array_walk_recursive creates
* references in arrays and is not truly recursive.
*
* @param mixed callback to apply to each member of the array
* @param array array to map to
* @return array
*/
public static function map_recursive($callback, array $array)
{
foreach ($array as $key => $val) {
// Map the callback to the key
$array[$key] = is_array($val) ? arr::map_recursive($callback, $val) : call_user_func($callback, $val);
}
return $array;
}
return $array;
}
/**
* @param mixed $needle the value to search for
* @param array $haystack an array of values to search in
* @param boolean $sort sort the array now
* @return integer|FALSE the index of the match or FALSE when not found
*/
public static function binary_search($needle, $haystack, $sort = FALSE)
{
if ($sort)
{
sort($haystack);
}
/**
* @param mixed $needle the value to search for
* @param array $haystack an array of values to search in
* @param boolean $sort sort the array now
* @return integer|FALSE the index of the match or FALSE when not found
*/
public static function binary_search($needle, $haystack, $sort = false)
{
if ($sort) {
sort($haystack);
}
$high = count($haystack) - 1;
$low = 0;
$high = count($haystack) - 1;
$low = 0;
while ($low <= $high)
{
$mid = ($low + $high) >> 1;
while ($low <= $high) {
$mid = ($low + $high) >> 1;
if ($haystack[$mid] < $needle)
{
$low = $mid + 1;
}
elseif ($haystack[$mid] > $needle)
{
$high = $mid - 1;
}
else
{
return $mid;
}
}
if ($haystack[$mid] < $needle) {
$low = $mid + 1;
} elseif ($haystack[$mid] > $needle) {
$high = $mid - 1;
} else {
return $mid;
}
}
return FALSE;
}
return false;
}
/**
* Emulates array_merge_recursive, but appends numeric keys and replaces
* associative keys, instead of appending all keys.
*
* @param array any number of arrays
* @return array
*/
public static function merge()
{
$total = func_num_args();
/**
* Emulates array_merge_recursive, but appends numeric keys and replaces
* associative keys, instead of appending all keys.
*
* @param array any number of arrays
* @return array
*/
public static function merge()
{
$total = func_num_args();
$result = array();
for ($i = 0; $i < $total; $i++)
{
foreach (func_get_arg($i) as $key => $val)
{
if (isset($result[$key]))
{
if (is_array($val))
{
// Arrays are merged recursively
$result[$key] = arr::merge($result[$key], $val);
}
elseif (is_int($key))
{
// Indexed arrays are appended
array_push($result, $val);
}
else
{
// Associative arrays are replaced
$result[$key] = $val;
}
}
else
{
// New values are added
$result[$key] = $val;
}
}
}
$result = array();
for ($i = 0; $i < $total; $i++) {
foreach (func_get_arg($i) as $key => $val) {
if (isset($result[$key])) {
if (is_array($val)) {
// Arrays are merged recursively
$result[$key] = arr::merge($result[$key], $val);
} elseif (is_int($key)) {
// Indexed arrays are appended
array_push($result, $val);
} else {
// Associative arrays are replaced
$result[$key] = $val;
}
} else {
// New values are added
$result[$key] = $val;
}
}
}
return $result;
}
return $result;
}
/**
* Overwrites an array with values from input array(s).
* Non-existing keys will not be appended!
*
* @param array key array
* @param array input array(s) that will overwrite key array values
* @return array
*/
public static function overwrite($array1, $array2)
{
foreach (array_intersect_key($array2, $array1) as $key => $value)
{
$array1[$key] = $value;
}
/**
* Overwrites an array with values from input array(s).
* Non-existing keys will not be appended!
*
* @param array key array
* @param array input array(s) that will overwrite key array values
* @return array
*/
public static function overwrite($array1, $array2)
{
foreach (array_intersect_key($array2, $array1) as $key => $value) {
$array1[$key] = $value;
}
if (func_num_args() > 2)
{
foreach (array_slice(func_get_args(), 2) as $array2)
{
foreach (array_intersect_key($array2, $array1) as $key => $value)
{
$array1[$key] = $value;
}
}
}
if (func_num_args() > 2) {
foreach (array_slice(func_get_args(), 2) as $array2) {
foreach (array_intersect_key($array2, $array1) as $key => $value) {
$array1[$key] = $value;
}
}
}
return $array1;
}
return $array1;
}
/**
* Fill an array with a range of numbers.
*
* @param integer stepping
* @param integer ending number
* @return array
*/
public static function range($step = 10, $max = 100)
{
if ($step < 1)
return array();
/**
* Fill an array with a range of numbers.
*
* @param integer stepping
* @param integer ending number
* @return array
*/
public static function range($step = 10, $max = 100)
{
if ($step < 1) {
return array();
}
$array = array();
for ($i = $step; $i <= $max; $i += $step)
{
$array[$i] = $i;
}
$array = array();
for ($i = $step; $i <= $max; $i += $step) {
$array[$i] = $i;
}
return $array;
}
return $array;
}
/**
* Recursively convert an array to an object.
*
* @param array array to convert
* @return object
*/
public static function to_object(array $array, $class = 'stdClass')
{
$object = new $class;
/**
* Recursively convert an array to an object.
*
* @param array array to convert
* @return object
*/
public static function to_object(array $array, $class = 'stdClass')
{
$object = new $class();
foreach ($array as $key => $value)
{
if (is_array($value))
{
// Convert the array to an object
$value = arr::to_object($value, $class);
}
foreach ($array as $key => $value) {
if (is_array($value)) {
// Convert the array to an object
$value = arr::to_object($value, $class);
}
// Add the value to the object
$object->{$key} = $value;
}
// Add the value to the object
$object->{$key} = $value;
}
return $object;
}
} // End arr
return $object;
}
}
// End arr

View File

@@ -1,4 +1,11 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
<?php
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
// phpcs:disable PSR1.Files.SideEffects
defined('SYSPATH') or die('No direct access allowed.');
// phpcs:enable PSR1.Files.SideEffects
// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* Cookie helper class.
*
@@ -9,76 +16,76 @@
* @copyright (c) 2007-2008 Kohana Team
* @license http://kohanaphp.com/license.html
*/
class cookie_Core {
class cookie_Core
{
/**
* Sets a cookie with the given parameters.
*
* @param string cookie name or array of config options
* @param string cookie value
* @param integer number of seconds before the cookie expires
* @param string URL path to allow
* @param string URL domain to allow
* @param boolean HTTPS only
* @param boolean HTTP only (requires PHP 5.2 or higher)
* @return boolean
*/
public static function set($name, $value = null, $expire = null, $path = null, $domain = null, $secure = null, $httponly = null)
{
if (headers_sent()) {
return false;
}
/**
* Sets a cookie with the given parameters.
*
* @param string cookie name or array of config options
* @param string cookie value
* @param integer number of seconds before the cookie expires
* @param string URL path to allow
* @param string URL domain to allow
* @param boolean HTTPS only
* @param boolean HTTP only (requires PHP 5.2 or higher)
* @return boolean
*/
public static function set($name, $value = NULL, $expire = NULL, $path = NULL, $domain = NULL, $secure = NULL, $httponly = NULL)
{
if (headers_sent())
return FALSE;
// If the name param is an array, we import it
is_array($name) and extract($name, EXTR_OVERWRITE);
// If the name param is an array, we import it
is_array($name) and extract($name, EXTR_OVERWRITE);
// Fetch default options
$config = Kohana::config('cookie');
// Fetch default options
$config = Kohana::config('cookie');
foreach (array('value', 'expire', 'domain', 'path', 'secure', 'httponly') as $item) {
if ($$item === null and isset($config[$item])) {
$$item = $config[$item];
}
}
foreach (array('value', 'expire', 'domain', 'path', 'secure', 'httponly') as $item)
{
if ($$item === NULL AND isset($config[$item]))
{
$$item = $config[$item];
}
}
// Expiration timestamp
$expire = ($expire == 0) ? 0 : time() + (int) $expire;
// Expiration timestamp
$expire = ($expire == 0) ? 0 : time() + (int) $expire;
return setcookie($name, $value, $expire, $path, $domain, $secure);
}
return setcookie($name, $value, $expire, $path, $domain, $secure);
}
/**
* Fetch a cookie value, using the Input library.
*
* @param string cookie name
* @param mixed default value
* @param boolean use XSS cleaning on the value
* @return string
*/
public static function get($name, $default = null, $xss_clean = false)
{
return Input::instance()->cookie($name, $default, $xss_clean);
}
/**
* Fetch a cookie value, using the Input library.
*
* @param string cookie name
* @param mixed default value
* @param boolean use XSS cleaning on the value
* @return string
*/
public static function get($name, $default = NULL, $xss_clean = FALSE)
{
return Input::instance()->cookie($name, $default, $xss_clean);
}
/**
* Nullify and unset a cookie.
*
* @param string cookie name
* @param string URL path
* @param string URL domain
* @return boolean
*/
public static function delete($name, $path = null, $domain = null)
{
if (! isset($_COOKIE[$name])) {
return false;
}
/**
* Nullify and unset a cookie.
*
* @param string cookie name
* @param string URL path
* @param string URL domain
* @return boolean
*/
public static function delete($name, $path = NULL, $domain = NULL)
{
if ( ! isset($_COOKIE[$name]))
return FALSE;
// Delete the cookie from globals
unset($_COOKIE[$name]);
// Delete the cookie from globals
unset($_COOKIE[$name]);
// Sets the cookie value to an empty string, and the expiration to 24 hours ago
return cookie::set($name, '', -86400, $path, $domain, FALSE, FALSE);
}
} // End cookie
// Sets the cookie value to an empty string, and the expiration to 24 hours ago
return cookie::set($name, '', -86400, $path, $domain, false, false);
}
}
// End cookie

Some files were not shown because too many files have changed in this diff Show More