| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | -* | |
| 3 | +* | |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | // Disallow direct access. |
| 7 | 7 | defined('ABSPATH') or die("Access denied"); |
| @@ -6,15 +6,15 @@ | ||
| 6 | 6 | // Disallow direct access. |
| 7 | 7 | defined('ABSPATH') or die("Access denied"); |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | -* | |
| 10 | +* | |
| 11 | 11 | */ |
| 12 | 12 | class CJTInstaller extends CJTHookableClass { |
| 13 | - | |
| 13 | + | |
| 14 | 14 | /** |
| 15 | 15 | * put your comment there... |
| 16 | - * | |
| 16 | + * | |
| 17 | 17 | */ |
| 18 | 18 | public function builtinAuthors() { |
| 19 | 19 | // Dependencies! |
| 20 | 20 | cssJSToolbox::import('framework:db:mysql:xtable.inc.php'); |
| @@ -24,9 +24,9 @@ | ||
| 24 | 24 | ->load(); |
| 25 | 25 | // Make sure built-in (attributes = 1) Wordpress author (id = 1) is there! |
| 26 | 26 | if (!$wpAuthor->get('id') || ($wpAuthor->get('attributes') != 1)) { |
| 27 | 27 | $wpAuthor->setData(array( |
| 28 | - 'id' => CJTAuthorTable::WORDPRESS_AUTHOR_ID, | |
| 28 | + 'id' => CJTAuthorTable::WORDPRESS_AUTHOR_ID, | |
| 29 | 29 | 'name' => 'Wordpress', |
| 30 | 30 | 'attributes' => CJTAuthorTable::FLAG_SYS_AUTHOR) |
| 31 | 31 | )->save(true); |
| 32 | 32 | } |
| @@ -31,12 +31,12 @@ | ||
| 31 | 31 | )->save(true); |
| 32 | 32 | } |
| 33 | 33 | return $this; |
| 34 | 34 | } |
| 35 | - | |
| 35 | + | |
| 36 | 36 | /** |
| 37 | 37 | * put your comment there... |
| 38 | - * | |
| 38 | + * | |
| 39 | 39 | */ |
| 40 | 40 | public function database() { |
| 41 | 41 | // Install Database structure! |
| 42 | 42 | cssJSToolbox::import('framework:installer:dbfile.class.php'); |
| @@ -42,16 +42,16 @@ | ||
| 42 | 42 | cssJSToolbox::import('framework:installer:dbfile.class.php'); |
| 43 | 43 | CJTDBFileInstaller::getInstance(cssJSToolbox::resolvePath('includes:installer:installer:db:mysql:structure.sql'))->exec(); |
| 44 | 44 | return $this; |
| 45 | 45 | } |
| 46 | - | |
| 46 | + | |
| 47 | 47 | /** |
| 48 | 48 | * put your comment there... |
| 49 | - * | |
| 49 | + * | |
| 50 | 50 | */ |
| 51 | 51 | public function fileSystem() { |
| 52 | 52 | // Initializing! |
| 53 | - $wpContentDir = end( explode( DIRECTORY_SEPARATOR, dirname( dirname( plugin_dir_path( CJTOOLBOX_PLUGIN_FILE ) ) ) ) ); | |
| 53 | + $wpContentDir = 'wp-content'; | |
| 54 | 54 | $fSConfig = cssJSToolbox::$config->fileSystem; |
| 55 | 55 | // Directories to create! |
| 56 | 56 | $directories = array( |
| 57 | 57 | "{$wpContentDir}/{$fSConfig->contentDir}", |
| @@ -70,39 +70,35 @@ | ||
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | return $this; |
| 73 | 73 | } |
| 74 | - | |
| 74 | + | |
| 75 | 75 | /** |
| 76 | 76 | * put your comment there... |
| 77 | - * | |
| 77 | + * | |
| 78 | 78 | */ |
| 79 | 79 | public function finalize() { |
| 80 | 80 | // Update version number. |
| 81 | - if ( $this->crossCheckInstall() ) { | |
| 82 | - update_option(CJTPlugin::DB_VERSION_OPTION_NAME, CJTPlugin::DB_VERSION); | |
| 83 | - return false; | |
| 84 | - } | |
| 85 | - | |
| 81 | + update_option(CJTPlugin::DB_VERSION_OPTION_NAME, CJTPlugin::DB_VERSION); | |
| 86 | 82 | return $this; |
| 87 | 83 | } |
| 88 | - | |
| 84 | + | |
| 89 | 85 | /** |
| 90 | 86 | * put your comment there... |
| 91 | - * | |
| 87 | + * | |
| 92 | 88 | */ |
| 93 | 89 | public static function getInstance() { |
| 94 | 90 | return new CJTInstaller(); |
| 95 | 91 | } |
| 96 | - | |
| 92 | + | |
| 97 | 93 | /** |
| 98 | 94 | * put your comment there... |
| 99 | - * | |
| 95 | + * | |
| 100 | 96 | */ |
| 101 | 97 | public function wordpressTemplates() { |
| 102 | 98 | // Dependencies! |
| 103 | 99 | cssJSToolbox::import( |
| 104 | - 'framework:db:mysql:xtable.inc.php', | |
| 100 | + 'framework:db:mysql:xtable.inc.php', | |
| 105 | 101 | 'includes:installer:installer::includes:templates:wordpress-queue.inc.php' |
| 106 | 102 | ); |
| 107 | 103 | // Install Wordpress build-in templates (scripts shipped out with Wordpress installation)! |
| 108 | 104 | foreach (array('javascript', 'css') as $type) { |
| @@ -112,14 +108,7 @@ | ||
| 112 | 108 | $wpTemplates->install(); |
| 113 | 109 | } |
| 114 | 110 | } |
| 115 | 111 | return $this; |
| 116 | - } | |
| 117 | - | |
| 118 | - public function crossCheckInstall() | |
| 119 | - { | |
| 120 | - CJTDBFileInstaller::getInstance(cssJsToolbox::resolvePath('includes:installer:installer:db:mysql:checker.sql'))->exec(); | |
| 121 | - | |
| 122 | - return true; | |
| 123 | 112 | } |
| 124 | 113 | |
| 125 | 114 | } // End class. |