src/Generator/Analyzer/Steps/CheckTables.php
protected function detectSlugStructure()
    {
        $this->context->slugStructurePresent = false;

        $slugsTable = config('pxlcms.slugs.table');

        if ( ! in_array($slugsTable, $this->tables)) {

            $this->context->log("No slugs table detected.");
            return;
        }

        // the table exists.. does it have the content we need / expect?
        // Note: cannot escape/PDO this, so be careful with your config
        $columns = $this->loadColumnListForTable($slugsTable);

        foreach ([
                     config('pxlcms.slugs.keys.module'),
                     config('pxlcms.slugs.keys.entry'),
                     config('pxlcms.slugs.keys.language'),
                 ] as $requiredColumn
        ) {
            if (in_array($requiredColumn, $columns)) continue;

            // column does not exist!
            $this->context->log(
                "Slugs table detected but not usable for Sluggable handling!"
                . " Missing required column '{$requiredColumn}'.",
                Generator::LOG_LEVEL_WARNING
            );
            return;
        }

        $this->context->slugStructurePresent = true;
        $this->context->log("Slugs table detected and considered usable for Sluggable handling.");
    }
protected function detectSlugStructure()
    {
        $this->context->slugStructurePresent = false;

        $slugsTable = config('pxlcms.slugs.table');

        if ( ! in_array($slugsTable, $this->tables)) {

            $this->context->log("No slugs table detected.");
            return;
        }

        // the table exists.. does it have the content we need / expect?
        // Note: cannot escape/PDO this, so be careful with your config
        $columns = $this->loadColumnListForTable($slugsTable);

        foreach ([
                     config('pxlcms.slugs.keys.module'),
                     config('pxlcms.slugs.keys.entry'),
                     config('pxlcms.slugs.keys.language'),
                 ] as $requiredColumn
        ) {
            if (in_array($requiredColumn, $columns)) continue;

            // column does not exist!
            $this->context->log(
                "Slugs table detected but not usable for Sluggable handling!"
                . " Missing required column '{$requiredColumn}'.",
                Generator::LOG_LEVEL_WARNING
            );
            return;
        }

        $this->context->slugStructurePresent = true;
        $this->context->log("Slugs table detected and considered usable for Sluggable handling.");
    }
protected function detectSlugStructure ( ) { $ this -> context -> slugStructurePresent = false ; $ slugsTable = config ( 'pxlcms.slugs.table' ) ; if ( ! in_array ( $ slugsTable , $ this -> tables ) ) { $ this -> context -> log ( "No slugs table detected." ) ; return ; } // the table exists.. does it have the content we need / expect? // Note: cannot escape/PDO this, so be careful with your config $ columns = $ this -> loadColumnListForTable ( $ slugsTable ) ; foreach ( [ config ( 'pxlcms.slugs.keys.module' ) , config ( 'pxlcms.slugs.keys.entry' ) , config ( 'pxlcms.slugs.keys.language' ) , ] as $ requiredColumn ) { if ( in_array ( $ requiredColumn , $ columns ) ) continue ; // column does not exist! $ this -> context -> log ( "Slugs table detected but not usable for Sluggable handling!" . " Missing required column '{$requiredColumn}'." , Generator :: LOG_LEVEL_WARNING ) ; return ; } $ this -> context -> slugStructurePresent = true ; $ this -> context -> log ( "Slugs table detected and considered usable for Sluggable handling." ) ; }
Detects whether this CMS has the 'typical' slug table setup
Detects whether this CMS has the typical slug table setup