library/Garp/Cli/Command/Snippet.php
protected function _createFromFile($file) {
        if (!file_exists($file)) {
            Garp_Cli::errorOut("File not found: {$file}. Adding no snippets.");
            return false;
        }
        $config = new Garp_Config_Ini($file, APPLICATION_ENV);
        if (!isset($config->snippets)) {
            Garp_Cli::lineOut('Could not find any snippets. I\'m stopping now... This is awkward.');
            return true;
        }

        $snippetNoun = 'snippets';
        $snippetCount = count($config->snippets);
        if ($snippetCount === 1) {
            $snippetNoun = 'snippet';
        }
        Garp_Cli::lineOut("About to add {$snippetCount} {$snippetNoun} from {$file}");
        Garp_Cli::lineOut('');
        $this->_createSnippets($config->snippets);
        Garp_Cli::lineOut('Done.');
        Garp_Cli::lineOut('');
        return true;
    }
protected function _createFromFile($file) {
        if (!file_exists($file)) {
            Garp_Cli::errorOut("File not found: {$file}. Adding no snippets.");
            return false;
        }
        $config = new Garp_Config_Ini($file, APPLICATION_ENV);
        if (!isset($config->snippets)) {
            Garp_Cli::lineOut('Could not find any snippets. I\'m stopping now... This is awkward.');
            return true;
        }

        $snippetNoun = 'snippets';
        $snippetCount = count($config->snippets);
        if ($snippetCount === 1) {
            $snippetNoun = 'snippet';
        }
        Garp_Cli::lineOut("About to add {$snippetCount} {$snippetNoun} from {$file}");
        Garp_Cli::lineOut('');
        $this->_createSnippets($config->snippets);
        Garp_Cli::lineOut('Done.');
        Garp_Cli::lineOut('');
        return true;
    }
protected function _createFromFile ( $ file ) { if ( ! file_exists ( $ file ) ) { Garp_Cli :: errorOut ( "File not found: {$file}. Adding no snippets." ) ; return false ; } $ config = new Garp_Config_Ini ( $ file , APPLICATION_ENV ) ; if ( ! isset ( $ config -> snippets ) ) { Garp_Cli :: lineOut ( 'Could not find any snippets. I\'m stopping now... This is awkward.' ) ; return true ; } $ snippetNoun = 'snippets' ; $ snippetCount = count ( $ config -> snippets ) ; if ( $ snippetCount === 1 ) { $ snippetNoun = 'snippet' ; } Garp_Cli :: lineOut ( "About to add {$snippetCount} {$snippetNoun} from {$file}" ) ; Garp_Cli :: lineOut ( '' ) ; $ this -> _createSnippets ( $ config -> snippets ) ; Garp_Cli :: lineOut ( 'Done.' ) ; Garp_Cli :: lineOut ( '' ) ; return true ; }
Create a bunch of snippets from a file

@param string $file
@return bool
Create a bunch of snippets from a file