Comments (10)
The locale class is actually two core functions (wrappers for the PHP ICU library) and the PHP gettext extension.
_() gettext
__() MessageFormatter
__date() DateFormatter wrapper
Together, those provide localization and support for ICU choices or locale aware dates.
from micromvc.
I'm getting similar problems as @filip-avocado, after installing MicroMVC for the first time I'm seeing the following in my error logs:
[Tue Nov 29 15:16:06 2011] [error] [client 127.0.0.1] PHP Warning: require(/home/chris/workspace/Miscellaneous/micromvc/Class/Locale.php): failed to open stream: No such file or directory in /home/chris/workspace/Miscellaneous/micromvc/Common.php on line 98
[Tue Nov 29 15:16:06 2011] [error] [client 127.0.0.1] PHP Fatal error: require(): Failed opening required '/home/chris/workspace/Miscellaneous/micromvc/Class/Locale.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/chris/workspace/Miscellaneous/micromvc/Common.php on line 98
from micromvc.
You need PHP's intl extension. You can install it via pecl or your distribution's packages. This should make the Locale
class available so it doesn't try to hit micromvc's autoloader.
Example (pecl):
sudo pecl install intl
Example (Fedora / RHEL / CentOS):
sudo yum install php-intl
Example (Debian/Ubuntu):
sudo apt-get install php5-intl
from micromvc.
Thanks @EvanDotPro, that fixed it.
from micromvc.
i use the wamp and enable php_intl, but this problem also exist;
Warning: require(H:\Wamp\www/Class/Locale.php) [function.require]: failed to open stream: No such file or directory in H:\Wamp\www\Common.php on line 98
from micromvc.
@togeak you should check with the WAMP developers. However, I'm sure that it's probably not loading right. Make sure you have the right build version, and make sure it's being loaded correctly. You can create a file and <?php phpinfo();
in it to see what is loaded and what version of PHP you are using.
from micromvc.
Wamp 2.2 / PHP 5.3.8
from micromvc.
c:\Program Files\PHP is not in the %PATH%, thanks!
from micromvc.
Figured I'd add this here in case anybody needs the knowledge later.
If you're trying to get this running locally on OS X 10.7.4 (using the installed Apache and PHP, not Mamp), it's not difficult.
At first I tried a standard sudo pecl install intl
, but it couldn't find the ICU libraries (because they didn't exist). So I needed to install ICU
Just go to http://site.icu-project.org/download and download the latest release (49.1.1 as of writing this). Then install from source like so:
cd path/to/icu/sources
cd source
chmod +x runConfigureICU configure install-sh
./runConfigureICU MacOSX
gnumake
sudo gnumake install
And you're done. Run sudo pecl install intl
and it should work just fine. Use the default location for the ICU libraries (mine didn't say where the default location was, just that it was the default).
from micromvc.
Hint for Windows/Xampp users (like me): copy all the icu* files from /xampp/php/ folder to /xampp/apache/bin/
and add the line extension=php_intl.dll to your php.ini
[Original hint from apachefriends.org forum ]
from micromvc.
Related Issues (20)
- PHPUnit
- Bug in ORM.php HOT 1
- How to: Form Validation HOT 2
- Installing micro/micro error! HOT 2
- too many installation problems HOT 1
- About Locale.php
- Tag releases request
- Cannot load css file HOT 2
- Error ID: Issue
- Where not equal HOT 2
- Getting Page not Found HOT 1
- Deprecated iconv_set_encoding in PHP 5.6 HOT 2
- About localization
- PHP 5.3 -> PHP 5.5
- How to write another default method in Controller and access via Route HOT 3
- How to write hook
- has development stopped on micromvc? HOT 1
- multiple database connections?
- PHP7 + MicroMVC
- The domain `micromvc.com` is already lost? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micromvc.