mirror of
https://github.com/Yubico/yubikey-val.git
synced 2025-03-03 18:29:18 +01:00
Refactor include paths.
- use PATH_SEPARATOR everywhere, instead of a mix of PATH_SEPARATOR and hard coded colons. - always include /usr/share/yubikey-val first, then /etc/yubico/val. - should not have any visible affects, since no file names are common between the two directories. - use array+implode to make it easier to add/remove paths, and to avoid hardcoded the path separator.
This commit is contained in:
parent
9aa740d299
commit
2272f33659
@ -44,8 +44,11 @@ if (isset($argv[1])) {
|
|||||||
$verbose = $argv[1] == "-v";
|
$verbose = $argv[1] == "-v";
|
||||||
}
|
}
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR .
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
"/usr/share/yubikey-val:/etc/yubico/val");
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-db.php';
|
require_once 'ykval-db.php';
|
||||||
|
@ -44,8 +44,11 @@ if (isset($argv[1])) {
|
|||||||
$verbose = $argv[1] == "-v";
|
$verbose = $argv[1] == "-v";
|
||||||
}
|
}
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR .
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
"/usr/share/yubikey-val:/etc/yubico/val");
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-db.php';
|
require_once 'ykval-db.php';
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/yubikey-val:/etc/yubico/val");
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-db.php';
|
require_once 'ykval-db.php';
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/yubikey-val:/etc/yubico/val");
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-db.php';
|
require_once 'ykval-db.php';
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/yubikey-val:/etc/yubico/val");
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
$options = getopt("h", array("help", "email::", "notes::", "otp::", "urandom"));
|
$options = getopt("h", array("help", "email::", "notes::", "otp::", "urandom"));
|
||||||
|
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/yubikey-val:/etc/yubico/val");
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-db.php';
|
require_once 'ykval-db.php';
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/yubikey-val:/etc/yubico/val");
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-db.php';
|
require_once 'ykval-db.php';
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/etc/yubico/val:/usr/share/yubikey-val");
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-common.php';
|
require_once 'ykval-common.php';
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/etc/yubico/val:/usr/share/yubikey-val");
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-db.php';
|
require_once 'ykval-db.php';
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/etc/yubico/val:/usr/share/yubikey-val");
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-common.php';
|
require_once 'ykval-common.php';
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/etc/yubico/val:/usr/share/yubikey-val");
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
require_once 'ykval-db.php';
|
require_once 'ykval-db.php';
|
||||||
|
@ -28,8 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR .
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
"/etc/yubico/val:/usr/share/yubikey-val");
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-synclib.php';
|
require_once 'ykval-synclib.php';
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
|
@ -28,7 +28,11 @@
|
|||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
set_include_path(get_include_path() . PATH_SEPARATOR . "/usr/share/yubikey-val:/etc/yubico/val");
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
'/usr/share/yubikey-val',
|
||||||
|
'/etc/yubico/val',
|
||||||
|
)));
|
||||||
|
|
||||||
require_once 'ykval-synclib.php';
|
require_once 'ykval-synclib.php';
|
||||||
require_once 'ykval-config.php';
|
require_once 'ykval-config.php';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user