]> git.andy128k.dev Git - ipf.git/commitdiff
cleanup
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 22 Jun 2013 13:10:56 +0000 (16:10 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 22 Jun 2013 13:10:56 +0000 (16:10 +0300)
ipf/admin/views.php
ipf/application.php
ipf/enum.php [deleted file]

index e206c6e6664895af26f62049f39cfec4d5f0a946..15f1f50b7ed44808419c51e89d4f8aa4b564229f 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
-function IPF_Admin_Views_Index($request, $match){
+function IPF_Admin_Views_Index($request, $match)
+{
     $ca = IPF_Admin_App::checkAdminAuth($request);
     if ($ca!==true) return $ca;
 
index f07c273907172c5808990a90e00d074cb50113ea..b70bc724b2e5cb7d4083d30d5dda83f995c4abe7 100644 (file)
@@ -10,7 +10,7 @@ abstract class IPF_Application
         $this->name = str_replace('_App', '', get_class($this));
 
         if (strpos($this->name,'IPF_')===0)
-            $this->path = IPF::get('ipf_path').DIRECTORY_SEPARATOR.'ipf'.DIRECTORY_SEPARATOR.strtolower(str_replace('_',DIRECTORY_SEPARATOR,str_replace('IPF_','',$this->name)));
+            $this->path = IPF::get('ipf_path').DIRECTORY_SEPARATOR.strtolower(str_replace('_',DIRECTORY_SEPARATOR,$this->name));
         else
             $this->path = IPF::get('project_path').DIRECTORY_SEPARATOR.strtolower(str_replace('_',DIRECTORY_SEPARATOR,$this->name));
         $this->path .= DIRECTORY_SEPARATOR;
diff --git a/ipf/enum.php b/ipf/enum.php
deleted file mode 100644 (file)
index 2c3f63b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-/*
-Usage:
-
-class Enum_Colors extends IPF_Enum {
-    const RED = 'F00';
-    const GREEN = '0F0';
-    const BLUE = '00F';
-}
-
-function setColor( Enum_Colors $color ) {
-    echo $color;
-}
-setColor( new Enum_Colors( 'GREEN' ) ); // will pass
-setColor( '0F0' ); // won't pass
-Enum_Colors::RED == new Enum_Colors( 'GREEN' ); // FALSE
-Enum_Colors::RED == new Enum_Colors( 'RED' ); // TRUE
-
-*/
-
-abstract class IPF_Enum {
-    private $current_val;
-
-    final public function __construct( $type ) {
-        $class_name = get_class( $this );
-
-        $type = strtoupper( $type );
-        if ( ! constant( "{$class_name}::{$type}" ) ) {
-            throw new IPF_Exception_Enum( 'Not forund property "'.$type.'" in enum "'.$class_name.'"' );
-        }
-        $this->current_val = constant( "{$class_name}::{$type}" );
-    }
-
-    final public function __toString() {
-        return $this->current_val;
-    }
-}